cancel
Showing results for 
Search instead for 
Did you mean: 

Service Layer doesn't trigger Approval SAP B1

KSmba
Discoverer
0 Kudos
170

Hello

We have an application that create sales order in SAP B1 via service layer

The sales order document has an approval process and it's work well in SAP B1

But when we do the same via Service layer , it's create the sales order directly and doesn't transform it on draft etc..

I activated the function 'Enable Approval Process in DI'

KSmba_0-1741948894889.png

The user 'manager' trigger the approval when creating the document and is the same that we use in our test (Application and even via postman) the sales order is still created directly

 

{
    "CardCode": "CBONIFAIXD",
    "DocDueDate": "2025-03-14",
    "DocumentLines": [
        {
            "ItemCode": "71.150",
            "Quantity": "200"
        }
    ]
}

 

 

KSmba_1-1741949455092.png

Can you please help ?

UPDATE : I was able to trigger the approval process but it only seems to work when i put 

KSmba_0-1741959915460.png

and not when i use sql user queries

View Entire Topic
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi KSmba ,

Please refer to SAP Note 1681542, which states that triggering Approval Procedures based on User Queries via the DI API and Service Layer is not possible.

This limitation applies to the DI API, DTW, and Service Layer. Unfortunately, there is no viable workaround for this.

The functionality can only be performed manually through the SAP Business One Client.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

KSmba
Discoverer
0 Kudos
Ok , but is there a possibility to attach or link draft document to an approval template ? I mean , in our application we can handle user queries and do the calculation and verification before posting via service layer and create draft document for exemple if the condition is Ok . The only thing we need is to link these draft to approval procedures , via SAP B1 client or via another way