Desktop and UI Extensibility

Get Involved. Join the Conversation.

Topic

    Akshara Balamurugan
    Capturing named events triggered from workspace rule in BUI...
    Topic posted November 18, 2019 by Akshara Balamurugan 
    28 Views, 3 Comments
    Title:
    Capturing named events triggered from workspace rule in BUI extension
    Summary:
    How do we capture named events triggered from workspace rule in BUI extension
    Content:

    I am triggering a named event from workspace rule with the following conditions,

    Trigger -> "the record is saved without closing"

    then condition -> "Fire a named event"

    I am trying to capture the named event from BUI extension with following piece of code,

    ORACLE_SERVICE_CLOUD.extension_loader.load("ertduedate" , "1").then(function(extensionProvider) {

    extProvider.registerWorkspaceExtension(function(workspaceRecord){

    workspaceRecord.addNamedEventListener('buiertduedate',namedFunction);
    });
    });
    function namedFunction(p){
    console.log("named event triggered");
    nameFlag = 1;
    console.log("name Flag:" + nameFlag);
    }
     
    But this doesnt seem to work. 
     

     

    Comment

     

    • Edson Junior

      It looks like your code is making a call to extProvider; however, you named it as extensionProvider in the first line. I think your code is running in exception. 
      Here is something tested and working. Please, make sure your workspace rule is triggering this named event after workspace load such as a button.

       

      ORACLE_SERVICE_CLOUD.extension_loader.load("CUSTOM_APP_ID" , "1").then(function(extensionProvider)
              {
              extensionProvider.registerWorkspaceExtension(function(workspaceRecord)
                      {
                      workspaceRecord.addNamedEventListener('buiertduedate',customImplementation);
                      }
              );
              }
      );
      function customImplementation(workspaceRecordEventParameter)
              {
                      console.log("named event triggered");
                      nameFlag = 1;
                      console.log("name Flag:" + nameFlag);
              }
      

      I hope it helps.

      Edson

      • Akshara Balamurugan

        Hi Edson,

        Thanks for the reply, I have used a global variable for extensionProvider. Missed it while copying here. I have something like,

        var extProvider;

        extProvider = extensionProvider;

        And I am able to capture the named event when my trigger is "The editor loads". But when I have "The record is saved without closing" trigger doesnt work.

         

        Thank you,

        Akshara

    • Edson Junior

      Hi Akshara,

      I want to make sure that I can help with a suggestion. Can you elaborate a little bit more on the use case you have?

      Edson