Promoted categories after upgrade to NAV2017

ACaignieACaignie Member Posts: 91
Hello,
We are upgrading from NAV 2009RTC to 2017 cu11, and we discovered have an annoying "problem" during testing.
It seems that if a user has changed his ribbon in 2009, then after conversion the promoted categories are displayed as "Category4", "Category5" ... instead of the values entered in the page designer.
At this point the user has to restore the defaults to get the proper captions back, losing all his customisations.
Does anyone know how this could be solved (without clearing the metadata tables).

kind regards,
Andy Caignie

Best Answer

  • ACaignieACaignie Member Posts: 91
    Answer ✓
    Removing the PromotedActionCategoriesOrder seems to work without any problems.
    Here is the solution I used to remove the node, perhaps someone else can use it.

    LOCAL Function UpdateUserMetaData()

    Variables:
    lrecUserMetaData= record User Metadata,
    lcunFileMgt = codeunit File Management,
    ltServerFile = text

    lrecUserMetaData.RESET();
    IF lrecUserMetaData.FINDSET( TRUE, FALSE) THEN BEGIN
    ltServerFile := lcunFileMgt.ServerTempFileName( 'XML');
    REPEAT
    RemovePromotedCategories( lrecUserMetaData, ltServerFile);
    UNTIL lrecUserMetaData.NEXT() = 0;
    END;

    LOCAL Function RemovePromotedCategories(VAR precUserMetaData : Record "User Metadata";ptServerFile : Text)

    Variables:
    lnetXMLDocument = dotnet System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    lnetNode = dotnet System.Xml.XmlNode.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    lnetNodeList = dotnet System.Xml.XmlNodeList.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    ltName = text

    precUserMetaData.CALCFIELDS( "Page Metadata Delta");
    IF NOT precUserMetaData."Page Metadata Delta".HASVALUE() THEN
    EXIT;

    precUserMetaData."Page Metadata Delta".EXPORT( ptServerFile);
    lnetXMLDocument := lnetXMLDocument.XmlDocument();
    lnetXMLDocument.Load( ptServerFile);
    lnetNode := lnetXMLDocument.DocumentElement;
    lnetNodeList := lnetXMLDocument.SelectNodes( 'delta/changes/update');
    FOREACH lnetNode IN lnetNodeList DO BEGIN
    IF UPPERCASE( cunXMLDomMgt.GetAttributeValue( lnetNode, 'name')) = 'PROMOTEDACTIONCATEGORIESORDER' THEN BEGIN
    lnetNode.ParentNode().RemoveChild( lnetNode);
    lnetXMLDocument.Save( ptServerFile);
    precUserMetaData."Page Metadata Delta".IMPORT( ptServerFile);
    precUserMetaData.MODIFY();
    COMMIT;
    EXIT;
    END;
    END;

Answers

  • ara3nara3n Member Posts: 9,255
    The data is stored as blob field and thus cannot be changed or fixed. The blob could be an xml format, but I'm not sure. You can export it to a file and take a look at it
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • JuhlJuhl Member Posts: 724
    Just went live with a 2017 upgraded from 2009 RTC yesterday.
    I deleted all personalizations and customizations from the db before upgrade. Too much have change, and these things are easy set again. So that's unnecessary problems to throw into the mix.
    Follow me on my blog juhl.blog
  • ACaignieACaignie Member Posts: 91
    Hi Juhl,
    Our users have done a lot of customizations, and these have to be kept (not my decision). I have done some testing, and it seems that if I delete the “PromotedActionCategoriesOrder” node from the page metadata this is solved.
    Does anyone else have experience with this?
    Kind regards,
    Andy
  • ACaignieACaignie Member Posts: 91
    Answer ✓
    Removing the PromotedActionCategoriesOrder seems to work without any problems.
    Here is the solution I used to remove the node, perhaps someone else can use it.

    LOCAL Function UpdateUserMetaData()

    Variables:
    lrecUserMetaData= record User Metadata,
    lcunFileMgt = codeunit File Management,
    ltServerFile = text

    lrecUserMetaData.RESET();
    IF lrecUserMetaData.FINDSET( TRUE, FALSE) THEN BEGIN
    ltServerFile := lcunFileMgt.ServerTempFileName( 'XML');
    REPEAT
    RemovePromotedCategories( lrecUserMetaData, ltServerFile);
    UNTIL lrecUserMetaData.NEXT() = 0;
    END;

    LOCAL Function RemovePromotedCategories(VAR precUserMetaData : Record "User Metadata";ptServerFile : Text)

    Variables:
    lnetXMLDocument = dotnet System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    lnetNode = dotnet System.Xml.XmlNode.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    lnetNodeList = dotnet System.Xml.XmlNodeList.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    ltName = text

    precUserMetaData.CALCFIELDS( "Page Metadata Delta");
    IF NOT precUserMetaData."Page Metadata Delta".HASVALUE() THEN
    EXIT;

    precUserMetaData."Page Metadata Delta".EXPORT( ptServerFile);
    lnetXMLDocument := lnetXMLDocument.XmlDocument();
    lnetXMLDocument.Load( ptServerFile);
    lnetNode := lnetXMLDocument.DocumentElement;
    lnetNodeList := lnetXMLDocument.SelectNodes( 'delta/changes/update');
    FOREACH lnetNode IN lnetNodeList DO BEGIN
    IF UPPERCASE( cunXMLDomMgt.GetAttributeValue( lnetNode, 'name')) = 'PROMOTEDACTIONCATEGORIESORDER' THEN BEGIN
    lnetNode.ParentNode().RemoveChild( lnetNode);
    lnetXMLDocument.Save( ptServerFile);
    precUserMetaData."Page Metadata Delta".IMPORT( ptServerFile);
    precUserMetaData.MODIFY();
    COMMIT;
    EXIT;
    END;
    END;
Sign In or Register to comment.