Calculated Field Help

I am trying to write a calculated field to pull a custom field created in 3-6 that we plan to use when a customer wants invoices/statements emailed.  My current formula works, but repeats the result (I believe for the number of jobs created under this client number?)  Does anyone have a suggestion that works in Sage100 Contractor 2017 (v 20.5)?

My custom fields are designated as follows:

recc_u.udf001 = the client # (I created this because otherwise I did not know how to join the 3-6 custom fields table to the 3-6 table

recc_u.udf002 = the client's email address

[SELECT recc_u.udf002 FROM acrinv, actrec, reccln, recc_u, acrinv INNER JOIN actrec ON acrinv.jobnum = actrec.recnum, actrec INNER JOIN reccln ON actrec.clnnum =reccln.recnum, reccln INNER JOIN recc_u ON reccln.recnum = recc_u.udf001 WHERE acrinv.jobnum ={actrec.recnum} AND actrec.clnnum = {reccln.recnum} AND recc_u.udf001 ={reccln.recnum} ]

Thank you!!

  • 0
    What is your base table? ActRec? or AcrInv? I think it may matter, especially in the FROM segment.

    The documentation is woefully inadequate on the subject of reporting out the new user defined data tables. I suspect, but haven't been able to confirm yet, that recc_u links to reccln on recc_u._idnum = reccln._idnum. The database formats report has suppressed, for the most part, the _idnum field (which seems to be a new SQL Server field) in all tables. I think this link would make your udf001 superfluous. Again, I haven't been able to test this yet. I hope that these udf tables and fields will be included more in the prebuilt links so that we can more easily access them in report writing. For instance, from ActRec I see no prebuilt link into Recc_u, but there really should be one. As time passes, hopefully Sage will continue to flesh out this terrific new functionality.
  • 0 in reply to Walt Mathieson
    Base table would be AcrInv. It would be wonderful if the _idnum field would link the tables. I would love to get rid of the work around I have created.