Wednesday, December 26, 2018

Ability to set the Voucher to checked when the Check Printing Option is Voucher when creating Bill Payment

This article will show how to set the Voucher field to checked when creating Bill Payment and the settings is Set Up > Company > Printing & Fax > Printing tab > Check Printing section > DEFAULT CHECK TYPE = Voucher.

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

This is an alternate solution for Enhancement 234173.

No comments:

Post a Comment