Populate the data into text area based on selected value from drop downlist.

GSTIN Address is selected from drop down list. Based on the drop-down list, the address will populate in the GSTIN Address Text using client script

function fieldChanged(context) {
  try{
    var currentRecord = context.currentRecord;
     log.debug("currentRecord",currentRecord);
     var fieldId = context.fieldId;
     log.debug("fieldId",fieldId);
     var sublistName = context.sublistId;
     log.debug("sublistName",sublistName);
     var sublistFieldName = context.fieldId;
        log.debug("sublistFieldName",sublistFieldName)
        var line = context.line;
       
if (sublistFieldName === 'custbody_jj_gstin_address'){
           var gstinAddress = currentRecord.getValue({
        fieldId: 'custbody_jj_gstin_address'
       });
       log.debug("gstinAddress",gstinAddress);
       var customRecord1 = record.load({
          type: 'customrecord1235',
          id: gstinAddress
        });
        log.debug("customRecord1",customRecord1);
         var address = customRecord1.getValue({
          fieldId: 'custrecord1598' // Replace with the appropriate field ID on the custom record
        });
      log.debug("address",address);
            currentRecord.setValue({
                fieldId: 'custbody_jj_gstin_address_text',
                value: address
            });
       } 
    }catch(e){
  log.debug("error @fieldchanged",e);
}
  }

 

Leave a comment

Your email address will not be published. Required fields are marked *