Use existing table to display external info

e1000i
Member Posts: 3
Hi all,
I've been using this forum for a while and always found what I was looking for, but today I need to post a question. I've been doing some googling and so far I haven't found what I'm looking for. I need to populate a lookup form with all the contacts in a user's Skype account (I'm using Skype4COMLib). The client doesn't have a license to create more tables, so I need to reuse some of the existing ones.
I have a Request Form in a report and I need to create a field with a lookup form showing the contacts. What I've done so far is use the table Salesperson/Purchaser (because the fields it has fit quite good with the ones I need) as temporary, insert the values from Skype contacts using an Automation variable and set the OnLookup method of my RF field to show the form. However, all I get is the original Salesperson/Purchaser table, even though I call SETRECORD and SETTABLEVIEW methods before runing the form.
Here is the code:
When debugging, I can confirm that UserTable "has" the values I need. I'm not very used to work with temporary tables so I don't know if I'm missing something. I don't know either if this is the best answer to achieve my goal. Any help will be really appreciated.
BTW, I'm testing on NAV 3.7, but it should work on 5.0 too.
Thanks in advanced
I've been using this forum for a while and always found what I was looking for, but today I need to post a question. I've been doing some googling and so far I haven't found what I'm looking for. I need to populate a lookup form with all the contacts in a user's Skype account (I'm using Skype4COMLib). The client doesn't have a license to create more tables, so I need to reuse some of the existing ones.
I have a Request Form in a report and I need to create a field with a lookup form showing the contacts. What I've done so far is use the table Salesperson/Purchaser (because the fields it has fit quite good with the ones I need) as temporary, insert the values from Skype contacts using an Automation variable and set the OnLookup method of my RF field to show the form. However, all I get is the original Salesperson/Purchaser table, even though I call SETRECORD and SETTABLEVIEW methods before runing the form.
Here is the code:
//UserTable: Salesperson/Purchaser temporary table //UserName: Text(50) global variable used as SrcExpression in a Request Form field //Form: Salesperson/Purchaser form OnInitReport() //Fill UserTable with Skype contacts //[...] OnLookup(VAR Text : Text[1024];) : Boolean Form.SETRECORD(UserTable); Form.SETTABLEVIEW(UserTable); IF Form.RUNMODAL = ACTION::LookupOK THEN BEGIN Form.GETRECORD(UserTable); UserName := UserTable.Name; END;
When debugging, I can confirm that UserTable "has" the values I need. I'm not very used to work with temporary tables so I don't know if I'm missing something. I don't know either if this is the best answer to achieve my goal. Any help will be really appreciated.
BTW, I'm testing on NAV 3.7, but it should work on 5.0 too.
Thanks in advanced
0
Comments
-
Set record sets only position, settableview sets only filters. It will never transfer data... But you can use this:
//UserTable: Salesperson/Purchaser temporary table //UserName: Text(50) global variable used as SrcExpression in a Request Form field //Form: Salesperson/Purchaser form OnInitReport() //Fill UserTable with Skype contacts //[...] OnLookup(VAR Text : Text[1024];) : Boolean IF Form.RUNMODAL(0,UserTable) = ACTION::LookupOK THEN BEGIN Text := UserTable.Name; Exit(True); END else Exit(False);
0 -
Perfect! I thought SETTABLEVIEW transfered the data to the form, good to know it doesn't.
Thanks for the advice.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