Using Another Lookup Form

jamoralesjamorales Member Posts: 5
Hi all.
I've got a table and using the propiety LookupFormID of this table, I've asignated a Form.

Well, I have to use this table for another thing, and I've created anothers new forms, card-type and list-type. If I push F5 in the new card-type form, Navision opens the original Form (the specified form in the Table's propiety, it's logic) and don't the new List-type form I created. How can I resolve my problem? By propieties or but C/AL code?

I'm using Navision 3.70

Thanks for your attention.

Answers

  • WaldoWaldo Member Posts: 3,412
    If I understand your problem correctly, you'll have to do this by C/AL code. From the top of my head:
    IF FORM.RUNMODAL(FORM::"your formname",YourFilteredRecord) = ACTION::LookupOK THEN BEGIN
    .
    .
    .
    END;
    

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • jamoralesjamorales Member Posts: 5
    Thank you, Waldo, for your answer.

    I think I have to write the code you've written. But I don't know where.

    I open my new card-type form. I work with this form, create a new record, write data,.... Well, no problem. But if I want to see the new list-type form and push F5, Navision opens the form I indicated by propiety, and doesn't the new list-form, as I want.

    I neather find any propiety in the new card-form nor any trigger that I can use.

    Any help?

    Thank you
  • jlandeenjlandeen Member Posts: 524
    If you want the change to affect the tables across the entire application you could change the OnLookUp Form ID property of the table in question.

    Alternatively you should put the code that has been outlined here in the OnPush trigger of the menu item on your form that has F5 associated with it.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • jamoralesjamorales Member Posts: 5
    Hi jlandeen,

    you has made me an idea. I have put a menubutton and added a item with these propieties

    Visible Caption ShortCutKey Action RunObject
    Yes List F5 RunObject Form My New Form

    And that works!!

    Thank you
  • WaldoWaldo Member Posts: 3,412
    Yes Ok, but that doesn't show you the "OK" button to select a record from that list, is it? It's not really a lookup?
    Or am I mistaken?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • jamoralesjamorales Member Posts: 5
    Hi Waldo,

    Thanks for your comment.

    I've configurated my new List Form as LookupMode=TRUE.

    Anyway, I've detected a problem. If you push F5, it works, but if you push the arrow buttom (List buttom), navision opens the old form :'(

    So I've solved my problem partially, and I don't know how go on.

    Any idea?
  • WaldoWaldo Member Posts: 3,412
    Put your code also on the "OnLookup"-trigger of that field (on the form).

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.