Videos Developing an Add-on
Hi, my name is Kumar, and in this video I will demonstrate how to develop an Add-on.
Before you start creating an Add-on, you must ensure that the system has Visual Studio iVend Add-on Template Installer. If you do not have it installed, then download it from CitiXsys Knowledge Portal from the tab Extensibility.
Then, install the iVend Add-on Template in the Visual Studio 2012 or 2013. Once it is installed, developer can use this template to create new iVend Add-on and furthermore subscribe the required event to extend the business functionality.
Now, let us start creating an Add-on. For that, let us go to Visual Studio and use the iVend Add-on Template to create Add-on. Go to File, say New, and New Project. Now, let us give a unique name to this project. I want to give name as Customer Bill Address Validation and then select the iVend Extensibility Template. Click Okay, and a project is created with customer bill address validation name.
Now, there are three functions exposed in the Add-on. The first function is Startup Add-on. This function can be used to write any logic which needs to be executed at the time of starting the Add-on and then second function is Register Events. This is the main function which can be used to subscribe all the required events by using the parameter which is Register Application Events, and the third function is shut down Add-on. This function can be used to write any logic which needs to be executed before shutting down the iVend application. This function can also be used to unsubscribe all the registered events.
In Management Console, whenever any end user will save the business object, the system will raise the before and after events. Currently, this is the list of events at Management Console, for which before and after events will be raised, and this is the list of events at Point of Sale.
Now, there are some mandatory steps to create an iVend Add-on, and these are you need to create a project by using the iVend Add-on Template at Visual Studio. Then, provide the unique name of the Add-on at the Add-on Configuration.XML file. We will give the name Customer Bill Address Validation. Make sure, this name should be unique for each Add-on as you can create N number of Add-ons for iVend.
Now, after this, right click on the Project and open the Properties tab. Now, developer needs to change the Assembly Name and Default Name Space value to the same name as project name. So, let us do the, and we will provide the same name. Similarly, Default Name Space and then let us save it.
Now, once this is done, user needs to subscribe the necessary events based on the requirement. Build the project in X86 format. For that, open the Configuration Manager and change the active solution platform for any CPU to X86 for both modes Debug as well as Release and Build the Solution. Save this and Build the Solution. The build is successfully created. This completes the mandatory steps to create the Add-on.
Now, for demonstration purpose, let us create an Add-on. We will use the same project in order to create an Add-on. As we have already provided the unique name to this Add-on, we have configured the XML file, and we have changed the Assembly Name and Default Name Space. Also, we have done the configuration from any CPU to X86. Now, we need to subscribe the before event of customer, which is before customer add/edit event at the Register Event function.
So, let us go to the Function, before customer add/edit event, and this will be my message if the customer billing address is empty while adding the customer. Now, we will save it and rebuild the solution.
So, once build is done, right click on the Project and click on Open Folder in File Explorer. Open the Bin folder, X86, Release, and create the .zip file by including the above project .DLL and .XML files. If any new .DLL is referenced then include them also.
Now, once this is done, we will go to Management Console and register this Add-on.
Now, before we move to Management Console, just copy this path so that it will be easy for us to register the Add-on in Management Console.
Now, we will go to Management Console. In Management Console, go to IT Administration and then select Add-on Manager. Here, click on button which says Add-on, and in the Add-on file path, browse the section and paste the path which we have copied, click Open and here is the Add-on .ZIP file, select this .ZIP file and you can see the Add-on name which we have provided in Visual Studio is appearing as an Add-on name. You can provide the description of the Add-on.
Let us provide some description, Customer Validation and make sure the Connect, Disconnect, Add-on column should be checked. Once this is done, click Okay, application will restart automatically, say Okay.
Now, since we have registered the Add-on, let us check the validation which we have provided through this Add-on. So, we will add some customer, go to Operations, Business Partner, click Customer. We will create a new customer, let us say I will give the name John Smith, let us provide the mandatory fields here, customers.
Now, if I will add this customer, it should give me a validation that the customer address is missing because I have provided an Add-on for the same purpose. If I say Okay, and you can see a message is populated, Billing Address is Mandatory, please provide the required information.
So, in this way, you can create Add-ons as per your requirements and you can use them in iVend. Also, this Add-on, you can disconnect it also as per your requirement. For example, we go back to our Administration, IT Administration, go to Add-on Manager and if we uncheck this and click Okay, the application will ask restart and this Add-on will no longer work. However, it is registered but it will no put the validation on customer, press Okay and it will start the application.
Now, if we again create a customer, click New and provide the name. We will give the mandatory fields. Now, this time since our Add-on is disconnected, it should not give the validation message and simply add the customer, I will say Okay, and you can see customer is added successfully.
So, in this way user can create Add-ons as per their requirement if they want to put any validation or any extensibility in iVend.
With this, we end our session on iVend Extensibility.
Thank you for watching this video.