Hello all,
Could/would someone help? (Checked out Mibuso before posting this but could not find the solution or make it work)
My issue: I need to import xml file with a field > 1024 Characters. (in this example code import the calendar data from outlook).
I do not want to use xml port but use the automation variables.
I receive the error "the length of the text string exceeds the size of the string buffer".
I tried to use other XML automation type (eg 'Microsoft XML, v6.0'.IXMLDOMText), but I could not get it working:
Anyone knows how to fix this (and want to share)? Much appreciated!!!!!
IF ISCLEAR(XMLDocument) THEN CREATE(XMLDocument);
XMLDocument.load('x:\tmp\Calendar.xml');
XMLNodeList := XMLDocument.getElementsByTagName('Calendar');
XMLNode := XMLNodeList.item(0);
BEGIN
REPEAT
i := i + 1;
Cal_Rec.INIT;
Cal_Rec."No." := i;
Cal_Rec.Subject := XMLNode.selectNodes('Subject').item(0).text;
EVALUATE(Cal_Rec.StartDate,XMLNode.selectNodes('StartDate').item(0).text);
Cal_Rec.MeetingOrganizer := XMLNode.selectNodes('MeetingOrganizer').item(0).text;
Cal_Rec.Categories := XMLNode.selectNodes('Categories').item(0).text;
// CODE LINE BELOW IS THE PROBLEM...
Cal_Rec.Description := copystr(XMLNode.selectNodes('Description').item(0).text,1,250);
//
Cal_Rec.INSERT;
XMLNode := XMLNodeList.nextNode;
UNTIL ((ISCLEAR(XMLNode)) OR (i = 10));
END;
Kind regards, Peter
0
Comments
Anways; Last time I had the same problem (in XBRL in NAV5) I wrote the xml node to a BLOB, and then read it back one piece at the time. That way you can copy or split the description. But it is a bit cumbersome.
Microsoft - Dynamics NAV