Hi there,
I would like the cursor to start in the ItemId field of the first sales line when I open up the SalesTable form. In firstField(), I have this:
public void firstField(int _flags=1)
{
super(_flags);
this.nextGroup();
}
My nextGroup() method looks like this:
void nextGroup()
{
info('In nextGroup()');
if (!SalesLine::exist(salesTable.SalesId))
{
salesLine_ds.create();
}
salesLine_ItemId.setFocus();
}
When I open up the SalesTable form, I get the info message, then the cursor goes to the ItemId field, BUT THEN, the cursor goes to a field in the header.
How do I find out what is moving the cursor up there?
Thanks,
Tom
*This post is locked for comments
Thanks, Simon! I fixed this by using the linkActive() method on the SalesLine data source.
Hi,
there are several reason for a changed focus in a form...
However, to solve you issue, I would set the focus directly to the salesLine_ItemId control like this is done in salesLine_ds.create() (at least in AX 2012 R2 CU7). You could call salesLine_ItemId.setFocus() in SalesTable_ds.active() or linkActive(), depending on what you want to achive...
Best regards
Simon
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156