Filters not working in Lookup

chandrurecchandrurec Member Posts: 560
Hi all,

I have written the following code in MouldNo on Lookup trigger.


Manuf.RESET;
Manuf.SETRANGE(Manuf."Item No","Item No.");
IF Manuf.FINDSET THEN
REPEAT
MouldHeader.RESET;
MouldHeader.SETRANGE("Mould No",Manuf.Code);
MouldHeader.SETRANGE("Mould Status",MouldHeader."Mould Status"::"Under Production");
IF MouldHeader.FINDFIRST THEN BEGIN
MESSAGE('%1',MouldHeader."Mould No");
MouldHeader.MARK(TRUE);
END;
UNTIL Manuf.NEXT = 0;
MouldHeader.MARKEDONLY(TRUE);

FORM.RUNMODAL(50025,MouldHeader,MouldHeader."Mould No");

I am getting the correct value in message but when i open the lookup form, blank form is opened.

If anyone knows the bug,Kindly let me know.

Thanks in advance.

Regards,
chandru.

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    Instead of using MARK, use a temporary table, its much simpler and reliable.
    David Singleton
  • chandrurecchandrurec Member Posts: 560
    Hi David Singleton,

    Can you change the code and send me for how to use temp table.

    Thanks in advance.

    Regards,
    chandru.
  • SogSog Member Posts: 1,023
    Do you accept invoices?
    Plenty of examples and uses for temptable on the forum and in the howto section of the site...
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • chandrurecchandrurec Member Posts: 560
    Hi David,

    I got it.I think there is some problem in with mark functionality.I achieved it using temporary table as told by you.

    Thanks you.

    Regards,
    chandru.
  • kapamaroukapamarou Member Posts: 1,152
    chandrurec wrote:
    IF Manuf.FINDSET THEN
    REPEAT
    MouldHeader.RESET;
    MouldHeader.SETRANGE("Mould No",Manuf.Code);
    F1 wrote:
    RESET (Record)
    Use this function to remove all filters, including any special filters set by MARKEDONLY, and change the current key to the primary key. The system also removes any marks on the record and clears any C/AL variables on the record.
Sign In or Register to comment.