Posting Values from List Forms to Tables

Sugeevishere
Member Posts: 11
Hi Members of Mibuso,
I'm importing a text file into a table using a dataport. Then I need create a list form to display those values from that table. Then I have to create a button to post that values from this form to Sales Header Table.
I just want to know how to Code using a codeunit to post values from a list form to Sales Header Table?
Can Someone help me on Creating Codeunits and Codes inside that?
Any Help will be appreciated.
Thank You.
I'm importing a text file into a table using a dataport. Then I need create a list form to display those values from that table. Then I have to create a button to post that values from this form to Sales Header Table.
I just want to know how to Code using a codeunit to post values from a list form to Sales Header Table?
Can Someone help me on Creating Codeunits and Codes inside that?
Any Help will be appreciated.
Thank You.
0
Answers
-
it is not from form to table..it is table to table only..
it depends on the table structure you have..
if both tables structures are same then you can use TRANSFERFIELDS function or you need to assign manually..
What you tried so far?0 -
Thanks for Your Kind Reply.
I have imported the text file through dataport and it successfully imported to the table. I have linked the table to a list form so far.I got Stucked from the Following. Through that List form by creating a button i have to post the values that are in the Form to the Sales Header using Codeunit. I need the help on Creating Codeunits and on its Codes.
:?0 -
[Topic moved from 'NAV Tips & Tricks' to 'NAV/Navision Classic Client' forum]0
-
Hi,
I have few question to ask before answering your question -
I have imported the text file through dataport and it successfully imported to the table.
I have linked the table to a list form so far.
Question -
1) What are the values in the table which you have imported?
2) Are the values same as Sales Header Table?
I got Stucked from the Following. Through that List form by creating a button i have to post the values that are in the Form to the Sales Header using Codeunit.
Questions -
3) What do you mean by Post the values that are in the form to Sales Header. (Sales header consist records of UNPOSTED Sales order, so how you can post in that table?)
What i Understand -
1) I think you want to copy values from that form to Sales Header via a codeunit.
If this is what you want than, you need to make sure of some point -
a) The fields on the both sames should either be same or the mandatory fields in the sales Header table should be present in the Form/Table which you imported.
b) If the fields are same as of sales header with the same field id then Transferfields can be used in codeunit as already suggested by Mohan.
c) Else you need to create a new codeunit where you will have two record variables one for sales header and one for the new table(where you imported records).
d) Then you need to Initalize the sales header record by Saying salesHead.INIT (where salesHead is the record of Sales header).
Map field by field to the sales header table as-
SalesHead."Field Name" := NewTable."Field Name";
OR
SalesHead.Validate("Field Name",NewTable."Field Name");
Where NewTable is the variable name for the New table.
After this you need to say SalesHead.Insert(True);
Then on the click event of that button in the form you can call Codeunit.
Let me know if you need any more help.
Regards,
Saurav Dhyani
http://saurav-nav.blogspot.com/
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0
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