I am referring 6.5.13 vbscript breakout using COM.
In the sales order create new before breakout, the signature of the function is
Sub SalesOrderCreateNewBefore(MDIParentObject, FormObject, SalesOrderObject, NewSalesOrderType, DebtorSeed, DebtorSeedIsID, InvoiceHistoryID, JobID, QuoteID, rtnCancel, Static1, Static2, Static3, Static4, Static5, Static6)
I am trying to determine if it is the creation of a new credit note or sales order and set value to rtnCancel based on certain criteria. However, it appears that at this point, SalesOrderObject.CreditNote is always false even if a credit note is created (i.e., the Salesorder COM CreditNote property doesn't seem to have been set yet). Is there any other way to determine if it is a credit note. I can't use Sales Order Create Completed event because at this point, it is not possible to abort the creation of an SO (as it does not contain rtnCanel parameter). While I could get around the issue by disabling the credit note creation menu, and then recreate my own version as custom menus in SO (by calling the function mRecordNewNote_Click, assuming it is public, associated with credit note creations and setting one of the static variables before hand to indicate a credit note), it's a major pain and I'd prefer to see if there is a more elegant method.