Batch Invoicing Script for Crystal Report

SOLVED

I am revisiting a previous issue/post, https://www.sagecity.com/us/sage100_erp/f/sage-100-personalization-customization-and-productivity-tools/160212/udf-header-to-invoice-detail/423464#423464, since I do not have much experience in crystal, do I create the formula in crystal or do I need to create a script in the SO Detail?  I have my SOInvoice detail "UDF_EXTCUSTPO" sourced from the SOHeader "UDF_EXTCUSTPO", I need this UDF on the details to print on the invoice next to the lines for that SO when batch invoicing.  I am assuming the UDF will not change values when the "applied SO" value changes per line.  

Parents
  • 0

    If you don't ever add more than one SO to an invoice, your line UDF should be fine... just add it to the invoice work table, and update the report.

    If you do invoice more than one SO at a time you'd need an invoice detail script (as referenced in the linked thread), so the line UDF value comes from the right SO.  After that, add your field to the work table, then update the report.

  • 0 in reply to Kevin M

    For testing purposes I had to use another UDF other than the one mentioned above.  I created the UDF_CoreOrderNumber on the SO Invoice details, so it shows next to each line with the different values because each line is from a different SO.  When I add the  UDF_CoreOrderNumber field to the crystal report it only pulls the "master SO" UDF_CoreOrderNumber value.  I am not understanding how a script on the details will work, and why the field isn't treated like the itemcode or any other fields on the detail level.

  • 0 in reply to jland47

    In the invoice line script, open an object using the AppliedSalesOrderNo (not sure if there is a Child Handle available), get the value from that object, and write it back to the invoice line.

    You can pop-up a list of GetChildHandle options for a business object with something like this:

    oSession.AsObject(oSession.UI).MessageBox "", "" & oBusObj.GetDataSources()

    If it's not there, use a new service object (requires the user to have access to SO Inquiry). 

    If there, something like this should work for the object creation.

    retVal = oBusObj.ReadAdditional("AppliedSalesOrderNo")
    Set oAppliedSO = oSession.AsObject(oBusObj.GetChildHandle("AppliedSalesOrderNo"))

  • 0 in reply to Kevin M

    Once the udf is written back to the invoice line on the SO Invoice data entry panel, how do you get it to show on the crystal report and not revert back to the "master" SO udf value?

  • 0 in reply to jland47

    Source a work table UDF from your invoice line UDF.  (Tab 3, if you want to update an existing work table UDF).

  • 0 in reply to Kevin M

    Can you see anything from these screen shots that look off?

    invprint.pdfsoinvdata.pdfcrystal.pdf

  • +1 in reply to jland47
    verified answer

    Open Custom Office, UDF maintenance... SO Invoice Work... Edit fields... and open your UDF. 

    Fix the data sources on tab 3... choosing your line UDF as the column.

Reply Children