mibuso.com

Microsoft Business Solutions online community
It is currently Thu Apr 24, 2014 3:41 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Automation Variable Issue
PostPosted: Thu Jun 24, 2004 10:20 pm 
Offline

Joined: Thu Jun 24, 2004 10:13 pm
Posts: 1
Location: California
Country: United States (us)
We are working on a project that is taking data out of Navision and dumping it into a xml format. The issue that we have is that we have an "Autmation variable has not been instantiated" and no matter what I change in the CAL Locals to point it to the MSXML it will not get past.

Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 25, 2004 1:43 am 
Offline

Joined: Fri Jun 04, 2004 1:45 am
Posts: 245
Location: CT
Country: United States (us)
Why not follow the pattern in the XML Codeunits -- they work roughly as follows:

Declare XMLDOMDocument as 'Microsoft XML, v3.0'.DOMDocument
Declare CurrNode as 'Microsoft XML, v3.0'.IXMLDOMElement
Declare NewChild as 'Microsoft XML, v3.0'.IXMLDOMElement
Code: Select all
PROCEDURE ExportPO(PurchHdr,PurchLin)
BEGIN
  CREATE(XMLDOMDocument);
  XMLDOMDocument.loadXML := '<PurchaseOrder/>';
  CurrNode := XMLDOMDocument.documentElement;

  // begin a 'Header' element...
  NewChild := CurrNode.ownerDocument.createNode('element', 'Header', '');
  CurrNode.appendChild(NewChild);

  // add child elements to the 'Header' element...
  CurrNode := NewChild;

  NewChild := CurrNode.ownerDocument.createNode('element', 'Document_Number', '');
  NewChild.text := PurchHdr."No.";
  CurrNode.appendChild(NewChild);

  NewChild := CurrNode.ownerDocument.createNode('element', 'Buy_from_Vendor', '');
  CurrNode.appendChild(NewChild);

  // add child elements to the 'Buy_from_Vendor' element...
  CurrNode := NewChild;

  NewChild := CurrNode.ownerDocument.createNode('element', 'Number', '');
  NewChild.text := PurchHdr."Buy-from Vendor No.";
  CurrNode.appendChild(NewChild);

  NewChild := CurrNode.ownerDocument.createNode('element', 'Name', '');
  NewChild.text := PurchHdr."Buy-from Vendor Name";
  CurrNode.appendChild(NewChild);

  {...}

  // done with 'Buy_from_Vendor' child elements
  // move back to the parent to add more 'Header' elements...
  CurrNode := CurrNode.parentNode;

  {...}

  // done with the 'Header' element -- add 'Line' elements ...
  CurrNode := CurrNode.parentNode;

  IF PurchLin.FIND('-') THEN
    REPEAT
      NewChild := CurrNode.ownerDocument.createNode('element', 'Line', '');
      CurrNode.appendChild(NewChild);
   
      // add 'Line' element children...
      CurrNode := NewChild;
   
      NewChild := CurrNode.ownerDocument.createNode('element', 'Line_Number', '');
      NewChild.text := FORMAT(PurchLin."Line No.");
      CurrNode.appendChild(NewChild);
   
      {...}
   
      CurrNode := CurrNode.parentNode;
    UNTIL PurchLin.NEXT = 0;

  // done, save it...
  XMLDOMDocument.save('c:\PurchaseOrder.xml');
END

The xml file looks something like this:
Code: Select all
<PurchaseOrder>
  <Header>
    <Document_Number>1001</Document_Number>
    <Buy_from_Vendor>
      <Number>10000</Number>
      <Name>London Postmaster</Name>
    </Buy_from_Vendor>
  </Header>
  <Line>
    <Line_Number>10000</Line_Number>
  </Line>
</PurchaseOrder>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 25, 2004 10:04 am 
Offline

Joined: Thu Jun 10, 2004 10:54 am
Posts: 76
Location: Gouda
Country: Netherlands (nl)
Before using the automation object begin with:

CLEAR("Automation VAR Name");
CREATE("Automation VAR Name");


Top
 Profile  
 
 Post subject: Re: Automation Variable Issue
PostPosted: Fri Jun 25, 2004 1:18 pm 
Offline

Joined: Mon May 03, 2004 3:49 pm
Posts: 112
Location: Aalborg
Country: Denmark (dk)
chrisdavis_23 wrote:
We are working on a project that is taking data out of Navision and dumping it into a xml format. The issue that we have is that we have an "Autmation variable has not been instantiated" and no matter what I change in the CAL Locals to point it to the MSXML it will not get past.

Any suggestions?


Is this at runtime or at compile-time? The reason I ask this is that if it is at runtime it may be something as simple as you referring to a node that doesn't exist in the xml-document. It will in my experience give that rather misleading error message.


Top
 Profile  
 
 Post subject: same Idea
PostPosted: Thu Jul 08, 2004 4:32 pm 
Offline

Joined: Mon Jun 21, 2004 2:35 pm
Posts: 8
Location: Zug, Switzerland
Country: Switzerland (ch)
hi there

I try to save whole tables in the same way as you done above..
and for a similar one it works - but when I start to safe all tables I got a memoryproblem.
I create an XML object, adds all content of a table in it and safe it and if it's an big tabe i splitt it to several files. Everthing works fine but as longer as the codeunit runs as bigger is the RAM that's neede even a table was saved and the object cleard. Looks like navision doesn't gives requested memory not complettle back..

Any Ideas?? Suggestions??

Thanks
Christoph


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: