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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Is it possible to trigger OnLeave event or modified() function when using scanners to scan a field?

(1) ShareShare
ReportReport
Posted on by 343
I created a simple stringEditControl and implemented a modified() function for it in which I call the executeQuery of a datasource in order to add a filter and refresh the data:
 
 
public boolean modified ()
{
    next modified();
    this.modified_post();
    return true;
}
public void modified_post()
{
    FormDataSource fds = element.datasource(formDataSourceStr(EcoResProductDetailsExtended, InventTable));
    fds.executeQuery();
}
 
This works perfectly. However, when a scanner is used to enter data into the text field, the modified function is not triggered.
 
I think this is perhaps because the OnLeave event may not be triggered. When I manually enter data into the field, the modified function triggers as soon as you press TAB to leave the field.
 
Is there a way to make sure this solution works for scanners too? Can I use X++ to call or trigger the modified function from some other event or function which is called when data is entered via the scanner?   
  • André Arnaud de Calavon Profile Picture
    307,829 Super User 2026 Season 2 on at
    Hi Superbunny,

    Can you tell us how the scanner is used? Is it directly entering data in the field as input device or is X++ coding used to update the control after something got scanned?
  • Superbunny Profile Picture
    343 on at
    @André:
     
    Thank you for your quick reply. I will relay the question internally and get back to this ASAP.

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

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
Martin Dráb Profile Picture

Martin Dráb 539 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 366 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 197

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans