Invoice Created UDF?

I'm trying to make a UDF in Sales Order Header that will be a Y/N value indicating whether or not an invoice has been created for that order.

Any ideas?

Parents Reply Children
  • 0 in reply to Brown0987

    What it the 3rd party external software trying to do?  Why does it need the value?  The SQL / Access idea would just provide reshaped query results, not change the way Sage works.

  • 0 in reply to Kevin M

    It's Starship. We are trying to filter out the orders that have already been invoiced. It pulls from SO Header. The only field in SO Header that changes when a sales order is invoiced is CurrentInvoiceNo (as far as I can tell).

    I can add CurrentInvoiceNo to the filter fields, but the only operators available are Equals, Not Equal, Contains, and Begins With. I can't do CurrentInvoiceNo LESS THAN 1 like I would in an ALE lookup.

    I have no way of using the filters to only show the orders with a blank CurrentInvoiceNo field. 

    If I had an Invoice Created UDF and it had a value of Y if CurrentInvoiceNo had a value, then I could do 'Not Equal to Y'

  • 0 in reply to Brown0987

    Not familiar enough with StarShip.

    Can you configure StarShip to use a custom SQL statement instead of a table?

    Can you use the Equals operator with a blank value?

    Can you use the Equals operator with a value set to NUL, NULL, nul, or null?

    At the very least, you could create an Access Passthrough query with the WHERE clause in the query and point StarShip to it. The WHERE clause would be the following.

    WHERE CurrentInvoiceNo IS NULL

  • 0 in reply to David Speck

    No on the custom SQL statement.

    I tried equals blank and i tried null. There is no wildcard character either.

    I've never heard of Access Passthrough but I can look into it. 

  • 0 in reply to Brown0987

    Have you ever used Business Insights Explorer?

    You can create a new report by walking though the wizard and when you get to the filter screen, you can use Less than 0 on the CurrentInvoiceNo field, this will create a SQL view with whatever name you gave the report (no spaces or underscores btw).

  • 0 in reply to David Speck

    "you could instead put the script on the post write event of SO_InvoiceHeader and get the value of the sales order number and then get a handle to the SO_SalesOrder_Bus object and set the value in the UDF yourself."

    How would this script look?