The client wants to unlink the sales order from the customer Deposit based on the payment method in the customer deposit record.
if(scriptContext.type == scriptContext.UserEventType.CREATE && (scriptContext.newRecord.getValue({fieldId: 'paymentmethod'}) == 10 ||scriptContext.newRecord.getValue({fieldId: 'paymentmethod'})==11)){
// let field = scriptContext.form.getField({id: 'salesorder'});
// field.updateDisplayType({
// displayType : serverWidget.FieldDisplayType.NORMAL
// });
scriptContext.newRecord.setValue({fieldId: 'custbody_jj_sales_order_id', value: scriptContext.newRecord.getValue({fieldId: 'salesorder'})});
scriptContext.newRecord.setValue({fieldId: 'salesorder', value: ''});
}