Prem Singh
03/03/2021, 3:43 AM"name": "UNEXPECTED_ERROR",
`"message": "TypeError: Cannot call method \"getParameter\" of undefined (Contact Company from URL.js$1108550#5)",`", I have used srcript as var contact = record.create({
type: record.Type.CONTACT,
isDynamic: true,
});
contact.setValue({
fieldId: 'subsidiary',
value: '2'
});
contact.setValue({
fieldId: 'firstname',
value: requestBody.firstname
});
contact.setValue({
fieldId: 'email',
value: requestBody.email
});
contact.setValue({
fieldId: 'isperson', value: 'T'
});
contact.setValue({
fieldId: 'lastname',
value: requestBody.lastname
});
contact.setValue({
fieldId: 'custentity_pg_cus_short_name',
value: requestBody.firstname
});
contact.setValue({
fieldId :'custentity_cseg_cust_cat_segmt',
value: '1'
});
contact.setValue({
fieldId :'custentity_cseg2',
value: '6'
});
contact.setValue({
fieldId: 'entityid',
value: requestBody.firstname + " " + requestBody.lastname
});
contact.setValue({
fieldId: 'companyid',
value:'2085'
});
contact.setValue({
fieldId: 'parentcompany',
value:'2085'
});
contact.save({
ignoreMandatoryFields: true
});
return contact;battk
03/03/2021, 3:59 AMbattk
03/03/2021, 3:59 AMbattk
03/03/2021, 4:00 AMbattk
03/03/2021, 4:00 AMstalbert
03/03/2021, 4:00 AMstalbert
03/03/2021, 4:02 AMmichoel
03/03/2021, 4:15 AMconst contactFields = {
subsidiary: 2,
firstname: requestBody.firstname,
email: requestBody.email,
isperson: true,
// etc..
}
for (const [fieldId, value] of Object.entries(contactFields)) {
contact.setValue({ fieldId, value });
}
stalbert
03/03/2021, 2:10 PM