Showing results for 
Search instead for 
Did you mean: 

SQL Queries with Service Layer returns error code 402


I add the table to allowlist in b1s_sqltable.conf file and the table is newly created

I try this:


with this body:

 "SqlCode": "getSyncItems",
 "SqlName": "GetItems",
 "SqlText": "select ItemCode, ItemName  from SYNC"

And receive this response:

"error": { "code": 402, "message": { "lang": "en-us", "value": "Bad configuration in file 'b1s_sqltable.conf'" } }<br>
View Entire Topic
0 Kudos

We had the same problem after updating from fp2110 to sp2402. We did this (from troubleshooting note 3064927 - this part is same both on linux and windows, different folders):

    • The issue could be related to corrupted SQLQueries config file. Goto ServiceLayer Installation folder (%ProgramFiles%\SAP\SAP Business One ServerTools\ServiceLayer\Conf\).
    • Rename the file b1s_sqltable.conf to b1s_sqltable_backup.conf
    • Open b1s_sqltable.template.conf and save as b1s_sqltable.conf.
    • Restart the Service Layer Service.

After that b1s/v1/SQLQueries worked well, but we had to manually edit the b1s_sqltable.conf file and add some tables that we needed for our queries.