Set Filter for popup form

Soloper
Soloper Member Posts: 102
I create a new table and a new form based on this new table.

In sales order form I run this form. But I want to filter the new table (form) with the order number which is currently open in the screen.

How can I do that?

I put a button on sales order form and added the following code in OnPush trigger but doesnt work.



recNewTable.RESET;
recNewTable.SETCURRENTKEY("OrderNo","Line");
recNewTable.SETRANGE("OrderNo","No.");

FORM.RUNMODAL(50007,recNewTable);

Answers

  • lvanvugt
    lvanvugt Member Posts: 774
    edited 2010-01-11
    Why write code and not use the properties of the button?

    Like:
      Action RunObject RunFormView RunFormLink RunFormLinkType

    Use for the Customer Card as your example and how the Ledger Entries menu item has been setup.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • matttrax
    matttrax Member Posts: 2,309
    You should definitely use the properties on the button in this case.

    Incidentally, if you did it the way you were doing it, with code, you have to retrieve the record from the database first. That means GET or FIND.
  • Soloper
    Soloper Member Posts: 102
    lvanvugt wrote:
    Why write code and not use the properties of the button?

    Like:
      Action RunObject RunFormView RunFormLink RunFormLinkType

    Use for the Customer Card as your example and how the Ledger Entries menu item has been setup.

    Thanks, works.

    Can you explain more about RunFormLinkType?
  • lvanvugt
    lvanvugt Member Posts: 774
    I can, but read this first: RunFormLinkType.

    If you want more explanation, just ask.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community