Alternative lookuptable ?

absolutelyfreewebabsolutelyfreeweb Member Posts: 104
I give up searching this topic and ask instead.

From a card, I like to be able to push F5 and choose a new record using a form that is not the default lookup form id of that table.

Is this possible in classic ?

Comments

  • rjmvdvenrjmvdven Member Posts: 22
    On the Card form, change the default menuitem that is triggered when pressing F5. In the default this will say LookupTable, but change that to Runobject and link it to the form that you would like to open.
    Best Regards,

    Remco van de Ven
  • absolutelyfreewebabsolutelyfreeweb Member Posts: 104
    when I do that I get a list that does not have the lookup buttons OK/cancel. Not able to choose a new record, and if I try to add code, it thinks I'm trying to rename the record rather than getting a new record. hmm I'm going to test some more with using setfilter instead of rec.get
  • rjmvdvenrjmvdven Member Posts: 22
    you can also write code:

    table.SETRANGE(..);
    form.SETTABLEVIEW(table);
    form.LOOKUPMODE(TRUE);
    IF form.RUNMODAL = Action::LookupOK THEN BEGIN
    form.GETRECORD(table);
    Rec := Table;
    END;

    Table will be a local variable of the same table from the card form.
    Form will be the lookup form that you would like to use.
    Best Regards,

    Remco van de Ven
  • absolutelyfreewebabsolutelyfreeweb Member Posts: 104
    thank you for great help :)

    I did a variant where the card is a sales line, and wanted the lookup form to show headers.
    instead of rec := table, used rec.setrange on primary keys.

    the code works in a menuitem, but not from a onlookuptrigger (which I wanted) but that was solved by using sendkeys.

    so now I have F6 lookups that work just like F5 \:D/

    THANK YOU !!! :thumbsup:
Sign In or Register to comment.