prashan,
I tried the any2str and it compiles but I receive runtime error, "Error 
executing code: Wrong type of argument for conversion function."
Would I need to use variables for this?

Regards.







________________________________
From: prashant verma <prashant_axa...@yahoo.co.in>
To: Axapta-Knowledge-Village@yahoogroups.com
Sent: Wednesday, August 12, 2009 11:26:43 PM
Subject: Re: [Axapta-Knowledge-Village] Compile error with XML Create Document

  
Goodmorning Girac,
 
Your problem is solved.Actually createTextNode method accepts str argument.Just 
write
any2str like this xmlText = xmlDoc.createTextNo de(any2str( ReqTrans. Qty));
And for integers or real value always use num2str. 


Regards,
Prashant Verma
ILFS Technologies Limited.

--- On Wed, 12/8/09, Girac <girac...@yahoo. com> wrote:


>From: Girac <girac...@yahoo. com>
>Subject: [Axapta-Knowledge- Village] Compile error with XML Create Document
>To: Axapta-Knowledge- vill...@yahoogro ups.com
>Date: Wednesday, 12 August, 2009, 8:10 PM
>
>
>  
>Good day all,
>
>I am getting an error when I compile this job, 
>
>"Argument 'Text' is incompatible with the required type." 
>Here it the code I am using,
>
>// Create a node for the Qty
>xmlElement = xmlDoc.createElemen t("Qty");
>NodeAddr = NodeEmpl.appendChil d(xmlElement) ;
>xmlText = xmlDoc.createTextNo de(ReqTrans. Qty);
>NodeAddr.appendChil d(xmlText) ;
>
>Qty is an real number, 
>
>What arguments would I need to use for integers/numbers?
>
>Here is my full code:
>static void XMLitem(Args _args)
>{
>XMLDocument xmlDoc = XMLDocument: :newBlank( );
>XMLNode rootNode;
>XMLNode NodeEmpl, NodeName, NodeAddr;
>XMLElement xmlElement;
>XMLText xmlText;
>//XMLreal xmlNumber;
>ReqTrans ReqTrans;
>
>int i;
>;
>// Create first line containing version info
>rootNode = xmlDoc.documentElem ent();
>xmlElement = xmlDoc.createElemen t("axItems" );
>rootNode = xmlDoc.appendChild( xmlElement)
> ;
>while select ReqTrans 
>{
>// Create a node for the Items record
>xmlElement = xmlDoc.createElemen t("Items" );
>NodeEmpl = rootNode..appendChi l d(xmlElement) ;
>// Create a node for the ItemID
>xmlElement = xmlDoc.createElemen t("ItemID" );
>NodeName = NodeEmpl.appendChil d(xmlElement) ;
>xmlText = xmlDoc.createTextNo de(ReqTrans. ItemID);
>NodeName.appendChil d(xmlText) ;
>// Create a node for the Qty
>xmlElement = xmlDoc.createElemen t("Qty");
>NodeAddr = NodeEmpl.appendChil d(xmlElement) ;
>xmlText = xmlDoc.createTextNo de(ReqTrans. Qty);
>NodeAddr.appendChil d(xmlText) ;
>i++;
>print i;
>}
>// Save the file
>xmldoc.save( 'C:\\Temp\ \XML.xml' );
>}
>
> 

________________________________
 See the Web's breaking stories, chosen by people like you. Check out Yahoo! 
Buzz.
   


      

Reply via email to