on 2025 May 19 3:50 PM
Hi guys, here again to ask your GURU help.
When I try to PATCH the value -1 for "TransportationCode" (no transport) via SL, the document takes casual values from OSHP table, but not -1.
I tried patching only the document head TransportationCode, but nothing to do, so I tried to patch even the lines combined with the head (as you can see by code below, tried also via PostMan) but results doesn't change: casual values existing in OSHP, also different between head and lines.
{
"DocEntry": 263,
"TransportationCode": -1,
"DocumentLines": [
{
"LineNum": 0,
"ShippingMethod": -1
}
]
}
Instead, if I patch with zero (nonsense, because not in the OSHP...) it is accepted and acquired.
Does anyone know where I'm wrong?
Thank you.
Request clarification before answering.
Hi dausto,
Refer to the following link for the solution:
Try to update ShippingMethod via DI-Api to -1 in order line
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.
Hi Ankit, thank you for your replay!!
Unfortunately, the solution you provide for DiApi doesn't works for me.
I try to explain better.
If I patch only the lines with "ShippingMethod": -2 the value in lines is correctly accepted and acquired as Null. OK!
But the header (ODRF) "TransportationCode" remain persistent with the previous value saved...
If I patch contextually "TransportationCode": -2 and "ShippingMethod": -2 , Lines acquire -2 and Head acquire -2 (wrong...).
If I patch contextually "TransportationCode": -1 (that is value saved by SAP GUI) and "ShippingMethod": -2 , Lines acquire Null (OK) but Head acquire casual value from OSHP (wrong...).
My scope is to set correctly TransportationCode": -1 that means "No transport" and the rows "ShippingMethod" should be consequent but not relevant for me.
Thank you.
Hi dausto,
If you would like to keep the same value on Lines, you will have to update the document twice.
In the first update, set value on the header as Null and change the value on lines to some other value as below:
PATCH /b1s/v1/Orders(1234)
{
"TransportationCode": null,
"DocumentLines": [
{
"LineNum": 0,
"ShippingMethod": 2
}
]
}
In the second update, set the desired value on the lines.
PATCH /b1s/v1/Orders(1234)
{
"TransportationCode": null,
"DocumentLines": [
{
"LineNum": 0,
"ShippingMethod": 3
}
]
}
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
User | Count |
---|---|
10 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 | |
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.