Desktop and UI Extensibility

Get Involved. Join the Conversation.

Topic

    Manjit SIngh Arora
    Getting this error "There has been an error with your...
    Topic posted August 27, 2019 by Manjit SIngh AroraGreen Ribbon: 100+ Points 
    34 Views, 4 Comments
    Title:
    Getting this error "There has been an error with your request" while ruining php script
    Summary:
    php
    Content:

    Hi Everyone,

    i am getting the following error "There has been an error with your request" while updating the Service Product through custom script PHP.

    Although , i am able to create the service product but unable to update the same.

    Note*: Code executes fine untill the this line "$ServiceProduct->save(RNCPHP\RNObject::SuppressAll);" , after this simple echo is also not getting executed

    Thanks!

    Code Snippet:

    Comment

     

    • Tushar Gupta

      To update you can try something like below:

      $ServiceProduct->CategoryLinks = new RNCPHP\ServiceCategoryDeltaArray();
      $ServiceProduct->CategoryLinks[0] = new RNCPHP\ServiceCategoryDelta();
      $menu = new RNCPHP\NamedIDLabel();
      $menu->LookupName = "Category Name";
      $ServiceProduct->CategoryLinks[0]->ServiceCategory = $menu;
      • Manjit SIngh Arora

        Hi Tushar,

        Thanks for sharing i will try this piece code and will let you know, although are you sure the error is because of Category Links? as only three days back the same code was working fine for update and i have tested for like a week?.

    • Tushar Gupta

      Hi Manjit,

      I too faced the same issue while updating the menu field, That's why I had shared the above code as by using it I was able to solve my issue.