2 list forms for sales header table

RI0207RI0207 Member Posts: 17
Hi
Due to certain fields which we need to hide from certain users, i have to create a new list form-XX (already done) and has to call it once the user press F5 from a specific form - AA . (We got few card forms based on Sales Header)How to go about this? Now when I press F5 from the Form - AA , Sales List is the one which is opening..but i want my new List form -XX to call from here...

Pls help

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi
    Do the following
    on the form AA on the menu ite List remove the LookupTable and in the OnPush add the following code
    UserSetup.Get(USERID);
    IF UserSetup."Lookup Custom Form" THEN
      FORM.RUNMODAL(FORM::"FormXX",Rec)
    ELSE
      FORM.RUNMODAL(FORM::"Standard Form",Rec);
    

    Hope this helps

    Albetr
  • DaveTDaveT Member Posts: 1,039
    Hi RI0207,

    What Albetr suggests will work fine but this means you will have to change all forms that lookup the table. Another suggestion is to modify the lookup/list form and use the VISIBLE/ENABLED property for the fileds in question depending on the user setup.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • RI0207RI0207 Member Posts: 17
    HI Albert/ Dave

    Thanks for the valuable suggestions. As per suggested, on my FORM AA, Menu Button --> LIst , in the On Push I put the coding as Follows


    IF FORM.RUNMODAL(FORM::"Sales List (New Form)",SalesHeader) = ACTION::LookupOK THEN
    "No." := SalesHeader."No.";

    After the modification, Once I press F5 from Form AA, the new list form "Sales List (New Form)" is opening. But if press the list button (on the tool bar) it's still opening the default Sales List Form. How to control this
  • RI0207RI0207 Member Posts: 17
    hello...any help on how to control the LIST button , so that once pressed it wont open the standard List form

    Thanks a lot
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    Hi RI0207,

    In your Sales List standard form --> OnOpenForm()
    IF UserSetup.GET(USERID) THEN BEGIN
      CurrForm.VISIBLE(FALSE);
      FORM.RUNMODAL(UserSetup."Lookup Custom Form");
      CurrForm.CLOSE;
    END;
    


    I hope it helps ....... O:)
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • RI0207RI0207 Member Posts: 17
    Hi Sandeep
    Thanks for your help. some clarifications.....
    So have to create new field 'lookup custom form' in the User setup table ? we are using Nav 4.0. Then also have to assign users who have to see the new list form at the setup ...is it?
  • RI0207RI0207 Member Posts: 17
    Hi Sandeep

    It works when I press F5 from the card form after your coding suggestion . ie, when i press F5 from the form, it's opening the customised List form, but when press the LIST BUTTON on the TOOLBAR, it's still opening the standard List form and not my customised one...

    So how to control the LIST button on the TOOLBAR to open a customised List form...

    Awaits help.....
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    Hi RI0207,
    So have to create new field 'lookup custom form' in the User setup table ? Then also have to assign users who have to see the new list form at the setup ...is it?

    Yes.
    The Users not entered in User Setup Table will see the standard List form only.


    What we have to do :
    1) Create a field 'lookup custom form' in User setup table.(This is form ID field - Integer)
    2) Enter User IDs in the User Setup and their corresponding custom sales list form ID's.
    3) Place the above code in the OnOpenForm() of Sales List form.

    Make sure it doesn't interfere with any other customization.
    I just tested, it is working for both F5 and list button. ...O:)
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
Sign In or Register to comment.