Lookup virtual table

JedrzejT
Member Posts: 267
Hi
How do lookup on the virtual table (object,table information)?
TableRelation do nothing.
Code in OnLookup Trigger show the form(create myself) but after select my field is still empty.
How do lookup on the virtual table (object,table information)?
TableRelation do nothing.
Code in OnLookup Trigger show the form(create myself) but after select my field is still empty.
0
Comments
-
PLease, post your code in OnLookup trigger... than I can help...0
-
Uh. Thanks
I do it myself.... i don't create form for my table ](*,)
My fault.. :oops:0 -
you cannot use "lookup" on virtual tabela s there are no forms defined for these tables.
you have to create forms yourself and then calls these forms in the code.Remember: Keep it simple0 -
Hi JedrzejT ,
you'll see from the time of my post that it was a little late :oops:
this time i'll ask first.........
Have you now sorted this ? if not, post your codeRemember: Keep it simple0 -
Hello
Code:
Table ID-Lookup
Obj.SETRANGE(Obj.Type,Obj.Type::Table);
IF FORM.RUNMODAL(54997,Obj)=ACTION::LookupOK THEN BEGIN
VALIDATE("Table No.",Obj.ID);
END;
Field ID-Lookup
Fld.SETRANGE(Fld.TableNo,"Table No.");
IF FORM.RUNMODAL(54990,Fld)=ACTION::LookupOK THEN BEGIN
VALIDATE("Field No.",Fld."No.");
END;
I don't need sort this table0 -
Hi JedrzejT,
I tested the first section of code (table) and it seems to work fine on my DB.
I created a table with 2 test fields:
Enabled Field No. Field Name Data Type
Yes 10 Table ID Integer
Yes 20 Field ID Integer
I created 2 forms.
First one for the lookup to the "Object" table
Second is the form for the table created above.
Back to my table:
Created global:
Name DataType Subtype
Obj Record Object
Then went to OnLookup() of the "Table ID" field:
Table ID - OnLookup()
Obj.SETRANGE(Obj.Type,Obj.Type::Table);
IF FORM.RUNMODAL(54997,Obj)=ACTION::LookupOK THEN BEGIN
VALIDATE("Table ID",Obj.ID);
END;
If you still cannot sort this, send me the objects in a PM with the version your running, and ill gladly look at them.Remember: Keep it simple0 -
PS : Try to avoid
FORM.RUNMODAL(54997,Obj)
But rather use :FORM.RUNMODAL(FORM::"My Form",Obj)
In this way, there is a connection between the RUNMODAL and the form you want to run. If you use 54997, it is just an integer. If later you need to renumber some objects, it becomes a lot easier.
Little trick to change your code fast:FORM.RUNMODAL("54997",Obj)
When you save+compile and close and then reopen your object, Navision will have changed "54997" in "My Form".Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks for help
I solve it already0
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