This is a public Forum  publicRSS


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

    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.





    • 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.

      I hope that will help you.





    • 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.



    • 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



      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.