Hi Team, I'm trying to change the `custom form` on...
# suitescript
r
Hi Team, I'm trying to change the
custom form
on a Payment via UE After submit (need to check the invoice before I change it) but I am getting a error
Copy code
APPLYING_AN_AMOUNT_CAUSED_THE_APPLICABLE_AMOUNT_TO_BE_EXCEEDED
I have used the following and UNCHECKED auto apply. Tried with and without dynamic
Copy code
var paymentRec = record.load({type: record.Type.CUSTOMER_PAYMENT, id: newRecord.id, isDynamic: true});
            var isAutoApply = newRecord.getValue('autoapply');
            log.debug('isAutoApply', 'isAutoApply: ' + isAutoApply);

            paymentRec.setValue({fieldId: 'autoapply', value: false});
            paymentRec.setValue({fieldId: 'customform', value: FORMS.PAYMENT_RECEIPT_WM});
            paymentRec.save();
Any thoughts on what else I can try or if you have had this issue before
b
dont recognize that particular error, but changing the form is making all the fields you set beforehand irrelevant
the rule of dynamic mode is to set the fields in the same order you would in the ui
set auto apply to false and then change to form in the ui for a demonstration
r
In the UI I don't get the error. Only via script 😞 I tried submit form and the autoapply gets set to false but still get the error
Both forms are exactly the same only the connected PDF printout for each form is different
b
you are on your own for that error
but setting autoapply to false isnt doing anything
set a field in the ui and then change the form for a demonstration
r
Ns support help perhaps fingers crossed