Wednesday, December 26, 2018

Change the Custom Form on View Mode via Script

Deploy the following script as a User Event script for Before Load Function on your desired Record type.

function changeform()
{
    var currentForm = request.getParameter('cf');
    if (nlapiGetContext().getExecutionContext() == 'userinterface' && type == 'view' && currentForm != '10') {


        var formId = 10; // Custom form Internal ID of the desired form
        nlapiSetRedirectURL('RECORD', nlapiGetRecordType(), nlapiGetRecordId(), false, {
            cf: formId
        });
    }
    return;
}

DISCLAIMER: The sample code described herein is provided on an"as is" basis, without warranty of any kind, to the fullest extentpermitted by law. Oracle + NetSuite Inc. does not warrant or guarantee theindividual success developers may have in implementing the sample code on theirdevelopment platforms or in using their own Web server configurations.

Oracle +NetSuite Inc. does not warrant, guarantee or make any representations regardingthe use, results of use, accuracy, timeliness or completeness of any data orinformation relating to the sample code. Oracle + NetSuite Inc. disclaims allwarranties, express or implied, and in particular, disclaims all warranties ofmerchantability, fitness for a particular purpose, and warranties related tothe code, or any service or software related thereto.

Oracle + NetSuite Inc. shall notbe liable for any direct, indirect or consequential damages or costs of anytype arising out of any action taken by you or others related to the samplecode

No comments:

Post a Comment