Wednesday, November 21, 2018

Automatically Set the Bank Account in the Cash Sale depending on the Subsidiary in One World Accounts

When there is a Default Payment Account selected in Setup > Accounting > Accounting Preferences > Items/Transactions tab, this will result in " Invalid account reference key 250 for entity 183553" upon billing the Sales Order. This is because a Bank Account can only be associated to a single subsidiary, and this error usuallly happens for the subsidiary not associated with the bank account.

Note: 250 is the internal ID of the account and 183553 is the internal ID of the customer record.

1. Create a Before Load user event script.

2. Navigate to Setup > Customization > Scripts > New > User Event.
3. In the Scripts tab > Script File dropdown, select the js file created.
4. In the Before Load Function field, enter the name of the after submit function in the js file. In the sample script, the function name is beforeLoadSetAccount, so enter "beforeLoadSetAccount" in this field.
5. Navigate to the Deployments tab. In the Applies to column, select Cash Sale.
6. Click Save.


 

No comments:

Post a Comment