web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to customise SalesTable for to allow user to Enter the ItemId with Barcode Scanner

(0) ShareShare
ReportReport
Posted on by 241
I have a requirement to customise the SalesTable form to allow the user to enter the ItemId with a Barcode scanner on the salesTable form.
 
I have tried a number of ways and places.  The following is the furthest that I got and everyting works except where I want to update the ItemId with the value returned from InventTable.ItemId.  And then I am assuming I will have to refresh the form to show the changed item id.
Can someone help with what I am doing wrong or if there is a better way of doing this. I have added comments to my code where it is going wrong.
Any Advice will greatly be appreciated
 
[ExtensionOf(formControlStr(SalesTable, SalesLine_ItemId))]
final class SalesTableForm_ItemIdControl_???_Extension
{
    public boolean modified()
    {
        boolean             ret;
        FormStringControl   ctrl     = this as FormStringControl;
        ItemId              itemId   = ctrl.text();
        InventTable         inventTable;

        if(itemId != '' && !InventTable::exist(itemId)) // ItemId has been entered but it is not valid InventTable Item
        {
            inventTable = InventTable::find(InventItemBarcode::findBarcode(itemId, False, False).itemId);
            if (inventTable.ItemId != '') //Not an Item found with barcode
            {
                info(StrFmt("Barcode value entered. Item ID: %1.",inventtable.ItemId)); //Optional
                ctrl.text(inventTable.ItemId); // Update the control with the correct Item Id
                //WHEN DEBUGGING THE ctrl.text is ""
                //How do I refresh the form ????????
                
            }
        }
        ret = next modified();
        return ret;

    }

}
 
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 357 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans