a month ago
I am trying to update and reorder valid values of a UserField via Service Layer.
If I remove the ValidValuesMD section, or if I try to add a new valid value, everything is working fine. But as soon as I want to PATCH an existing value the PATCH is executed with a "duplicate value" error.
Could it be that updating "Valid Values" (Deleting, Updating) is not possible at all via Service Layer API?
I couldn't find any solution so far. Just adding seems to be possible.
Many thanks in advance for any feedback.
Error:
PATCH https://localhost:50000/b1s/v1/UserFieldsMD(TableName='OOPR',FieldID=19)
{ "Description": "UDF01", "Name": "UDF01", "SubType": "st_Address", "TableName": "@UDT01", "Type": "db_Alpha",
"ValidValuesMD": [
{"Value": "1",
"Description": "TEST 1"
},
{
"Value": "3",
"Description": "Test 3"
},
{
"Value": "2",
"Description": "test"
}
]
}
Kind Regards
Hi Stef5,
Kindly refer to the following blog post: SAP Business One Service Layer: Entity CRUD - Update
The blog discusses about the header B1S-ReplaceCollectionsOnPatch=true which you need to use for your scenario.
Header B1S-ReplaceCollectionsOnPatch=true sets the update method as REPLACE, which means the whole content will be replaced and the mismatched old rows will be deleted.
In case of any issue, please do not hesitate to write us back.
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.