Thank you for your assistance. I solved it by using the in2str as well as the 
strfmt('%1').



--- In Axapta-Knowledge-Village@yahoogroups.com, sreenath reddy 
<shysrin...@...> wrote:
>
> use  xmlDoc.createTextNode( strfmt('%1',ReqTrans. Qty));
> 
>  sreenath
> 
> --- On Thu, 8/13/09, giarc 127 <girac...@...> wrote:
> 
> From: giarc 127 <girac...@...>
> Subject: Re: [Axapta-Knowledge-Village] Compile error with XML Create Document
> To: Axapta-Knowledge-Village@yahoogroups.com
> Date: Thursday, August 13, 2009, 9:09 PM
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
>     
>                   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_axapta@ yahoo.co. in>
> To: Axapta-Knowledge- vill...@yahoogro ups.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