Lookup clears variable - requestpage
Belias
Member Posts: 2,998
i have a requestpage with a field cdcustcode. under its onlookup trigger, i have the following code:
thanks in advance for your suggestion.
IF PAGE.RUNMODAL(0,TBCustomer) = ACTION::LookupOK THEN CDCustCode := TBCustomer."No.";this is pretty straightforward, in my opinon, but if i click the lookup button, and then esc (the lookupok does not take effect) the field is cleared...why? :-k and more important, how can i avoid it?
thanks in advance for your suggestion.
0
Answers
-
i found a way!!! (my memory is not good, but i am pretty sure to have never done something like this up to now :-k i wonder why i need to do it now)
IF PAGE.RUNMODAL(0,TBCustomer) = ACTION::LookupOK THEN CDCustCode := TBCustomer."No." //CODE ADDED ELSE cdcustcode := text; //text is the VAR parameter of the onlookup trigger
0 -
Belias wrote:i found a way!!! (my memory is not good, but i am pretty sure to have never done something like this up to now :-k i wonder why i need to do it now)
IF PAGE.RUNMODAL(0,TBCustomer) = ACTION::LookupOK THEN CDCustCode := TBCustomer."No." //CODE ADDED ELSE cdcustcode := text; //text is the VAR parameter of the onlookup trigger
I think ,the answer was in your reply ,the root cause is Onlookup ,the text variable is
PassByRef value so if you don't have to assigned any value ,the text will return blanks value.0 -
@QuickWE: read carefully the code: the "else" part of the action::lookupok assign "text" to cdcustomer, not viceversa.
This means that text is actually evaluated with the correct value when pressing "esc" instead of doing lookupok on the lookup page.
If i MESSAGE(text), nav returns the actual value of the textbox. if i message(cdcustomer) it returns, blank, no matter what0 -
Belias wrote:@QuickWE: read carefully the code: the "else" part of the action::lookupok assign "text" to cdcustomer, not viceversa.
This means that text is actually evaluated with the correct value when pressing "esc" instead of doing lookupok on the lookup page.
If i MESSAGE(text), nav returns the actual value of the textbox. if i message(cdcustomer) it returns, blank, no matter what
I think,your replies is everythings that I means as my previous posts (If you read by carefully
). 0 -
Right now I do not have the NAV 2009 to loo into, but if it works in same way as on Form, than:
1) Work with the parameter passed as ref to "set the value"
2) Do not forget to exit(true) or exit(false) to signal if lookup was done or canceled... ;-)0 -
doesn't work like this. (actually, i already tried to use the exits, but i tried another time, who knows) :-kkine wrote:Right now I do not have the NAV 2009 to loo into, but if it works in same way as on Form, than:
1) Work with the parameter passed as ref to "set the value"
2) Do not forget to exit(true) or exit(false) to signal if lookup was done or canceled... ;-)IF PAGE.RUNMODAL(PAGE::"All Patient - List",TBPatientTemp3) = ACTION::LookupOK THEN BEGIN Text := TBPatientTemp3."No."; EXIT(TRUE); END ELSE BEGIN EXIT(FALSE); END;
am i missing something? (just to be sure, i also tried to revert the value of the "exits", but with no luck.)0
Categories
- All Categories
- 75 General
- 75 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
