Options

Automation problem on "Update Pages for Style Sheets"

Boom-BoxBoom-Box Member Posts: 27
edited 2011-03-04 in NAV Three Tier
Hi all,

I am using Nav 2009 R1 and, when trying to use codeunit 50000 "Update Pages for Style Sheets" provided by microsoft, although all automations are visible, published and recognized by NAV, both in NAV Server and in my computer, when using the following code:
IF IS CLEAR(AttributeNode) THEN CREATE(AttributeNode);

i get the error:

This message is for C/AL programmers:

Could not create an instance of the OLE control or Automation server identified by
GUID={F5078F18-C551-11D3-89B9-0000F81FE221} 6.0:{2933BF85-7B36-11D2-B20E-00C04F983E60}:'Microsoft XML, v6.0'.IXMLDOMAttribute.
Check that the OLE control or Automation server is correctly installed and registered.

Although this is a very regular sbject in this forum, i haven't been able to find an answer to this problem. i already tried deleting and creating the variables and reattributing the automation services.

Any hint on what this can be?

Thank you for your help!

Comments

  • Options
    ara3nara3n Member Posts: 9,255
    This to me looks like a modification not done correctly.

    I believe Nodes are not created but rather the MSDOM creates the node and assigns it to AttributeNode

    MSDOM.setAttributeNodeNS('attrnode');
    AttributeNode := MSDOM.getAttributeNodeNS(attrnode);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    Boom-BoxBoom-Box Member Posts: 27
    Hi Rashed, thank you for your answer.

    I only put that code because the error I was getting before was the 'classic'

    This message is for C/AL programmers:

    This Automation variable has not been instantiated.
    You can instantiate it by either creating or assigning it.

    The original code is Microsoft, as follows:
    ProcessPages(PageNode : Automation "'Microsoft XML, v6.0'.IXMLDOMNode")
    ChildNodeList := PageNode.childNodes;
    IF ChildNodeList.length > 0 THEN BEGIN
      MaxChildNodeCount := ChildNodeList.length;
      CLEAR(ActionsFound);
      FOR ChildNodeCount := 1 TO MaxChildNodeCount DO BEGIN
        PageChildNode := ChildNodeList.item(ChildNodeCount-1);
        NodeName := PageChildNode.nodeName;
        IF PageChildNode.nodeName = 'Properties' THEN
          ValidPageType := ValidatePageType(PageChildNode);
        IF PageChildNode.nodeName = 'SourceObject' THEN
          ValidSourceTable := ValidateSourceTable(PageChildNode);
        IF PageChildNode.nodeName = 'Actions' THEN BEGIN
          IF (NOT ValidPageType) OR (NOT ValidSourceTable) THEN
            EXIT;
          ActionsFound := TRUE;
          ProcessActions(PageChildNode);
          AttributeList := PageNode.attributes;
          AttributeNode := AttributeList.getNamedItem('VersionList');
          VersionList := AttributeNode.text;
          IF (STRLEN(VersionList) <= (MAXSTRLEN(VersionList) - STRLEN(StyleSheetVersion) + 1)) AND
             (STRPOS(VersionList,StyleSheetVersion) = 0) THEN
            AttributeNode.text(VersionList + ',' + StyleSheetVersion);
        END;
      END;
      IF NOT ActionsFound THEN
        CreateActions(PageChildNode);
    
    END;
    

    Thank you for your help
  • Options
    ara3nara3n Member Posts: 9,255
    Which line in the code does it error out?

    My guess the xml file is malformed or doesn't have the Node expected and thus lines like below

    ChildNodeList := PageNode.childNodes;


    return null. So ChildNodeList is uninitialized.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    Boom-BoxBoom-Box Member Posts: 27
    the error is in the line:
    AttributeNode := AttributeList.getNamedItem('VersionList');
    

    that is the reason why i wrote the
    IF IS CLEAR(AttributeNode) THEN CREATE(AttributeNode);
    

    in the first place...
  • Options
    ara3nara3n Member Posts: 9,255
    But you can create the Node and what is it pointing to?
    Your xml file does not have node. Find out why.

    Save the xml file to text and take a look at it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.