Hi,
I have a xml file that you can insert with a xml port.
and I want to insert record if the record doesnt exists. I have a check box for Digital email facurering. If the checkbox with the name:
“”.“Digital shipment”
is checked(true) then a new recod has to be inserted with the name: 'Crediteuren administratie.
I have it now like this:
BussinesContactName.SETFILTER(BussinesContactName.“No.”,"".“No.” );
IF BussinesContactName.FINDFIRST THEN;
“”.“Country/Region Code” := ‘NL’;
“”.“Fax No.” := Rec.“Fax No.”;
//loops through all the contacts connected with a company contact
WHILE (LoopCount <> 0) DO
BEGIN
KlantContact.GET(FirstContact);
KlantContact.VALIDATE(KlantContact.“Company No.”, BussinesContactName.“Contact No.”);
IF KlantContact.Website = TRUE THEN
KlantContact.“E-Mail Verification” := 1
ELSE
KlantContact.“E-Mail Verification” := 0;
IF “”.“Digital shipment” = TRUE THEN BEGIN
//MESSAGE(‘ja’);
KlantContact.INIT;
KlantContact.Type := 1;
KlantContact.“No.” := ‘1123’;
KlantContact.Name := ‘Crediteuren administratie’;
//MESSAGE(KlantContact.“No.”);
// END;
KlantContact.VALIDATE(KlantContact.“Company No.”, BussinesContactName.“Contact No.”);
// KlantContact.INSERT;
IF “”.“Digital shipment” = FALSE THEN
MESSAGE(‘Nee’);
END;
KlantContact.MODIFY;
LoopCount := LoopCount - 1;
FirstContact := INCSTR(FirstContact);
END;
But
The xml looks like this:
<?xml version="1.0" encoding="utf-8"?>sdfsdf
sdfsdf
sdfsdf
123456
sdfsd
nengelen@online.nl
1234567890
Eenmanszaak
12345678
dfgdfgdfg
niet_verplicht
niet_verplicht
dfgdfgdfgdfg
dfgdfgdfgdfg
kontant
nee
Ja
nengelen@online.nl
Niels
Engelen
nengelen@onlie.nl
1234567890
dfgdfg
dfgdfg
Ja
Ja
Ja
Ja
Ja
Ja
Ja
But the problem is now that the contactperson: Niels will not be inserted. ONly the new record: 'Crediteuren administratie
will be inserted.
Thank you