cancel
Showing results for 
Search instead for 
Did you mean: 

B1 Service Layer - Update Order Discount

peterwatkins
Explorer
0 Kudos

Hi,

I am using the SAP B1 Service layer to update a sales order that already has a discount applied. When I try and pass through a new 'DiscountPercent', I am receiving the following error:
'[ORDR.DiscSum] , 'Field cannot be updated'

Is there a workaround for this so I can update sales orders that have total discounts applied?

Cheers.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi peterwatkins,

Can you please share the screenshot showing the current discount settings and the sample request to update the same?

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

 

peterwatkins
Explorer
0 Kudos

When I submit the order via the service layer, I am using POST to send a json request to "/b1s/v1/Orders". In that json I am setting "DiscountPercent": "11.86"

peterwatkins_0-1708571103199.png

Then if I use PATCH to send another json request to "/b1s/v1/Orders(<SalesOrderID>)" and I again set "DiscountPercent": "10.00", I get the following error response message back from SAP Service Layer - "Error processing order. 10000724 - [ORDR.DiscSum] , 'Field cannot be updated (ODBC -1029)'"

I only receive this error when using PATCH if there was a discount already set for the document. If the originally sales order doesn't have a discount set, the PATCH is successful.

Accepted Solutions (0)

Answers (1)

Answers (1)

peterwatkins
Explorer
0 Kudos

When I submit the order via the service layer, I am using POST to send a json request to "/b1s/v1/Orders". In that json I am setting "DiscountPercent": "11.86"

peterwatkins_0-1708571103199.png

Then if I use PATCH to send another json request to "/b1s/v1/Orders(<SalesOrderID>)" and I again set "DiscountPercent": "10.00", I get the following error response message back from SAP Service Layer - "Error processing order. 10000724 - [ORDR.DiscSum] , 'Field cannot be updated (ODBC -1029)'"

I only receive this error when using PATCH if there was a discount already set for the document. If the originally sales order doesn't have a discount set, the PATCH is successful.