I have a UE script that is creating a customer rec...
# suitescript
j
I have a UE script that is creating a customer record (works) and then creating a contact record immediately afterwards. The created contact will get the customer set as its "company" to tie them together. I keep getting this error:
Copy code
"You have entered an Invalid Field Value 1898042 for the following field: company"
I have tried parseInt() on the value. I have set it in the browser console with success. But for whatever reason, it won't let me set it with the script. The snippet setting the company value is below. Like I said, this snipper works in the browser console just fine when I load in the modules. Any insight is appreciated.
Copy code
secondHomeowner.setValue({
    fieldId: 'company',
    value: savedhomeowner
});
Additionally, I have tried to create the contact record without setting the company field, saving, re-loading, and setting it without success. I get the same error. I have confirmed that the customer record exists with the specific internalid mentioned in each error.
c
Make sure you set the subsidiary on the contact
j
We don't have subsidiaries.
If I remove that bit of code setting the company, it creates the contact record just fine. I have tried setting it with a static value instead of a variable with no luck as well.
c
If you create a Contact in the UI are there any fields being pre-populated that are required that you are not setting? Anything under classification?
j
No, but now that you mention it, it looks like the company name filter is not showing all values. I'm wondering if it's filtered somehow. Gonna follow that path.
Okay, I found the issue. It was a misunderstanding on my end. The customer I am creating is an "individual" instead of a company. Which means it can't have contact records attached to it (at least not in our configuration if that matters). Have to rethink a part of this process.
👍 2
e
How about creating "child" customer records under a "parent" customer record? The child customer record will have the hierarchy designation like how class is structured. So... PARENT CUSTOMER : CHILD CUSTOMER 1, PARENT CUSTOMER : CHILD CUSTOMER 2...
j
I believe the parent route is the one I'll have to take.