It looks like you're new here. Sign in or register to get started.
OBJECT Codeunit 50050 Pass XML to Text { OBJECT-PROPERTIES { Date=09/12/21; Time=19:54:40; Modified=Yes; Version List=; } PROPERTIES { OnRun=BEGIN Txt := XML2Text('Your XML File path here'); MESSAGE(Txt); END; } CODE { VAR Txt@1000000000 : Text; PROCEDURE XML2Text@1000000000(FileName@1000000001 : Text) : Text; VAR XMLDoc@1000000000 : DotNet "'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Xml.XmlDocument"; BEGIN XMLDoc := XMLDoc.XmlDocument; XMLDoc.Load(FileName); EXIT(XMLDoc.InnerXml); END; BEGIN END. } }
Answers
What version of NAV/BC are you using ?
Regards.
You could use something like this, the porcediure XML2Text returns a text withe the XMLFile parameter passed:
Regards