Setting TableRelation for Request Form variables
KeithMMoore
Member Posts: 59
I have a simple request form with 2 vars for user input - NewType and NewCode
NewType has a table relation to a Type table - no problem
NewCode needs a table relation to the Code table which needs be filtered on the NewType value just entered and that is where I am stuck.
- Request Form fields do not provide for OnValidate
- NewCode.TableRelation property's OnAssist does not bring up anything
- I have tried entering a WHERE clause manually in the TableRelation property but either 1) I have not figured out how to enter it correctly or 2) it does not work for a variable.
I am convinced that this should be fairly simple but I have not figured it out yet. Thanks in advance for any assistance.
NewType has a table relation to a Type table - no problem
NewCode needs a table relation to the Code table which needs be filtered on the NewType value just entered and that is where I am stuck.
- Request Form fields do not provide for OnValidate
- NewCode.TableRelation property's OnAssist does not bring up anything
- I have tried entering a WHERE clause manually in the TableRelation property but either 1) I have not figured out how to enter it correctly or 2) it does not work for a variable.
I am convinced that this should be fairly simple but I have not figured it out yet. Thanks in advance for any assistance.
0
Comments
-
setfilters on record; IF FORM.RUNMODAL(0,Rec) = ACTION::LookupOK THEN BEGIN Text += Rec.Code; EXIT(TRUE); END;
This goes to OnLookup trigger. I hope this helps.0 -
The problem I have though is that on the report Request Form, there is no OnLookup or OnValidate for the variables so I do not see where this code can go.SLF25 wrote:setfilters on record; IF FORM.RUNMODAL(0,Rec) = ACTION::LookupOK THEN BEGIN Text += Rec.Code; EXIT(TRUE); END;
This goes to OnLookup trigger. I hope this helps.0 -
The textbox on the requestform has an OnLookup trigger, that's where you put this code.0
-
When I press F9 while the Request Form text box is highlighted I am getting the following:
Report - OnActivate()
Report - OnDeactivate()
Report - OnFormat(VAR Text : Text[1024];)
Report - OnBeforeInput()
Report - OnInputChange()
Report - OnAfterInput(VAR Text : Text[1024];)
Report - OnValidate()
Report - OnAfterValidate()
Report - OnLookup(VAR Text : Text[1024];) : Boolean
Report - OnDrillDown()
Report - OnAssistEdit()
I am not getting OnValiadate or OnLookup options... ?????0 -
I do not understand you. You included list of triggers including OnValidate and OnLookup and you are writing that
Did you go through the list?I am not getting OnValiadate or OnLookup options... ?????
0 -
I am getting them saying "Report" - not the field name, which is what is always there with fields. So, even though it says "Report" in this case, it really doesn't mean "report" like it does elsewhere; it means the text box? :-s0
-
Guess it does mean the text box - it worked fine - thanks [PS - I'm really not that dense :? ]0
-
That's what you SAY, but....KeithMMoore wrote:[PS - I'm really not that dense :? ]
Glad you found it though0 -
Well, opening the filtered list is working fine but it is not returning the value to the field on the Request Form. Here is the code for CurrCode OnLookup:
CatCodes.SETRANGE(Type,CurrType);
IF FORM.RUNMODAL(37001262,CatCodes) = ACTION::LookupOK THEN BEGIN
CurrCode := CatCodes.Code;
EXIT(TRUE);
END;
Debug shows 'CurrCode' being assigned the value properly but it is not passing back into the Req Form. There is no TableRelation on CurrCode [Code 10]; all other properties are defaults as far as I can tell. ?? Maybe I'm denser than I thought :shock:0 -
You mas use this code:
IF FORM.RUNMODAL(37001262,CatCodes) = ACTION::LookupOK THEN BEGIN Text := CatCodes.Code; EXIT(TRUE); END;
to set the value correctly if this code is called from OnLookup.0 -
Thanks so much - I forgot that I needed that the Text var was the variable being returned. :oops: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
- 323 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

