PLEASE SEE, lookup return Cancel

cpina
Member Posts: 52
CLEAR(fInvProyecto);
recInvProyecto.SETFILTER("Cod. Recurso",cRecurso);
fInvProyecto.LOOKUPMODE(TRUE);
fInvProyecto.SETTABLEVIEW(recInvProyecto);
IF fInvProyecto.RUNMODAL <> ACTION::lookupOK THEN BEGIN
MESSAGE('1');
EXIT(FALSE);
END;
fInvProyecto.GETRECORD(recInvProyecto);
xProyecto := recInvProyecto."Nº proyecto";
EXIT(TRUE);
the runmodal returns always "Cancel" something diferent to lookupOK, the form properties seem to be correct, but I do not if I have forgoten some property
Your ideas are welcome.
recInvProyecto.SETFILTER("Cod. Recurso",cRecurso);
fInvProyecto.LOOKUPMODE(TRUE);
fInvProyecto.SETTABLEVIEW(recInvProyecto);
IF fInvProyecto.RUNMODAL <> ACTION::lookupOK THEN BEGIN
MESSAGE('1');
EXIT(FALSE);
END;
fInvProyecto.GETRECORD(recInvProyecto);
xProyecto := recInvProyecto."Nº proyecto";
EXIT(TRUE);
the runmodal returns always "Cancel" something diferent to lookupOK, the form properties seem to be correct, but I do not if I have forgoten some property
Your ideas are welcome.
0
Comments
-
Hi CPina,
On the form properties (the one that you do your lookup to), has the following
Property:LookupMode (If you choose No, the system automatically disables the LookupOK and LookupCancel actions.)
Have a look at the PushButton (your OK button on the form as well)
Property: PushAction
To have the system perform this action... Choose...Close form and return OK: OK Close form, do not return OK: Cancel Close lookup form and return OK: LookupOK Close lookup form, do not return OK: LookupCancel Close form and return Yes: Yes Close form and return No: No Close the form: Close Stop processing: Stop
If you want to find out what message get's returned then,MESSAGE(format(fInvProyecto.RUNMODAL));
or if you are still in doubt, check for both or check for 'cancel'IF not(fInvProyecto.RUNMODAL in [ACTION::lookupOK,ACTION::OK) THEN BEGIN MESSAGE('1'); EXIT(FALSE); END;
Please note that I have not tested the above code for any errors, but you should get the idea.
Cheers,
gus0 -
I would like to add this sample... It's an alterative for the code that has been posted.
IF FORM.RUNMODAL(0,Cust) = ACTION::LookupOK THEN MESSAGE(Cust.Name); // Selected record in lookup form
Click this link to download the Navision Bible!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."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