Determining if an order is a credit note in SO Create New BF

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

Determining if an order is a credit note in SO Create New BF

Postby changsen.wu » Wed Sep 03, 2014 10:33 am

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.
changsen.wu
I'm new here
I'm new here
 
Posts: 8
Joined: Wed Sep 03, 2014 10:20 am

Re: Determining if an order is a credit note in SO Create Ne

Postby Mike.Sheen » Wed Sep 03, 2014 10:47 am

changsen.wu wrote: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


Hi Changsen,

The NewSalesOrderType parameter will be NewSalesOrderTypes.e_NewSalesOrderCreditNote (1) when the SalesOrderCreateNewBefore event is raised when creating a credit note. If it is a credit note based on a sales order, then the InvoiceHistoryID parameter will be non-blank.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 5 guests

cron