Using Custom POS Commands in LS Central
Introduction:
LS Central provides an easy way to add Custom functionality through the use of POS External Commands.
These commands are executed on the POS and let me know you how to create them.
For this example, we will create a POS Command, to remove all the lines from the current transaction.
Pre-requisites:
- Microsoft Dynamics 365 Business Central On Premise V16.5
- LS Central V16
Demonstration:
You will need a Codeunit in which we define all the custom commands, all your Custom commands can be added in a single Codeunit.
Make sure to set the “TableNo” property to “POS Menu Line” table.
In the OnRun trigger, we have to handle two cases:
- Registering the module and associated commands.
- Procedure to execute when a command is called.
For handling the first case, we create a procedure “Register” which takes a “POS Menu Line” as a parameter.
In this procedure we use the “POS Command Registration” codeunit to register this module and all the associated commands.
I prefer to use Global Labels to store the Module Code/ Module Description and Command Code/Command Description, as this way, any and all changes need be done only once but it is not necessary.
Once this is done, the next step is to register the POS Module, this can be done in two ways:
Using Retail Modules:
- Search for Retail Modules in BC Search.
- Click on “Process” and then “Register.”
- Search for your Codeunit and click on OK.
Using “POS External Commands”:
- Search for Retail Modules in BC Search.
- Click on “Process” and then “Register”
- Search for your Codeunit and click on OK.
You can confirm that your commands are visible by checking the list of POS External Commands.
Now on the POS, we right-click on a button and click on “Button Properties”
Then set your custom command,
Now we add multiple Items.
And when we press the button, this is the result, as expected.
Conclusion:
Thus, in this blog, we saw how to create Custom commands which can be used on POS.
Thanks for reading!