Activate field on Page

zeonzeon Member Posts: 130
edited 2012-06-27 in NAV Three Tier
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?!

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You can create new No.Series and add as a relationship to existing No.Series and ask the user to select from Assist Edit button which is available next to No. Field..
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    This download may be useful: Focus/activate control support for RTC v1.1
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • zeonzeon Member Posts: 130
    Thanks for your input. I'll try the add-in to see if that solves the problem.

    /zeon
  • henrikmhenrikm Member, Microsoft Employee Posts: 66
    There is no active/focus functionality out of the box in RTC (Windows Client in 2013 as the Web Client is also an RTC client).

    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
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Henrik Metzger, Software Development Engineer, Dynamics NAV
    MSFT
  • navuser1navuser1 Member Posts: 1,329
    zeon wrote:
    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?!

    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.
    Now or Never
  • zeonzeon Member Posts: 130
    I agree this could be an alternative solution, but from a usability point of view, I think users will get quite annoyed that they have to click on AssistEdit every time they creeate a new order. So, I don't think this is the most optimal solution, but thanks for you input! :)
  • zeonzeon Member Posts: 130
    henrikm wrote:
    Is it an option for you to put Sales Order Type field first on the page?
    That was actually what I wanted to do. When the user have selected the Sales Order Type I'll find the correct no.series code in a Setup table and use that for generating the Document No.

    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
  • henrikmhenrikm Member, Microsoft Employee Posts: 66
    I just tried to add the Document Type as the first field on the Sales Order page (NAV 2013), when doing so the Document Type field is selected as the first field both when creating a new sales order or when opening an existing order. Not sure what the issue that you are seeing is.

    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
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Henrik Metzger, Software Development Engineer, Dynamics NAV
    MSFT
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    henrikm wrote:
    I just tried to add the Document Type as the first field on the Sales Order page (NAV 2013), when doing so the Document Type field is selected as the first field both when creating a new sales order or when opening an existing order. Not sure what the issue that you are seeing is.

    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

    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.
  • henrikmhenrikm Member, Microsoft Employee Posts: 66
    I see your point. You are right, focus jumps to the No. field. Also if you leave the No field the Order no will automatically be generated etc.

    I suppose a solution could be to make this custom field part of the key, would that be possible?

    /henrik
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Henrik Metzger, Software Development Engineer, Dynamics NAV
    MSFT
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    henrikm wrote:
    I see your point. You are right, focus jumps to the No. field. Also if you leave the No field the Order no will automatically be generated etc.

    I suppose a solution could be to make this custom field part of the key, would that be possible?

    /henrik

    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
  • zeonzeon Member Posts: 130
    henrikm wrote:
    I see your point. You are right, focus jumps to the No. field. Also if you leave the No field the Order no will automatically be generated etc.

    I suppose a solution could be to make this custom field part of the key, would that be possible?

    /henrik

    Absolutely not! :) Too many changes in the system to accomplish minor custom change.

    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
    You can create new No.Series and add as a relationship to existing No.Series

    @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_cse06mohana_cse06 Member Posts: 5,504
    zeon wrote:
    You can create new No.Series and add as a relationship to existing No.Series

    @mohana: 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?
    :thumbsup:
  • henrikmhenrikm Member, Microsoft Employee Posts: 66
    After talking to a number of people I have a few additional suggestions you can consider:

    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
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Henrik Metzger, Software Development Engineer, Dynamics NAV
    MSFT
  • zeonzeon Member Posts: 130
    henrikm wrote:
    After talking to a number of people I have a few additional suggestions you can consider:

    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

    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 :)
  • henrikmhenrikm Member, Microsoft Employee Posts: 66
    :)
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Henrik Metzger, Software Development Engineer, Dynamics NAV
    MSFT
Sign In or Register to comment.