Run XMLport in CU

usherbrookeusherbrooke Member Posts: 10
edited 2012-08-27 in NAV Three Tier
Hello

I created a CU to launch an object (If RTC or CC) :
-an XMLport with the Direction properties = Import and UseRequestForm properties = No,
-a Dataport with the Import Properties = Yes and UseRequestForm properties = No.

IF ISSERVICETIER THEN BEGIN
CLEAR(myXMLport);
myXMLport.FILENAME(mySetup.FilePath + '\' + mySetup.FileName);
myXMLport.RUN;
END ELSE BEGIN
CLEAR(myDataport);
myDataport.FILENAME(mySetup.FilePath + '\' + mySetup.FileName);
myDataport.RUN;
END;

When I run the CU from the RTC the Windows dialog box "Import" with 2 button (open and cancel) button show systematically...

Have you seen this problem, thank you for your help.
Kind regards
Benoît

Comments

  • ddlarscddlarsc Member, Microsoft Employee Posts: 19
    I suggest you do it like this instead based on the sample code you have.

    Create a file variable called mySetupFile and a instream variable called myInstream

    mySetupFile.Open(mySetup.FilePath + '\' + mySetup.FileName);
    mySetupFile.CREATEINSTREAM(myInStream);
    XMLPORT.IMPORT(XMLPORT:myxmlport,myInStream);
    mySetupFile.Close;
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Lars-Bo Christensen
    Software Developer @ Microsoft
Sign In or Register to comment.