Hey everyone, I am stuck on an issue in one of my ...
# suitescript
c
Hey everyone, I am stuck on an issue in one of my scripts. I create an opportunity in Dymanic mode and then go to add items to the item Sublist. I get an error "You have entered an Invalid Field Value 2384 for the following field: item","id":"","stack":["<anonymous>(N/record/recordService.js) It doesn't matter what value I apply to the field I get this error. I will include a code example but this doesn't happen when I am adding a item record to the table if the opportunity exists. I am not able to save the opportunity if there aren't line items. I am passing in the record that is being created.
Copy code
currentOppRecord.selectNewLine({
                    sublistId: 'item',
                });
                
                currentOppRecord.setCurrentSublistValue({
                    sublistId: 'item',
                    fieldId: 'item',
                    value: 2384,
                });
1
j
have you already set the customer?
🙌 1
c
Yes, before passing it to the line items. The 'entity' field
When I look at the debugger it doesn't show it but I thought that was because I didn't save it
a
what native fields are you setting at the header level and in what order?
c
I think Jen found my issue. I was setting an invalid customer and then trying to add line items to that record. Once I mapped the correct field it flowed through correctly. I knew I was missing something simple!
👍 1