Suitescript Error: Invalid item reference key

Hi, I am trying to use record.setCurrentSublistText as setting an item in a sublist line item and it always give me this kind of error “Invalid item reference key” though the item name that I set is correct and no longer sure why is that error occuring?

Rookie Asked on February 15, 2024 in SuiteScript.
Add Comment
2 Answer(s)

Is the record loaded dynamically?

Has the customer/subsidiary been set already?

Is the item a child (may need to include the parent : child)

Is there a item filter on the form?

Why are you setting the text value? Always better to set the internal id of the item with setCurrentSublistValue)

Rookie Answered on February 15, 2024.

I am facing issue while creating return authorization of sales order suing suitelet. the error is “Invalid item reference key 27211 for subsidiary 9.”
the item is service item with parent subsidiary with “inclide children” checkbox checked. the customer for which the Rth is being created is of child subsidiary.

on April 15, 2025.
Add Comment

You get that error when the record you entered is an extant record, but it’s not a valid selection for some reason. So there’s something invalid about your item selection. E.g. the item is only for purchase and is on a sales transaction, the item is not exposed in the selected subsidiary, etc.  I’d recommend pulling up both the item record and the transaction in the UI to poke around and see if you can figure out why it’s not a valid selection.

Intermediate Answered on February 15, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   SuiteMigration   Become a Sponsor