cancel
Showing results for 
Search instead for 
Did you mean: 

How to expose a B1 Add-on via webservice or API

mehdilearnssap
Explorer
0 Kudos
207

As stated in the title, I have an existing Business one Add-on and woul dlike to expose it's functionalities via web service or API in order to make a web app, so that instead of going to SAP Business One client, you can perform all its functionalities from the web app, and I wonder how can I do that ? what am I going to need beforehand ?

Kind regards
CHERAI El Mehdi

Accepted Solutions (0)

Answers (2)

Answers (2)

Johan_Hakkesteegt
Active Contributor

Hi CHERAI El Mehdi,

An addon is a piece of software that uses the B1 client to work. Generally speaking it will automate client processes, and/or make these processes more user friendly and/or add functionality to the B1 client.

That means that you cannot "expose" it. What you can do, is create a whole new program that does the same thing as the addon you mentioned. There are different ways for such a program to interact with the B1 system, that do not require the B1 client.

Depending on what the addon does, another alternative is to have a web application create and upload files to your server, that can be used by the original addon.

Regards,

Johan

Johan_Hakkesteegt
Active Contributor
0 Kudos

Hi mehdilearnssap,

"So following your answer what I can do is create a webpage for example that has the same fields, and retrieves the same data that add-on does, ..."

That is correct.

"...and it will send the data to the add-on to use it ?"

The original addon will have nothing to do with it. It and your web application will both use the same source data from the company database, and send entered data to the same tables and fields, that is all. Your web application will have to send the entered data somehow to the company database.

"but how can I trigger it to perform the action ?"

Your web application (web page) will likely have a 'Submit' button on it. This button would activate the script that sends the data to the company database. Very much like a contact form on any normal web site. You know, where you enter your contact details and a message and press the submit button, and the owner of the web site will receive an email with the data you entered.

"does the service layer help ?"

The service layer is one of the better options for interaction with the company database when working with web applications, so in this case I would definitely recommend you look into it.

Regards,

Johan

mehdilearnssap
Explorer

Your answer hit me like a truck.
I better start now I got a 10k lines of code to reproduce. I appreciate the help tho.

Regards

El Mehdi

mehdilearnssap
Explorer
0 Kudos

The Add-on is for sales (promotions) where you chose which products from a form (SKU, Model, Color, Product category sub category etc..) and you chose a markup and then update the prices of the products.

So following your answer what I can do is create a webpage for example that has the same fields, and retrieves the same data that add-on does, and it will send the data to the add-on to use it ? but how can I trigger it to perform the action ? does the service layer help ?

Regards

CHERAI El Mehdi