Creating lookup to open a table list form or another...
robertadi
Member Posts: 8
I wrote some code on a lookup text box so i can be able to open a table list form or another, according the value of an option variable.
The source expresion of the lookup is a code variable in with I want to keep the value that I will take from the focus of the form the lookup will open.
Still, pushing the lookup does nothing, where do I go wrong?
I will paste the code i wrote on the "On Lookup" trigger:
The source expresion of the lookup is a code variable in with I want to keep the value that I will take from the focus of the form the lookup will open.
Still, pushing the lookup does nothing, where do I go wrong?
I will paste the code i wrote on the "On Lookup" trigger:
IF (Partner = 22) THEN BEGIN
IF (FORM.RUNMODAL(22,Cust,PartnerNo) = ACTION::LookupOK) THEN
PartnerNo := Cust."No.";
END
ELSE IF (Partner = 27) THEN BEGIN
IF (FORM.RUNMODAL(27,Vend,PartnerNo) = ACTION::LookupOK) THEN
PartnerNo := Vend."No.";
END;
0
Comments
-
please review the code....
Though I am able to run this code
IF (Partner = 22) THEN BEGIN
IF (FORM.RUNMODAL(0,cust) = ACTION::LookupOK) THEN
PartnerNo := cust."No.";
END
ELSE IF (Partner = 27) THEN BEGIN
IF (FORM.RUNMODAL(0,vend) = ACTION::LookupOK) THEN
PartnerNo := vend."No.";
END;
Thanks
Ritesh Kumar SinghThanks,
Ritesh0 -
I have reviewed the code with your changes but still no form is activated as the lookup is dead, doesn't work.
It must be something else I've forgot to do...
0 -
Would guess that Partner has no value since the code looks fine!
Try debugging or a message('Partner is %1',Partner) before the code!
Sorry if I'm being to "simple".. :oops:Regards,
Henrik Frederiksen, Denmark0 -
I have initialized partner with "0" before.

It's not that... ](*,)0 -
robertadi wrote:I wrote some code on a lookup text box ...
Change it to a CASE structure as is the norm for Navision:CASE Partner of 22: BEGIN IF (FORM.RUNMODAL(22,Cust,PartnerNo) = ACTION::LookupOK) THEN PartnerNo := Cust."No."; END; 27: BEGIN IF (FORM.RUNMODAL(27,Vend,PartnerNo) = ACTION::LookupOK) THEN PartnerNo := Vend."No."; END; ELSE Message(sstrsubstno('No form found for partner %1',partner); end;
Also I agree with ritz, in this case you should be using form 0David Singleton0 -
I can't wait to try and see if it works. I think I can give u an answer tomorrow night or the day after tomorrow cause now I haven't exported what i've worked and don't have the report on my computer...
Anyway, I'll tell as soon as I try it, untill then...
thanks again people
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 991 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
