Our users sometimes have to enter hundreds of order items. To optimize the input, I was asked whether the cursor should positioned on the "No."-field for each New Record.
The following solution seems to work without any problems - but unfortunately not for every field. And I can't find out why.
Javascript:
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('Ready',''); function SetFocusOnField(fieldNo) { window.parent.document.querySelector(`[controlname^='${fieldNo}'] input`).focus() }
PageExtension:
PageExtension 50323 "SalesOrderSubformEXT_HAL" extends "Sales Order Subform" //46 { layout { addlast(content) { usercontrol(SetFieldFocus; SetFieldFocus) { ApplicationArea = All; trigger Ready() begin CurrPage.SetFieldFocus.SetFocusOnField('No.'); end; } } } trigger OnNewRecord(BelowxRec: Boolean) begin CurrPage.SetFieldFocus.SetFocusOnField('No.'); // didn't work //CurrPage.SetFieldFocus.SetFocusOnField('Type'); // didn't work also //CurrPage.SetFieldFocus.SetFocusOnField('Quantity'); // but this works //CurrPage.SetFieldFocus.SetFocusOnField('Location Code'); // this - and many other fiels - working also end; }
I can use SetFocus with many fields (e.g. "Location Code" and "Quantity")
But for the two fields "Type" and "No." it didn't work.
Does anyone have any idea how I can successfully move the cursor to the field "No."?
function SetFocusOnField(fieldNo) { window.parent.document.querySelector(`[controlname^='${fieldNo}'] input`).focus() }
I'm still looking for a simpler solution or hoping someone can figure out why the JS solution doesn't work with "No.". But I'll keep your first adjustment in mind as a workaround. Thank you for the ideas.
There is a property on the fields QuickEntry. They default to true on all fields.
You can set the properties to false and then the page will skip them when tabbing thru fields.
Not sure if this helps.
Hi
Thanks for info and that gave me a better idea. I cannot think about any solution. But that just reminded me of two customization that I saw before. I just share them here but I am sure they are not useful.
1) I saw a company that added a second No field to remove the drop/down function of base field. Then made the No base field populate from this new field. they wanted to enter the number and not system shows them. Maybe you can use this method if new field let you focus on the new field No.
2) I saw another company that they designed their own Lines sub page to do some development but then let that new Line subform populate bc base lines.
Thanks
For your understanding: there can be 5 item or 20 items or 10 items or 30 items per order. We have already created import pages for individual orders with even more items.
We can't use Edit in Excel - but unfortunately it wouldn't speed up the input either.
Often only a few fields are required for input, but unfortunately more fields are just as often required (e.g. the description + Price + other fields sometimes has to be changed and sometimes not).
I don't think I have a chance with standard BC funds. In NAV 2013 we were able to solve this via WshShell and I was hoping that we could also do it via JS. And it would almost work - just not with No.
Hi
Just want to make sure I understand the challenge. Your team receive a SO with 100 items in it and they need to enter those order in BC. Hence, you are looking for faster "entry method" to enter these orders.
1) Is Edit in Excel and option? Like those orders have your part number or cross reference? This way your team can use Edit in Excel and copy and past.
2) Does your team only enter Item No and QTY? or something else. if it is only Item No and QTY is it possible to put the Item No as a first field and QTY as second. Then Exclude all other fields from Quick Entry?
Hi Brian,
this is true for the last possible quick entry field. However, it is often not necessary to enter or change all the data in a data set. Then the down key is used, because otherwise you would have to press even more keys. Unfortunately, that doesn't solve our problem.
This sounds like a training issue. Normally when you used the tab key instead of the arrow keys the new new record parks the cursor in the correct field.
Thanks for the hint but I can't find a way to use Yammer with dynamicsnavdev!
When I go to the address, I'm on a login page. I can register there - but I don't receive an announced email confirmation (not even as spam). Or I can login with our company data and only get directly to our own yammer-pages but not to www.yammer.com/dynamicsnavdev.
Hello - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
I will open this up to the community in case they have something to add.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156