Comments

  • Vinod Kumar Kv

    Hello,

    I am not able to show the CSV content in VBCS UI.

    Because reader.addEventListener is in asynchronous mode I am not able to get the contents from this module function and show them on VBCS ui using assign variable.

    Any thoughts how to achieve this?

    CSV data VBCS function:

    PageModule.prototype.getFile = function(selectedFile) {
        console.log(selectedFile.files[0].name);
        console.log(selectedFile.files[0].size);
        var csvFile = selectedFile.files[0];
        var self = this;
        self.csvFileContent = ko.observable("");
        console.log("Nav");
        //var reader = new FileReader();

        var reader = new FileReader();
        reader.addEventListener("loadend", function() {
          self.csvFileContent(reader.result);
          console.log("Content: "+reader.result);
          return reader.result;
        });

        reader.readAsText(csvFile);
        

      };

     

    Thanks

  • Vinod Kumar Kv

    Hello Christopher Maggiulli,

    Thanks a lot for sharing the code.

    Thanks

  • Vinod Kumar Kv

    Hello Shay,

    I got the problem I need to set ascending or descending not asc or desc. After setting sortcriteria derection to ascending sorting started working but still if i click on sort criteria the sort criteria JSON is not visible.

    Thanks,

  • Vinod Kumar Kv

    ex SELECT response_status, SUM(r_unit) FROM emp_map GROUP BY response_status

  • Vinod Kumar Kv

    Please find below the detailed outline for business scenario:
    1) We have created a normal business object in VBCS. This business object supports (POST, GET, PATCH and other methods by default)
    2) Now we have a button on VBCS page. On click of this button we are calling an action chain.
    3) In this action chain we want to query data from VBCS business object with filter as (CID=someObjectID and STATUS='PROD')
    4) Whatever data will come from this query we want to use some of the fields from that data on popup form.

    In short before opening the popup window we want to query data from one business object with filter and use it in popup form.

     

  • Vinod Kumar Kv

    Thanks Thomas,

    Yes gl-matrix-min has been rename to world-matrix.Below is the log details

     

    log.js:298 ðŸ [VB 10:52:16 (INFO), /vb/stateManagement/page]: Page 'shell' of flow 'app' LOADED.  (completed in 287 ms)
    /ic/builder/design/extimport/1.0/preview/webApps/myapp/webApps/myapp/world-matrix.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    (index):1 Refused to execute script from 'https://paradisevbcsvb-gnaveen.aucom-east-1.oraclecloud.com/ic/builder/design/extimport/1.0/preview/webApps/myapp/webApps/myapp/world-matrix.js' because its MIME type ('application/problem+json') is not executable, and strict MIME type checking is enabled.
    log.js:298 ðŸ [VB 10:52:17 (INFO), /vb/stateManagement/page]: Page 'main-start' of flow 'main' LOADED.  (completed in 592 ms)

     

  • Vinod Kumar Kv

    Hello Shay,

    We are trying to replicate the same steps as mentioned in the below blog.We are getting an error.

    https://blogs.oracle.com/vbcs/importing-and-using-javascript-libraries-in-your-visual-builder-custom-code

     

  • Vinod Kumar Kv

    Thanks Shay,

    We have created a buiness rule (before insert trigger) on one object in VBCS. As per rule if cost > 100 i need to send email to user and update the approval value to true. But I am getting below mentioned error.

    ERROR on UI:
    Error: Exception in expression "Expense" trigger "BeforeInsert_Rule_1" : com.oracle.breeze.ramp.helpers.Email.EmailException : java.lang.NullPointerException
    at "Expense" trigger "BeforeInsert_Rule_1" line 23

    (Code: 400)

    ERROR LOGS:
    Aug 09 2018 11:36:58 AM    Trigger started: Is expensive create, business object: Expense, event: BeforeInsert
    Aug 09 2018 11:36:58 AM    Trigger condition (cost > 100) is true
    Aug 09 2018 11:36:59 AM    Trigger ended: Is expensive create
    Aug 09 2018 11:36:59 AM    JBO-25183: Exception in expression "Expense" trigger "BeforeInsert_Rule_1" : com.oracle.breeze.ramp.helpers.Email.EmailException : java.lang.NullPointerException

    Trigger code:

    println 'Trigger started: Is expensive create, business object: Expense, event: BeforeInsert';
    try {

        // Execute Conditionally Criterion (Execute Conditionally)
        def codeCriterion_1 = (cost > 100);
        println "Trigger condition (cost > 100) is " + codeCriterion_1;
        if (codeCriterion_1) {
            // Action Group (Action Group)
            approval = true;

            def recipients = 'vinod@techkasetti.com';
            def sender = 'vinod@techkasetti.com';
            def variables = [:];
            variables["Parameter1"] = 'Vinod';
            variables["Parameter2"] = 'Kumar';
            variables["Parameter3"] = 'August 3, 2018';
            variables["Parameter4"] = '300';

            def subject = "Expense Report For [[Parameter1]]";
            def body = "<p>Hi [[Parameter2]],</p><p>Big expense has happened on [[Parameter3]] with value [[Parameter4]].</p><p>Thanks,</p><p>Team TechKasetti</p>";
            com.oracle.breeze.ramp.helpers.Email.send(recipients, sender, subject, body, variables);
     

           return;
        }

    } finally {

        // Trigger End
        println 'Trigger ended: Is expensive create';

    }
     

  • Vinod Kumar Kv

    Hello,

    We have already tried  OAuth Resource Owner Password and screenshot you have seen is old one. We are getting the same error with  OAuth Resource Owner Password.

    It will be good if you could share VBCS - Salesforce integration checklist which will help us to move forward.

    Thanks

  • Vinod Kumar Kv

    Hello Thomas,

    Please find attached the console.log and network.har (can be opened in any text editor)

    Thanks

  • Vinod Kumar Kv

    Hello John,

    Thanks for your reply but it looks irrelevant in the present context as it refers to a totally different platform (OIC) and the tools available there are not supported by VBCS currently.

    We want to do the OAuth in VBCS using REST API not SOAP.

    Please let us know if you require more information from us on this issue.

    Thanks

  • Vinod Kumar Kv

    Hello Thomas,

    Thanks for your reply. 

    We have already gone through the twitter blog also.

    Can you please provide us steps to configure OAUTH2 call to salesforce server from VBCS in-case we have missed minor steps.

    Thanks

  • Vinod Kumar Kv

    Hello Shay,

     

    Can you please step in and support us on this, we are having this issue for a while now and not able to move forward.

  • Vinod Kumar Kv

    Hello Thomas

    Please find below the flow for OAuth calls made to salesforce:

    CALL 1 (To receive instance_url, token_type and access_token ):
    TYPE: POST
    URL:  https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=USER-CLIENT-ID&client_secret=USER-CLIENT-SECRET&username=USER-NAME&password=USER-PASSWORD-SALEASFORSE-TOKEN

     We need to pass username:password and clientid:secret  in the URL as shown in the above  CALL 1 URL 

    RESPONSE from CALL 1:
    {
        "access_token": "00D90000000npjw!AQcAQJIqLM7_PUP6ahbzFikmeWM4tY._t78FvLnthYyb6DjPUWrcHGhWHrUjBI3tA94W_3lRwZ.p55BQMBIQ5zUU_70zThgE",
        "instance_url": "https://nguleria-dev-ed.my.salesforce.com",
        "id": "https://login.salesforce.com/id/00D90000000npjwEAA/00590000001HuRnAAK",
        "token_type": "Bearer",
        "issued_at": "1545146633690",
        "signature": "gKI+aM5jQn6fjKYaD3Pvm71QqlwJo5+C2Xj92uCxL0g="
    }

    -------------------------------------------------------------------

    CALL 2 (To get data from salesforce):
    TYPE: GET
    URL: https://nguleria-dev-ed.my.salesforce.com/services/data/v43.0/query/?q=SELECT+name,email,MailingCity+from+Contact 
    REQUEST HEADER of CALL 2: Authorization Bearer 00D90000000npjw!AQcAQJIqLM7_PUP6ahbzFikmeWM4tY._t78FvLnthYyb6DjPUWrcHGhWHrUjBI3tA94W_3lRwZ.p55BQMBIQ5zUU_70zThgE
    instance_url, token_type and access_token received in call 1 will be input to call 2 to fetch data from salesforce using OAuth

    We need to put token_type and access_token as request header (as attribute - Authorization) in CALL 2 to fetch information from salesforce.

    RESPONSE from call 2:
    {
        "totalSize": 1,
        "done": true,
        "records": [
            {
                "attributes": {
                    "type": "Contact",
                    "url": "/services/data/v43.0/sobjects/Contact/0039000002WwwLEAAZ"
                },
                "Name": "Naveen Guleria",
                "Email": "naveen.guleria@gmail.com",
                "MailingCity": "Bangalore"
            }
        ]
    }

    We are trying to use VBCS services for this but not able to make salesforce OAuth working.

    Please let us know if you require more information.

    Thanks

  • Vinod Kumar Kv

    Hello,

    Any update on Salesforce OAuth2 rest API implementation in VBCS because we have demo with he client. 

    Thanks