Dear All,
I am having this funny problem on the dataport.
I have a dataport to import some information for customer, however, this dataport will initialise "Print Statement" field whenever i run the dataport.
I have check both Table 18 and dataport, there is NO code that update "Print Statement" field.
So, finally, i got the pattern for this problem, which is :
1) If i run the dataport in design mode [meaning i open the object in design mode and didn't close and save the object], then the dataport will NOT initialise "Print Statement"
2) If i run the dataport [after close and save the object], then "Print Statement" will be initialised.
Anyone has any idea how to solve this?
Thank you.
0
Comments
Is there a function or Codeunit that u call which set this field to true?
Note: If you run a dataport from designmode without a commit, the datas will not be stored.
Regards
And yes, you are right. The system will not update the data if run at design mode.
I added a "commit" at Customer - post data item. Run the dataport at design mode and "Print Statement" got updated.
So, now i have no idea which part of the code in the system has been to trigger to update "Print Statement", it's just a simple dataport.
THank you.
Regards
Rachel
i use the attachment, but it didn't work.
TQ
Thank you.
I suspect the problem is arising from changing the Global Dimensions. In the Default Dimension table there is code which is dangerous if used out of Standard Nav
i.e. This assumes than a customer always exists - I would perfer to see the modify withing the IF Cust.GET("No.") THEN
Try the upload without the 2 global dimension to test it out.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
The dataport did not update the 2 global dimension. In fact, i have try to comment the code that highlighted by you, and try the dataport. The result is still the same.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Can you post the code again within the
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
AutoReplace=Yes; -->
That means, that if a rec exist in your file and in the table, the rec in the table will be replaced with the datas from the file. All other fields (that are not in the file) will be set to the default value
and
AutoUpdate=No; -->
That means, that if an Rec in the table exist with the same Primary key, only the fields from the dataport file will be updated. All other fields are not changed.
So, you have set the Update to NO and Replace to ÝES. Now, if you import the customer, and this customer exist and in the existing Customer are some fields modified, these fields will be set to the default value.
Are these all new customers or existing customers?
Regards
Your problem is the properties on the Customer dataitem. You have set AutoUpdate to No and AutoReplace to Yes. This means that the dataport will fully replace the entire record with the data from the dataport and initialise all other variables. I suspect as Harry points out that there is an InitValue on the Print Statements. To replace just the fields you are importing revert back to defaults i.e. AutoUpdate - Yes AutoReplace - No
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Then u delete all existing values in all fields that are not in the dataport (like name 2)
Thank you for your suggestion on the Autoupdate and AutoReplace.
I change the property AutoUpdate to Yes and AutoReplace to No, and it works!
The "Print Statement" field does not get updated.
Thank you all for helping me on this.
Regards
Rachel