XMLport question

ccbryan63
Member Posts: 115
I am still trying to find a way to import a flat file into RTC (see my other thread) but in the meantime I'm thinking about converting my data to xml in order to import it. But I'm running into a problem with the XMLport. I need to do a little data manipulation but I can't find a way that NAV likes to refer to the data. Here is the top of my dataport fields list:
I want, let's say, to evaluate DocumentType like this
I have tried putting this in the PayrollJournalLine - Import::OnBeforeInsetRecord() and in the DocumnetType - Import::OnAfterAssignField() tiggers, but it won't compile, telling me that DocumentType is an unknown variable.
If someone could point me towards the proper way to refer to this field, I'd be very grateful...
Node Name Node Type Source Type Data Source ------------ ----------- ----------- ----------- Root Element Text <Root> Payroll Journal Line Element Table <Payroll Journal Line>(Payroll Jouirnal Line) JournalTemplateName Element Field <Payroll Journal Line>:: Journal template Name LineNo Element Field <Payroll Journal Line>:: Line No. DocumentType Element Field <Payroll Journal Line>::Document Type ......
I want, let's say, to evaluate DocumentType like this
IF DocumentType = 'Payment' THEN "Document Type" := 1 ELSE "Document Type" := 0;
I have tried putting this in the PayrollJournalLine - Import::OnBeforeInsetRecord() and in the DocumnetType - Import::OnAfterAssignField() tiggers, but it won't compile, telling me that DocumentType is an unknown variable.
If someone could point me towards the proper way to refer to this field, I'd be very grateful...
0
Answers
-
Instead source =Field set Text. It will assign the data into variable and you can do your code on it.0
-
Thank you for that guidance Kamil. I changed the source type of that node to Text and that does allow me to refer to the node value, but I still can't refer to the table/field I'm trying to populate.
The XMLPort is working at this point (putting records into the Payroll Journal Line table), but I still can't adjust values. If I try this I get a compile error "unknown variable 'Payroll Journal Line' "NormalSign -- Import::OnAfterAssignVariable() ---------------------------------------- IF NormalSign = 'Negative' THEN "Payroll Journal Line"."Normal Sign" := 0 ELSE "Payroll Journal Line"."Normal Sign" := 1;
This gets "unknown variable 'Normal Sign' "NormalSign -- Import::OnAfterAssignVariable() ---------------------------------------- IF NormalSign = 'Negative' THEN "Normal Sign" := 0 ELSE "Normal Sign" := 1;
Trying the syntax from the dataport gride, I get "< must not be the first word in a sentence"NormalSign -- Import::OnAfterAssignVariable() ---------------------------------------- IF NormalSign = 'Negative' THEN <Payroll Journal Line>::Normal Sign := 0 ELSE" Normal Sign" := 1;
So now that I can refer to the data value, how can I refer to the table/field??0 -
Use the symbol menu to select correct record variable and the field. If you have element of type table, it must be on the list. Name depends on property of this element.0
-
The answer: for the Nodes, as Kamil pointed out, you have to set the Source type to Text.
For the table, the format is "<tablename>", thus:IF NormalSign = 'Negative' THEN "<Payroll Journal Line>"."Normal Sign" := 0 ELSE "<Payroll Journal Line>"."Normal Sign" := 1;
Cheers everybody....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
- 322 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