I'm getting the following error when trying to cre...
# suitescript
k
I'm getting the following error when trying to create a matrix child non-inventory item for resale:
Error: Uniqueness error - there is already an item with that name or name/parent combination.
but there is definitely no item with that name. What could be causing this?
b
whats the code
k
Untitled
The correct value for itemid comes up in the log on line 9 of that and it is unique
and the matrix parent definitely has no children because the same script just created it and this is its first child
e
I ran into this when I importing CSV records for matrix items. I needed to populate external id before the error went away.
b
whats your item data
k
Untitled
b
matrix items are weird enough that i suspect they aren't really supported in suitescript
toss all your extra fields and only include mandatory ones
k
I think I figured it out
It's inputting the full name with hierarchy
it should probably be without
now to find how to get that. I'd rather not parse the text
Found it. On the item record it's copying from it's got the itemid without hierarchy and I'm replacing the word "sample" with the word "sale" in the script. The script however is pulling from a search, not the record, and the search returns the full hierarchy for itemid instead of just the item name
How do you get name without hierarchy in a saved search? 😕
r
Is there a field like Item Name (No Hierarchy), I know the option is available for Subsidiary field
k
Answered by @Sandii in #C29J1BPM3
NVL(REGEXP_REPLACE(REGEXP_SUBSTR({name},': [^:]+*$'),': ',''),{name})
Well, that fixed the parent item name at least
but still getting the duplicate error on the matrix child
b
toss the fields that arent mandatory
k
ok trying that
b
extra make sure that the item field related to the matrix field is not set
for you i think that is custitem7