Hi,
On the Sales Order Page (Page 42) the "No."-field has focus when I open the Page. Now the Customer wants to enter a Sales Order Type (Spare parts, Service) and let that determine which no.series to use when assigning the Document No. So I need to set focus on the "Sales Order Type" field when opening the Page. Is that possible?
ACTIVATE is not supported and the form property ActiveControlOnOpen is not present on Pages.
Any ideas how to accomplish this, or maybe an alternative solution?
I could put code on the OnInsert trigger and open the Sales Order Type page to let the user select a "Sales Order Type" before the rest of the code on the OnInsert trigger assigns the Document No., but having page.runmodal on OnInsert trigger is not nice I think?!
0
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
/zeon
Is it an option for you to put Sales Order Type field first on the page?
You have to use solutions such as the Add-in linked to below. I have heard of a number of solutions that I'm sure you can also see other places in this forum.
/henrik
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT
You should create two types of No. Series for the Sales Order one is for Spare Parts and another is Service. Select the No. Series as per Sales Order Type.
When you Open the Sales Order Screen (Form/Page) to create a new SO, it will not generate any No and now you should click the assist button to choose desired No. Series as per SO Type.
Thank you.
But, the problem is, that even though I put Sales Order Type as the first field on the page it still puts focus in the "No."-field...
I have also tried the add-in and it works fine for already existing records (puts focus on sales order type), but when the user selects New to create a new sales order, it will still place focus on the No.-field ](*,)
/zeon
Do you dynamically set enabled on the field? The start value must be that the field is editable and enabled otherwise the next editable field will be selected. Could that be it?
/henrik
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT
I guess no..
what I think is,
zeon is not talking about Document Type..its a custome field..
and as Document Type is part of primary key, the field is activated when opened..
If you have a primary key field in Page then that field only activated when page is opened.
If you try to add not primary key as first field then it wont be activated initially..
Correct me if I am wrong.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I suppose a solution could be to make this custom field part of the key, would that be possible?
/henrik
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT
No, It needs lot of changes in the system..like if we are using GET in the existing code then we have to add the new field to it in all instances..
The main goal is to get the different no.series based on the new field..so as I suggested above..we can create 2 No. Serieses which will ask to select while creating new order..so user can select it.. :-k
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
@mohana: I'm not sure I understand your suggestion - will you just create two no.series and then let the user select the correct one each time they create a new sales order by clicking on assistedit? Or will you open a form when you create a new sales order, and then let the user select the no.series based on the sales order type, they're going to make?
Tnx to you all for your input!
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
1. Place your option field which value should be used to determine the no series as the first field on the page.
Option 1:
2. Disable the No field (and potentially other key fields)
Option 2:
2. Use delayed insert on the page and handle when to insert in code.
/henrik
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT
I appreciate the effort you have put into this
The great thing is that when I use delayed insert, the cursor will actually place itself in the first field on the Page
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT