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?
Unfortunately, a brief test on version 2018 resulted in neither the post validate of CurrentInvoiceNo or the pre write of SO_SalesOrderHeader events firing when invoicing a sales order.
As Kevin pointed…
It is possible that Sage writes this value without triggering any BOI events. That would be unusual, but technically possible. Header Pre-Write would probably be the best bet (with a GetValue added to…
In my test, the script did not fire on either event attached to SO_SalesOrderHeader but I would think you could instead put the script on the post write event of SO_InvoiceHeader and get the value of the…
Not sure if this helps, but you can probably get the information from the SO_SalesOrderHistoryHeader file. This file should have an invoice number field. It will be blank if an invoice has not been created.
No, unfortunately that doesn't help. I don't need the invoice number, I need a constant value of Y or maybe like the date the invoice was created.
Nevermind, I figured it out.
Nevermind, no I didn't
If you want to translate this field value into a Y/N UDF, you'd need a script.
You can also check the OrderType field in SO header. S = no invoice. B = at least one invoice.
That Last Invoice Date field would work. How did you get that populated?
Our OrderType field never changes. It's always Standard.
Go into SO Invoice Entry, create a new invoice, and enter the SO # (before leaving the Header tab). Set line quantities, post, and the SO is updated then with what was invoiced (but if all lines were shipped complete, the SO disappears from SO Entry). If any lines were short-shipped, the OrderType changes to B, with a Last Invoice No populated and line quantities updated.
Retaining SO history is optional, and if you need to report on fully shipped SO, you will want to ensure that is turned on.
Go into SO Invoice Entry, create a new invoice, and enter the SO # (before leaving the Header tab). Set line quantities, post, and the SO is updated then with what was invoiced (but if all lines were shipped complete, the SO disappears from SO Entry). If any lines were short-shipped, the OrderType changes to B, with a Last Invoice No populated and line quantities updated.
Retaining SO history is optional, and if you need to report on fully shipped SO, you will want to ensure that is turned on.
Oh, we create all orders in Sales Order Entry. I guess that's why those fields don't work? And the order type never changes?
An SO is not a transaction, it is a potential transaction.
Create SO in SO Entry, then invoice in SO Invoice Entry.
If you are not invoicing, you are not processing the transactions (removing inventory, creating the GL entries, creating the invoices for customers to pay...).
Yeah, we just don't use Invoice Entry to invoice them. Either Starship or Scanforce creates our invoice, depending on the order type, and writes it back to Sage.
That is fine. There are other ways to create the invoices... it doesn't need to be though the Sage interface, but the invoice data should go to those tables.
You are posting the invoices? If you look at them in AR invoice history inquiry, there is an SO # listed?
If yes, then the SO should either be "B" or gone from the open SO tables.
Oh, I'm talking about before we run the update (before they go to history).
I want an identifier that tells me when an open SO has been invoiced. It will not be posted at this point.
Well, I'd like to get into scripting but don't know where to begin.
Could anyone help me out with a simple script where IF the CurrentInvoiceNo field is > 1, it populates a UDF with a Y?
Column post validate on that field.
if value <> "" then
retVal = oBusObj.SetValue("UDF_YOURFIELDNAMEHERE$", "Y")
else
retVal = oBusObj.SetValue("UDF_YOURFIELDNAMEHERE$", "N")
end if
Unfortunately, a brief test on version 2018 resulted in neither the post validate of CurrentInvoiceNo or the pre write of SO_SalesOrderHeader events firing when invoicing a sales order.
As Kevin pointed out, if the CurrentInvoiceNo field is populated, it is currently being shipped/invoiced. You can use this in the sales order entry/inquiry lookup or any reports you might be running to determine whether or not an invoice exists. In the report, you can always translate it to "Yes" or "No".
Once it is posted and if you are retaining sales history, then you can refer to LastInvoiceDate and/or LastInvoiceNo fields in SO_SalesOrderHistoryHeader if you are using SO History vs AR Invoice History for orders that shipped complete. If the order was not shipped complete, then you can refer to LastInvoiceOrderDate and LastInvoiceOrderNo in SO_SalesOrderHeader.
You're saying that script won't work?
"As Kevin pointed out, if the CurrentInvoiceNo field is populated, it is currently being shipped/invoiced. You can use this in the sales order entry/inquiry lookup or any reports you might be running to determine whether or not an invoice exists. In the report, you can always translate it to "Yes" or "No"."
I need it to translate to "Yes"" or "No" for a 3rd party application, not for a report or anything within SAGE.
*Community Hub is the new name for Sage City