It was successful imported as a message box but the field was not. What should I do. Thankz
*This post is locked for comments
It was successful imported as a message box but the field was not. What should I do. Thankz
*This post is locked for comments
a check if the contact already exists is missing.
you can use following:
// the xmlport
Node Name Prefix Node Type Source Type Data Source
Root Element Text <Root>
Contact Element Table <Contact>(Contact)
SalCode Element Field Contact::Salutation Code
FirstName Element Field Contact::First Name
MiddleName Element Field Contact::Middle Name
Surname Element Field Contact::Surname
Address Element Field Contact::Address
City Element Field Contact::City
MobilePhone Element Field Contact::Mobile Phone No.
Email Element Field Contact::E-Mail
SalesPerson Element Field Contact::Salesperson Code
// the trigger code
// create a local var. contact2 / record / Contact
Contact - Import::OnBeforeInsertRecord()
Contact.Type := Contact.Type::Person;
contact2.SETRANGE("First Name",Contact."First Name");
contact2.SETRANGE(Surname,Contact.Surname);
contact2.SETRANGE(Address,Contact.Address);
contact2.SETRANGE(City,Contact.City);
contact2.SETRANGE("E-Mail",Contact."E-Mail");
IF contact2.FINDFIRST THEN BEGIN
MESSAGE('Contact "' + Contact."First Name" + ' ' + Contact.Surname + ' already exists. Skipping ...');
currXMLport.SKIP;
END;
Please check the right question below. Thanks
I have a xmlport called Import contact list. Contains Salutation Code, FirstName,MiddleName,Surname, Address, City, MobilePhoneNo, Email,SalesPersonCode.
It keeps importing duplicate after double click.
code
OnPostXMLport()
MESSAGE ('Contact(s) importations successful');
Contact - Import: :OnBeforeInsertRecord()
employerrec .RESET;
IF employerrec .GET(Contact."Company No.")= FALSE
THEN ERROR ('Invalid Employer code for ' + Contact.Surname +' ' + Contact."First Name" +' '+ Contact."Middle Name" );
Contact."Company Name":=employerrec."Company Name PenCom";
please describe more details.
Without see the code (or what you’ve done) it’s difficult to help you...