Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Syed Mazhar Hasan Qadri
    Calling a named event using JS APIAnswered
    Topic posted October 15, 2018 by Syed Mazhar Hasan Qadri, tagged REST 
    64 Views, 3 Comments
    Title:
    Calling a named event using JS API
    Summary:
    I need to call named event from my browser control.
    Content:

    I have some data in a webpage that is loaded in a workspace via a browser control. What I need to do is to raise a named event from Javascript code when data in browser control is changed, so that I can update the workspaces accordingly.

    Thank you in advance.

    Version:
    18C

    Best Comment

    Neil

    It's a long time since I have worked with the JS API but I don't think you can trigger events, only listen for some. I seem to remember the work around is to change the value of a field on the workspace and then use the workspace rules to fire when that field changes value. That should work with a couple of caveats, the field cannot be in a hidden tab, i.e. it must be visible, and also the value actually has to change so you may need to check the value/increment it etc.

    Comment

     

    • Neil

      It's a long time since I have worked with the JS API but I don't think you can trigger events, only listen for some. I seem to remember the work around is to change the value of a field on the workspace and then use the workspace rules to fire when that field changes value. That should work with a couple of caveats, the field cannot be in a hidden tab, i.e. it must be visible, and also the value actually has to change so you may need to check the value/increment it etc.

    • Vlad

      Aside from what Mr Mann suggested, if you use BUI (Browser User Interface) instead of the .NET console, you can fire named events through the Browser Extensibility Framework:

      http://documentation.custhelp.com/euf/assets/devdocs/unversioned/BUI_Extensibility/topicrefs/Workspace_functions.html#Workspace_functions__TriggerNamedEvent-840ED04C

    • Syed Mazhar Hasan Qadri

      I ended up resorted to what Mann posted, but wasnt able to get it work because it was a hidden field. Have to keep it visible as per the chosen answer.