Visual Builder

Get Involved. Join the Conversation.

Posts

  • Stephen Bryant
    Field Level Update Trigger updates field only onceAnswered6
    Topic posted November 15, 2019 by Stephen BryantBronze Trophy: 5,000+ Points, tagged Business Objects, Custom Code, Groovy 
    Title:
    Field Level Update Trigger updates field only once
    Summary:
    Field Level Update Trigger on BO only updates field when record is created
    Content:

    Hello,

    I have a very simple trigger in one BO that executes always.  When a field is updated (treasurySymbol), I grab another field from a related BO (attributeOne).

    This works fine when the record is created but updates do not work.

    It is an update trigger so I am a little confused here.  When I change the treasurySymbol field, the attribute1 field does not change.

    Here is the simple code generated:

    // Field Trigger Beginning 
    println 'Field Trigger started: testUpdateTrigger, business object: fvBeTrxHdrs, field: treasurySymbol';

    try {

      // Always Execute Criterion (Always Execute)
      alwaysExecuteCriterion_1: {
        // Action Group (Action Group)
        test = {
        treasurySymbolObject.attributeOne
        }.call();

      }

    } finally {

      // Field Trigger End 
      println 'Field Trigger ended: testUpdateTrigger';

    }

    Am I missing anything?  I've tried setAttribute, isAttributeChanged without success.

     

    Thank you,

    Steve

    Version:
    19.3.1.2
  • Deep Mandal
    Oracle VBCS Role Based Mail SendAnswered65.0
    Topic posted November 14, 2019 by Deep MandalGreen Ribbon: 100+ Points, tagged Action Flows, Business Objects, Custom Code, Groovy 
    Title:
    Oracle VBCS Role Based Mail Send
    Summary:
    Oracle VBCS Role Based Mail Send
    Content:

    In Oracle VBCS how can we send mail to the Users attached to particular VBCS Role.

    For Example:

    Suppose I have two Roles Creator and Approver. So, when users having "Creator" Role creates some record in VBCS BO then I want to send mail to the users having "Approver" role. How this business scenario can be achieved.

    Version:
    19.3.1.2
  • Stephen Bryant
    Business Object Function - return array with multiple...2
    Topic posted November 13, 2019 by Stephen BryantBronze Trophy: 5,000+ Points, tagged Action Flows, Business Objects, Custom Code, Groovy, REST, SaaS Integration 
    Title:
    Business Object Function - return array with multiple records
    Summary:
    Business Object Function - return array with multiple records to pass to web service
    Content:

    Hello,

    I have BO called, TrxHdrs, with multiple records.  I know I can create a BO Object Function to iterate over those records.

    What I would like to do is write records that, for example, have a Status of, "available", to an array.  I want to write the entire record where the criterion is met.  Then I would like to pass the result (with multiple rows) to a web service (integration cloud) that sends it to ERP Cloud.  The only thing I need help with is how to create an array with multiple records in groovy.  The array will be structured to match what is expected by the web service.

    I am thinking each record would be a list with key-value pairs and many records would be contained within a "parent array". That would be the result to pass to the web service.

    In VBCS, I am able to iterate over and ADP and pass a single result to the web service successfully.  I am looking to do the same thing but get the data from the BO. 

    Any help is appreciated.

    Steve    

    Version:
    19.3.1.2
  • Kalpesh Darji
    Add static text in expression editorAnswered3
    Topic posted October 24, 2019 by Kalpesh DarjiGreen Ribbon: 100+ Points, tagged Custom Code, Groovy 
    Title:
    Add static text in expression editor
    Summary:
    Add static text in expression editor
    Content:

    Hi All,

    I want to add some static text along with expression when response from service is returned. Below code gives me result id, however i want to add some text after result ID.   How can we achieve this?

     

    Code Snippet:
  • Abhilasha Singh
    How to assign repeating element of a variable with values...5
    Topic posted October 23, 2019 by Abhilasha SinghRed Ribbon: 250+ Points, tagged Custom Code, Groovy, JET, REST, UI 
    Title:
    How to assign repeating element of a variable with values from an array in the action chain
    Summary:
    How to assign repeating element of a variable with values from an array in the action chain
    Content:

    I have a variable based on REST endpoint that has repeating element in it that needs to be assigned from the rows of an ADP variable. How do I do that in action chain. I don't see for available in assign. if I use for each in the action chain how do I iterate the target variable to assign to next row in the loop. 

    Document:
    assign.PNG (33KB)
  • Sai Reddy
    How to display Business Objects error message in VBCS page2
    Topic posted August 14, 2019 by Sai Reddy, tagged Business Objects, Groovy 
    Title:
    How to display Business Objects error message in VBCS page
    Summary:
    Display business objects error message as Fire Notification in VBCS page
    Content:

    Hi All,

     

    I have Object Validators and Field Validators defined at Business Object level. Now I need to display those validation failure messages in VBCS page as Fire Notification messages.

    I have tried with response body but not able to drill down error message cause of "o:errorCode"

    Response body of Field Validator condition failure:

    {
        "type": "HTTP://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
        "status": 400,
        "title": "Bad Request",
        "detail": "{\"title\":\"Bad Request\",\"status\":\"400\",\"o:errorDetails\":[{\"detail\":\"Actual Landing Validation with Flight Date is Failed\",\"o:errorCode\":\"ValidatorError1\",\"o:errorPath\":\"/actualLandingTime\"}]}"
    }

     

    Thanks,

    Sai

     

     

  • Ziv Rubin
    Browser Crashed While Trying to Load 20K Rows From External...11
    Topic posted August 4, 2019 by Ziv RubinBronze Medal: 1,250+ Points, tagged Business Objects, Database, Groovy, REST, Web 
    Title:
    Browser Crashed While Trying to Load 20K Rows From External REST API
    Content:

    Hi All,

    While trying to load data from a rest API to a Business Object, it suddenly crashes - probably because I was trying to load 20K rows.

    Does anyone know a better way to load data from external REST API to my VBCS BO?

    Thanks,

    Ziv

  • Stephen Bryant
    Object Trigger - create record in another BOAnswered6
    Topic posted July 9, 2019 by Stephen BryantBronze Trophy: 5,000+ Points, tagged Business Objects, Custom Code, Groovy, Validation 
    Title:
    Object Trigger - create record in another BO
    Summary:
    Object Trigger - only create if the record does not exist in the target BO
    Content:

    Hello,

    I have two BOs.  One BO stores balances by various attributes.  I have an Object trigger on this BO that will create the record in another BO as long as certain fields are not present in the BO.  For example, the source BO has fields for Fund, Period and Balance.  If the combination of those fields does not exist in the target BO, then create the record.

    I cannot seem to programmatically access the fields in the target BO using object trigger.

    How can I check using an Object Trigger if fields exists in the target BO? There is no relationship between the two.

    However, if I were to relate the two, could I accomplish this?

    Any other suggestions?

    Thanks,

    Steve

    Version:
    19.1.3
  • Nisheeth Ranjan
    When the Field Level Validation Triggers5
    Topic posted June 17, 2019 by Nisheeth RanjanSilver Medal: 2,000+ Points, tagged Business Objects, Groovy, Validation 
    Title:
    When the Field Level Validation Triggers
    Content:

    Hi Experts, 

    I am adding a field level validation trigger on one of my BO fields. This field is being populated using a Dropdown(Select One ) Component.

    So the use case is if the user doesn't select any value in the dropdown and click on a submit button on the page(means the value is null for the field), it should throw the error I have defined in the validation trigger.

    I have defined the trigger and added the condition however it's not triggering the validation.

    Is the approach I am following is correct? When does the field level validation trigger on a page?

    Thanks,

    Nisheeth

     

  • Stephen Bryant
    regExp in Visual BuilderAnswered12
    Topic posted June 7, 2019 by Stephen BryantBronze Trophy: 5,000+ Points, tagged Business Objects, Groovy, UI, Validation 
    Title:
    regExp in Visual Builder
    Summary:
    Attempting to Implement Pattern Match
    Content:

    Hello,

    I need some guidance on how to best go about validating a field for a particular pattern.

    I've tried implementing the Jet Cookbook approach but cannot import the RegExpValidatorFactory.  I wanted to use the validator property on the field and I figured this was the way to go about it.  

    I also checked out creating a regExp validator on the business object but the compile method is not allowed on the server.

    The pattern I am implementing is simple but how to get it into Visual Builder is the problem.  If someone can point me in the right direction (e.g., how to import the regExp validation factory) that would be great.

    Thanks,

    Steve

    **Update**

    I imported the validators this way and it worked --- "define(['ojs/Validator','ojs/RegExpValidator'], function(oj) { ...}

    I created a blur event on the field calling this function:

     PageModule.prototype.plCodeValidator = function(plCode) {

        var rvf = oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_REGEXP);
        var plCodeValid = rvf.createValidator({
          'pattern': '\d{3}\-\d{3}',
          'messageDetail': 'You must enter two sets of three numbers separated by a dash'     
          
        });
        
        if(plCodeValid.validate(plCode)) {
          
          return true;
          
        } else {
          
          return false;
        }

      };

    I am now getting the following errors in Chrome Dev Tools:

    CallModuleAction (callModuleFunction1_cakqkh3et) The module does not exist or the function 'plCodeValidator' does not exist in the module.

    Action CallModuleAction failed. CallModuleAction (callModuleFunction1_cakqkh3et) The module does not exist or the function 'plCodeValidator' does not exist in the module.

     

    Can anyone help?  It appears the validators will not import.  I can verify that in devtools.  Am I barking up the wrong tree?

    Thanks,

    Steve

     

     

     

     

     

    Version:
    19.1.3