Reputation: 11
I'm trying to void transactions via script. It's working for all the other transactions except for check record and I can't figure out why. I'm getting the INVALID_RECORD_TYPE error. Here's a sample code I am using. var id = transaction.void({ type: 'check', id: 25 });
Thanks.
Upvotes: 0
Views: 1308
Reputation: 364
You must Reversing Journal and then this:
var checkId= transaction.void({
type: transaction.Type.CHECK,
id: 25
});
Upvotes: 0
Reputation: 929
Please check Setup > Accounting > Accounting Preferences > General: VOID TRANSACTIONS USING REVERSING JOURNALS.
If the preference is not checked, the Void button does not appear in checks and you get the invalid record type error.
Please check the Field Level help of the preference for details. You will need to toggle the preference (using N/config) before calling transaction.void on types that are not covered by your account setting.
Upvotes: 1