+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Where to use a script provided in SF Documentation

Where to use a script provided in SF Documentation

6 posts, 0 answered
  1. Olivier
    Olivier avatar
    31 posts
    Registered:
    06 Aug 2012
    25 Jul 2013
    Link to this post
    Hi there.
    We are trying an upgrade from 5.1 to 6.1.
    In the eCommerce part, we have an issue where some products don't appear.
    In the documentation, there is a script I can run to enable product that might have expired, but I am not sure where to use this script. It is C# code.
    Would someone have an idea?  Can I just add a page with appropriate references and paste the script there, and call it from the PageLoad?

    thanks,
    Olivier
  2. Olivier
    Olivier avatar
    31 posts
    Registered:
    06 Aug 2012
    25 Jul 2013
    Link to this post

    ...actually, I have some other problems with the proposed solution.
    Just so that everybody understands what I am talking about, I am trying to run the script given on this page : http://www.sitefinity.com/documentation/documentationarticles/developers-guide/changes-and-backward-compatibility/breaking-changes-in-sitefinity-6-0/sitefinity-6-0-ecommerce-breaking-changes/troubleshooting/products-do-not-show-in-both-the-frontend-and-backend

    I created a new C# form called Fix.aspx at the root of my site.
    I imported the following namespaces :

    using Telerik.Sitefinity;
    using Telerik.Sitefinity.Modules.Ecommerce.Catalog;
    using Telerik.Sitefinity.Modules.Ecommerce;
    using Telerik.Sitefinity.Abstractions;
    using Telerik.Sitefinity.Ecommerce.Catalog.Model;
    using Telerik.Sitefinity.Services;

    I am still having issues with the following linke of code :

    01.private void UpdateExistingProductsWithoutLifecycleSupport(SiteInitializer initializer)
    02.{
    03.    if (fromVersion.Build < PreviousReleaseBuild) //lifecycle support already applied
    04.    {
    05.        List<Guid> inactiveProducts = CreateMasterProductsFromLiveOnes();
    06.        PublishAllMasterProducts();
    07.        UnpublishTheNotActiveProducts(inactiveProducts);
    08.    }
    09.}

    Line 03 above gives me errors on both "fromVersion" and "PreviousReleaseBuild"  It does not recognized these 2.
    ...and there are 2 other error messages in the catch block where EcommerceLogger is not recognized in the following piece of code :

    1.catch (Exception innerEx)
    2.{
    3.    EcommerceLogger.LogException(innerEx);
    4.}

    any help would be appreciated.

    ...I might be doing this all wrong!


  3. Olivier
    Olivier avatar
    31 posts
    Registered:
    06 Aug 2012
    25 Jul 2013
    Link to this post
    ...actually, I have some other problems with the proposed solution.
    Just so that everybody understands what I am talking about, I am trying to run the script given on this page : http://www.sitefinity.com/documentation/documentationarticles/developers-guide/changes-and-backward-compatibility/breaking-changes-in-sitefinity-6-0/sitefinity-6-0-ecommerce-breaking-changes/troubleshooting/products-do-not-show-in-both-the-frontend-and-backend

    I created a new C# form called Fix.aspx at the root of my site.
    I imported the following namespaces :
    using Telerik.Sitefinity;
    using Telerik.Sitefinity.Modules.Ecommerce.Catalog;
    using Telerik.Sitefinity.Modules.Ecommerce;
    using Telerik.Sitefinity.Abstractions;
    using Telerik.Sitefinity.Ecommerce.Catalog.Model;
    using Telerik.Sitefinity.Services;

    I am still having issues with the following linke of code : 
    if (fromVersion.Build < PreviousReleaseBuild) //lifecycle support already applied
    It gives me errors on both "fromVersion" and "PreviousReleaseBuild"  It does not recognized these 2 objects.
    ...and there are 2 other error messages in the catch block where EcommerceLogger is not recognized in the following piece of code :
    EcommerceLogger.LogException(innerEx);

    Any help would be appreciated.



  4. Olivier
    Olivier avatar
    31 posts
    Registered:
    06 Aug 2012
    26 Jul 2013
    Link to this post
    Follow up on my problem.
    Just in case someone is trying to do the same type of things, it looks like this is the way to run scripts found in the documentation.
    You create a web form from within Visual Studio, and put the code in the CodeBehind file, and then call the main function from either an event like a button press on your form, or from the Page Load function.
    In my particular case, the script provided was incomplete and had errors. They will be correcting the script on the page I provided the link for bellow.
  5. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    26 Jul 2013 in reply to Olivier
    Link to this post
    I just encountered this update script as well...Not even sure how this was published in it's current state :/
  6. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    05 Dec 2016
    29 Jul 2013
    Link to this post
    Hello gyus,

    @Oliver
    It is good to know that when you have Ecommerce module there is no direct path to upgrade from 5.4 to 6.1, because there are breaking changes in the Ecommerce module. Our documentation team prepares a new upgrade procedure and they will upload it shortly. The correct upgrade path should be 5.1->5.2->5.4->6.0->6.1. Please excuse us for the inconvenience.

    Regards,
    Kaloyan
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered