JohnnyC
01/17/2020, 3:23 AMmichoel
01/17/2020, 3:24 AMJohnnyC
01/17/2020, 3:24 AMmichoel
01/17/2020, 3:25 AMJohnnyC
01/17/2020, 3:26 AMJohnnyC
01/17/2020, 3:30 AMbattk
01/17/2020, 3:35 AMbattk
01/17/2020, 3:36 AMJohnnyC
01/17/2020, 4:44 PMbattk
01/17/2020, 4:51 PMbattk
01/17/2020, 4:52 PMJohnnyC
01/17/2020, 6:15 PMbattk
01/17/2020, 6:27 PMJohnnyC
01/17/2020, 6:31 PM/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/search','./mtg_lib_credit_policy.js'],
/**
* @param {search} search
*/
function(search,mtcpe) {
/**
* Function to be executed after page is initialized.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.currentRecord - Current form record
* @param {string} scriptContext.mode - The mode in which the record is being accessed (create, copy, or edit)
*
* @since 2015.2
*/
function pageInit(scriptContext) {
mtcpe.init(scriptContext.currentRecord);
}
return {
pageInit: pageInit,
fieldChanged:fieldChanged
};
});
JohnnyC
01/17/2020, 6:35 PMAnd then the lib define(['N/search'],
/**
* @param {search} search
*/
function(search) {
var _currentRecord = null;
function loadCustomerFields(){
// Lookup the override flags from the customer and the customers classification.
var custFields = search.lookupFields({
type:'customer',id:'1338830',
columns:['custentity_mtg_poitems_any_pmtmthd','custentity_mtg_donotapply_credit_policy','custentity_mtg_secondary_class']
});
console.log(custFields);
}
return {
/**
* Initializing the library
* @param {NSRecord} paramCurrRecord netsuite record object representing a sales order or estimate
*/
init:function(paramCurrRecord,paramSearch){
_currentRecord = paramCurrRecord;
loadCustomerFields();
}
};
});
battk
01/17/2020, 7:06 PMbattk
01/17/2020, 7:07 PMbattk
01/17/2020, 7:07 PMJohnnyC
01/17/2020, 7:12 PMbattk
01/17/2020, 7:14 PMbattk
01/17/2020, 7:15 PMJohnnyC
01/17/2020, 7:16 PMJohnnyC
01/18/2020, 1:33 AM