Dataport to existing file

bhuber
Member Posts: 78
I have written a dataport to fill the Navision Customer table. WHre a record already exists in the Table, I would like for the dataport to change fields common to the dataport and table but leave fields that exit only in the table alone. I have tried combinations of auto-save, auto-update and auto-replace but can not get desired results. Any ideas.
0
Comments
-
Try this in the OnAfterImportRecord()-trigger:
IF NOT(INSERT) THEN MODIFY;No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
A safe and straightforward way to accomplish this is:
a) Define global variables that match the "imported" fields
i.e. NewItemNo, NetWeight.
b) Define a global variable that matches your record (Item2)
c) In the On after Import trigger, use code like
if Item2.Get(NewItemNo) then
begin
if (Item2."Net Weight" = 0 then)
begin
Item2."Net Weight" = NetWeight;
Item2.modify;
End;
end;
This way, the dataport doesn't write anything to the table,
but you have total control over what happens. Just as whe you run a report.
Pelle0
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