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
IF NOT(INSERT) THEN MODIFY;
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.
Pelle