This is a public Forum  publicRSS

Topic

    Raghu Prem Telukuntla
    How to trigger a custom code when a button is clicked on...
    Topic posted August 8, 2018 by Raghu Prem TelukuntlaRegular 
    35 Views, 4 Comments
    Title:
    How to trigger a custom code when a button is clicked on workspace
    Content:

    Hi Team,

    I have added a custom button on custom object, incident workspace. How can we call a custom code when the button is pressed on the incident work space.

    The custom code can be added to object event handler in process designer. Please let me know If this is the right approach to achieve it or suggest me any other approach which is a best practice.

    Appreciate your help.

    Thanks,

    Raghu.

    Answer

     

    • Baljeet Singh

      Hi Raghu,

      I had the similar kind of requirement in last week. You cannot call event handler from incident workspace. Through Business Rule you can call CPM process. There are following ways to achieve this objective. 

      • Add In
      • Business Rule
      • Browser Control - PHP Custom Script
      • Javascript API

      Here is my post regarding this requirement.

      http://communities.rightnow.com/posts/4960338860

      I hope that will help you.

      Thanks!!

       

       

       

    • Raghu Prem Telukuntla

      Hi Baljeet,

      Appreciate your response.

      Our requirement is to create a record in third party system after entering all the required fields in incident workspace. So creating a business rule will call CPM(PHP Code) and will create a record in third party system. But the code will be triggered only when a update takes place on the incident, please confirm.

      Thanks,

      Raghu.

    • Baljeet Singh

      Hi Raghu,

      You can set business rule when you want to call  Event handler (CPM) . For example: if incident update/create or status change  the call Event handler by selecting option "Execute Object Event Handler"  Your code in CPM will do the trick to pass data to third party software via SOAP or REST API. I hope this will help you

       

      Thanks!!

      Baljeet Singh

    • Deepu Kolkkadan

      Hi Raghu,

      You can simply handle this requirement by using a browser control in your workspaces.

      1. Add a browser control in your workspace

      2. Create a PHP custom script

      3. Use Javascript API in your custom script to read workspace field values, then write your custom implementation code (SOAP / REST whatever required for your third party integration)

      4. Host this custom script in RightNow file manager

      5. Finally create a workspace rule like, When button clicked-> Set url (your custom script url) of browser control.

       

      Regards,

      Deepu