Filters not working in Lookup

chandrurec
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.
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.
0
Comments
-
Instead of using MARK, use a temporary table, its much simpler and reliable.David Singleton0
-
Hi David Singleton,
Can you change the code and send me for how to use temp table.
Thanks in advance.
Regards,
chandru.0 -
Do you accept invoices?
Plenty of examples and uses for temptable on the forum and in the howto section of the site...0 -
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.0 -
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions