Issue Raised:
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.
Pre-req:
1) Retail must be confiqured
2) Retail SDK must be Installed
3) Visual Studio respective version for SDK customization
Solution:
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.
Thanks,
Happy Daxing with Rizz 🙂
Note:
Dll must not be compatible for all the POS Versions. To use the code decompile it and use the code.
Hi Rizvan,
your blog is awesome but is it full, as I am not able to complete the setup which you have explain you in your blog.
I am not a developer so I cannot work on coding so what you have mentioned in your screen shot I am following the same.
can you email me your entire solution for this.
it will be much appreciated.
thanks & regards,
Husain.N.G
LikeLike
Hi husain,
As I have mentioned in the blog that you need to customize the blankoperation Dll for achieving the task and make sure if you are entering the batch number manually than it is ok but what if you need to have the dropdown selection as mention in the screenshot than you must follow the steps given in my other blog(https://dynamicsax.tech.blog/2016/11/30/sync-custom-table-from-ax-to-pos-db-retail-customization/) to sync batch number table (InventBatch) to POS DB.
blank operation dll mailed to you.
Thanks,
Rizwan Khan
LikeLike
Hi Rizvan
i’m newbie developer in ax in its look so helpful i flow your steps but now i’m stuck
i flow your steps until Navigate to Retail SDK in blank operation but i didn’t find this class (BatchIdDialog) to write the code on i have this class (blank operation) can you please learn me how or provide me dll file please
LikeLike
Hi Mohammad,
I have updated my post with the dll link, you can have it from the provided link. And BatchIdDialog is not the out of the box class I added the windows form to get the input from user for the BatchId. In my case I am filling the dropdown control of the respective Item’s BatchIds.
Thanks,
Rizwan Khan
LikeLike
hey Rizwan Khan
Thank you very much for helping so you mean is (BatchIdDialog) is normal windows form
so can i take expiration date date rather than BatchId?
LikeLike
and in what event must be put that code in load form or what?
can you please provide me what’s Contains that form please
thanks again
LikeLike
Hi Mohammed,
I don’t know what really you are trying to achieve but as according to my code its just the windows form design which contain the dropdown selection and ok button and which is initialized when the blank operation button is clicked. Connect with me over skype (rizwan.khan133) if you need to discuss any solution for your requirement.
Thanks,
Rizwan Khan.
LikeLike
hey Rizz Khan
thanks for responding
i was thinking to let me select batch number of selected products when customers buy according to expiry date.
Thanks,
mohammed
LikeLike
yes , you can show only un-expired and activated batch-ids in the dropdown.
LikeLike