In Microsoft Dynamics Ax2012 Retail, items cannot be sold out with the Batch Id. If a Item is Batch-able, it cannot be consumed through POS.
1) Retail must be confiqured
2) Retail SDK must be Installed
3) Visual Studio respective version for SDK customization
Create a new blank operation button (Retail -> Setup->POS->ButtonGrid):
In my case I named as “BatchNumber“, this operation number is used by the blank operation class to catch the specific button click event.
Add the Batch Id on the product grid layout (Retail -> Setup->POS->screen layout):
Run the Register job to reflect the change on the POS layout (Retail -> Channed integration -> Channed database)
apply the job from download sessions.Once the job is applied, open the POS (respective store on which the job was run) and see the blank operation button is visible:
after the button is displayed, now its time to code behind the button.
Navigate Retail SDK and open the services project and go on the blank operation class and add the following code:
I added a new windows form in blank operation class to input the batch number,in my case I populate the dropdown(in the next blog I will demonstrate how to populate the INVENTBATCH of POS database). you can take the textbox to give the batch Id and set “batchid = urTextBox.Text” in the above code.
the selected record on the product grid is get through the following piece of code:
SalesLineItem s = retailTransaction.GetItem(operationInfo.ItemLineId);
this is the item in which you need to give the batch Id.
build the code copy the dll and place it to the POS dll folder.
Happy Daxing with Rizz 🙂
Dll must not be compatible for all the POS Versions. To use the code decompile it and use the code.