Visual Builder

Get Involved. Join the Conversation.

Topic

    NG NG
    Distinct values from column of BO
    Topic posted August 19, 2019 by NG NGBlue Ribbon: 750+ Points 
    27 Views, 4 Comments
    Title:
    Distinct values from column of BO
    Summary:
    Distinct values from column of BO
    Content:

    Hi,

    We have a drop down (Select One) component which needs to be populated with distinct values of one of the column of BO.

    Can you please advise how to provide distinct clause in VBCS SDP/ADP.

    Thanks

    Comment

     

    • Stephen Bryant
      I am interested in this as well.  
      
    • Shay Shmeltzer

      There is no direct way to do a distinct operation as part of the fetch of BO data.

      You can fetch all the data to the client and loop over it to filter a list of distinct values in JS.

      Another approach is to have a BO with the distinct list of values - which you can keep up to date using triggers on the original BO each time that the field value is changed.

    • NG NG

      Thanks Shay, can you please provide an example to create a trigger on 1 BO to update another BO.

      • Shay Shmeltzer

        The basic of triggers is here:

        About Triggers for Business Objects                               

        So if you have an Emp object and a Dept object - then you can have a trigger where on every insert to Emp you do an update to Dept as shown in the picture.

        You might want to instead do this with a groovy function that will check if a value is in the table already and if not will add a row.

        Example of developing a groovy function:

        https://blogs.oracle.com/vbcs/creating-invoking-business-object-functions-from-visual-builder-ui