Dataport does not fill form, but fills table????

nverma
Member Posts: 396
I created a dataport to bring in some data from a csv file. The dataport seems to work( it goes to 100%), it bring in all the data i want. I can see the data I brought in the FA Journal Line Table. But its not showing up in the FA Journal Line form. Any ideas why it might be doing that?
I thought the form is used to show the data that is presented in the table. I have no idea why its not coming in the form.
I thought the form is used to show the data that is presented in the table. I have no idea why its not coming in the form.
0
Answers
-
Did you view the keys of table FA Journal Line (5621)?
Did you fill Journal Template Name & Journal Batch Name or did you think those were unnecessary?
Again.....
You can enter a line in the journal & export it using your dataport to see how the data should look.
& import 1 line & manually enter 1 line and compare them. If you dataport fills in all the fields that the manual entry does then your on the right track. It they don't match then your dataport is not ready to use!0 -
Verify if the fields "Journal Template Name" and "Journal Batch Name" in table "FA Journal Line" have the same values as your FA Journal form filters.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
This is the code I wrote for the Dataport and It should answer all your questions.
[b]FA Journal Line- OnPreDateItem()[/b] IF CurrDataport.IMPORT THEN BEGIN REPEAT CurrFile.READ(cha); UNTIL cha = 10; // of course in case the RecordSeparator is "<<NewLine>>" END; FAJournalLine.SETRANGE("Journal Template Name", FAJournalBatch."Journal Template Name"); FAJournalLine.SETRANGE("Journal Batch Name", FAJournalBatch.Name); //FAJournalLine.SETFILTER("Journal Template Name", 'ASSETS'); //FAJournalLine.SETFILTER("Journal Batch Name", 'DEFAULT'); // If the payment journal currently contains lines, then get the last line no., and start inserting // payment journal lines from that point forward. IF FAJournalLine.FIND('+') = TRUE THEN LastLineNo := FAJournalLine."Line No." // Otherwise, start the line no. at zero ELSE LastLineNo := 0; [b]FA Journal Line - OnBeforeImportRecord()[/b]// OMODNV01 - ADD Start // Clear variables so that values are not replicating across multiple import lines CLEAR(FAPostingDate); CLEAR(DocumentNo); CLEAR(FANo); CLEAR(DepreciationBookCode); CLEAR(FAPostingType); CLEAR(Description); CLEAR(Amount); CLEAR(CostCenterCode); CLEAR(FundNo); CLEAR(ControlFundNo); // OMODNV01 - ADD End [b]FA Journal Line - OnAfterImportRecord()[/b]// OMODNV01 - ADD Start // Initialize the template and batch names FAJournalLine.INIT; FAJournalLine.SETRANGE("Journal Template Name", FAJournalBatch."Journal Template Name"); FAJournalLine.SETRANGE("Journal Batch Name", FAJournalBatch.Name); //FAJournalLine.SETFILTER("Journal Template Name", 'ASSETS'); //FAJournalLine.SETFILTER("Journal Batch Name", 'DEFAULT'); LastLineNo += 10000; FAJournalLine."Line No." := LastLineNo; FAJournalLine."FA Posting Date" := FAPostingDate; FAJournalLine."Document No." := DocumentNo; FAJournalLine."FA No." := FANo; FAJournalLine."Depreciation Book Code" := DepreciationBookCode; CASE FAPostingType OF 'Acquisition Cost': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::"Acquisition Cost"; 'Depreciation': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::Depreciation; 'Write-Down': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::"Write-Down"; 'Appreciation': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::Appreciation; 'Custom 1': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::"Custom 1"; 'Custom 2': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::"Custom 2"; 'Disposal': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::Disposal; 'Maintenance': FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::Maintenance; ELSE FAJournalLine."FA Posting Type" := FAJournalLine."FA Posting Type"::"Salvage Value"; END; FAJournalLine.Description := Description; FAJournalLine.Amount := Amount; // Get the cost center and fund data from the dataport line FAJournalLine.VALIDATE("Cost Center Code", CostCenterCode); FAJournalLine."Control Fund No." := 'OPER'; FAJournalLine.INSERT;
0 -
See my previous posting. I have nothing to add.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
I am looking at the data it imported to FA Journal Table and I noticed that the Journal Template Name and Journal Batch name are left blank.
I think that might be reason its not showing up in the FA Journal Line form.
Any Idea why it might be doing that.
Originally I had this:
FAJournalLine.SETFILTER("Journal Template Name", 'ASSETS');
Shoudlnt it set the Journal Template Name to ASSETS automatically? This might seem like a stupid question0 -
SETFILTER or SETRANGE are used to filter your records, not to assign fieldvalues. You should assign the proper values to all key fields yourself.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
hmmm...that is so strange....I manually assigned the Journal Template Name and Journal Batch Name and it worked.
FAJournalLine."Journal Template Name" := 'ASSETS';
FAJournalLine."Journal Batch Name" := 'DEFAULT';
hmmm....OK. I guess that makes sense...Thanks.. I learned something new today.0 -
If you would have used insert(true),you could have found that the template and batch are inserting or not.
anyway now it has been solved.
Congrats Harry for reaching his fantastic figure(6666). =D>0 -
vijay_g wrote:If you would have used insert(true),you could have found that the template and batch are inserting or not.0
-
You are right that the record can be inserted without template or batch having only line no. incremental but this is the line that would stop to insert record.
FAJnlTemplate.GET("Journal Template Name");
0 -
If there is a template with a blank Name it would not stop the insert, and it is quite common to have those.0
-
The point is, your advice that INSERT(TRUE) would catch them is not correct.0
-
Savatage wrote:Did you fill Journal Template Name & Journal Batch Name or did you think those were unnecessary?nverma wrote:I am looking at the data it imported to FA Journal Table and I noticed that the Journal Template Name and Journal Batch name are left blank.Luc Van Dyck wrote:SETFILTER or SETRANGE are used to filter your records, not to assign fieldvalues. You should assign the proper values to all key fields yourself.nverma wrote:hmmm...that is so strange....I manually assigned the Journal Template Name and Journal Batch Name and it worked.0
-
This should have stopped here as we suppose that there can not be a blank template as standard nav says anyway.
Thanks a lot Harry..vijay_g wrote:You are right that the record can be inserted without template or batch having only line no. incremental but this is
the line that would stop to insert record.FAJnlTemplate.GET("Journal Template Name");
0 -
vijay_g wrote:we suppose that there can not be a blank template0
-
vijay_g wrote:This should have stopped here as we suppose that there can not be a blank template as standard nav says anyway.
Vijay if I am driving my car, and I need to stop, I can drive into a brick wall. Most definitely this WILL stop the car. But would you say this is the proper way to stop a car?David Singleton0 -
DenSter wrote:Which is the assumption that makes your advice wrong. Sorry to keep hammering at this, but you just cannot make assumptions like that.
sorry for this if i was wrong but just want to know how can a db have blank template? i have never seen this anywhere(i can insert forcefully but this is not the right way that a user can do even).0 -
vijay_g wrote:how can a db have blank template? i have never seen this anywhere
Don't get me wrong, I like the way you are thinking, and it was quite clever, but just not thought through all the way. It was too complicated when the simple answer (set the template and batch names properly) was a much better solution. You need to start thinking through what you're saying a little bit more, and take a few steps beyond what you are used to. Just because 'practically' something is 'not supposed' to happen does not mean that you can safely assume that it never does. As a result you are making assumptions that can completely screw up your work.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