A client script can be deployed to set the Voucher field to checked if the settings is same as stated above.
Create this sample script:
function voucherCheck(){
var checktype = nlapiGetContext().getPreference('CHECKTYPE');// This line will check Check Printing settings.
if (checktype == 'VOUCHER') {
nlapiSetFieldValue('printvoucher', true);
}
}
1. Navigate to Customization > Scripting > Scripts > New
2. SCRIPT FILE > select your script > click Create Script Record button
3. Select Client
4. Enter information needed on the Basic Information:
Name: (name of your script)
Scripts > Script : Upload the sample script.
Page Init Function : voucherCheck
Deployments > Applies to: Vendor Payment
Deployed: Yes
Status: Released
Save
No comments:
Post a Comment