Melissa
03/24/2025, 11:29 PMrecord.save({ignoreMandatoryFields:true});
says:
"You must enter at least one line for sublist: Address",
So, you can create a lead record in the UI without an address, and the exact same lead creation code is working in a different Suitelet. Here is the code:
newCustomer = record.create({
type: record.Type.LEAD,
isDynamic: true
});
newCustomer.setValue({fieldId:'custform', value:-8});
newCustomer.setValue({fieldId:'firstname', value:firstName});
newCustomer.setValue({fieldId:'lastname', value:lastName});
newCustomer.setValue({fieldId:'email', value:caseEmail});
newCustomer.setValue({fieldId:'phone', value:casePhone});
newCustomer.setValue({fieldId:'isperson', value:'T'});
customerId = newCustomer.save({ignoreMandatoryFields:true});
Any ideas on what's wrong? Thank you!!
edit: Oh, and all the variables have a value. The data is in the POST, so it's not like the form isn't posting.
edit2: and yes, all these leads should be for an individual, so the isperson
is just hard coded true. thanks again!
edit3 (😅 ) in the other Suitelet where this works, the record that is created sets the first name and last name fields into the address sublist. However, there is nothing in that Suitelet that sets a sublist value.creece
03/24/2025, 11:50 PMMelissa
03/24/2025, 11:55 PMMelissa
03/24/2025, 11:56 PMAnthony OConnor
03/24/2025, 11:59 PMAnthony OConnor
03/25/2025, 12:00 AMAnthony OConnor
03/25/2025, 12:01 AM-8
form?Melissa
03/25/2025, 12:01 AMAnthony OConnor
03/25/2025, 12:06 AMMelissa
03/25/2025, 12:09 AMMelissa
03/25/2025, 12:09 AMAnthony OConnor
03/25/2025, 12:10 AMAnthony OConnor
03/25/2025, 12:11 AMAnthony OConnor
03/25/2025, 12:12 AMMelissa
03/25/2025, 12:13 AMAnthony OConnor
03/25/2025, 12:15 AMMelissa
03/25/2025, 12:20 AM'N/ui/serverWidget'
whereas the Suitelet throwing the error, the form is loaded from a template, like this:
let myHtml = file.load({id: '/SuiteScripts/dev/templates/customer-service-form-template.html'})
but the data makes it into the post and everything in the template HTML is named and id'ed with custpage_SomeFieldName
Could that be the problem, though? That it's loaded from a template, even though all the data is in the POST?
And the reason for the template on the non-working Suitelet is because it going to be a pretty involved UI and it looks better/is easier to just write the HTML, if that makes senseAnthony OConnor
03/25/2025, 12:22 AMMelissa
03/25/2025, 12:25 AMMelissa
03/25/2025, 12:27 AM'N/ui/serverWidget'
because there is a lot to the page.Anthony OConnor
03/25/2025, 12:36 AMAnthony OConnor
03/25/2025, 12:36 AMAnthony OConnor
03/25/2025, 12:36 AMerictgrubaugh
03/25/2025, 3:52 PMMelissa
03/25/2025, 4:18 PMerictgrubaugh
03/25/2025, 4:39 PMMelissa
03/25/2025, 5:05 PM