2 Replies Latest reply on Jul 13, 2020 2:52 AM by Igor Svetek

    Webservice for cascade menu fields

    Igor Svetek
      Share This:

      I have a custom form with 3 character fields that have menus attached to them. These 3 menus are cascade-connected (based on the selection of the first menu, values are displayed in the second menu, based on the selection of the first and the second menu, values are displayed in the third menu). I need to display these menu values through web service.

       

      Each menu will have a get list operation. I have created a web service on the form that contains all the menu combinations, but now I am facing an issue regarding getting distinct values. When I call get-list operation for the menu1, I get multiple repeats of the values (example, 7 times value1, 10 times value2 etc.)

       

      Is there a way to do SQL "SELECT DISTINCT" through web service?

        • 1. Re: Webservice for cascade menu fields
          Fred Grooms

          No there is not a Distinct option in the XML of a web service.

          I can think of a couple of ways to do this.

           

          One way would be to add a couple of checkbox fields to your form.  One for Field 1 and 1 for Field 2.  These would be used to mark a record of each that would be pulled for the service.

          i.e.  ck_Field1   Set it on for the first record of each distinct value for field1.  In the service add to the qualification for field 1 AND ck_Field1 = "Yes"

          Do the same for Field 2 but only mark the 1st record based on the combination of Field 1 and Field 2

          This method is more work when updating the menu form data to set the checkboxes

           

          The other method would involve creating a couple of db views to do the DISTINCT queries and then creating Remedy View forms against those db views.  You would then switch the Field1 and Field2 pulls in the web service to work against those new Remedy view forms.

          2 of 2 people found this helpful
          • 2. Re: Webservice for cascade menu fields
            Igor Svetek

            @Fred Grooms

            The problem I see with the first implementation is the case when you disable/delete entry which has a unique checkmark, For example:

             

            1.     A     B     X               YES     YES

            2.     A     B     Y               NO        NO

            3.     A     C     abc           NO        YES

             

            If I delete the first record, combination A and A-B would never appear in the web service. I would need to have a workflow that would again do check off "uniqueness" of the fields after each deletion of the records from the "menu form".

             

            The second solution seems like a better solution, I will need to check to see how it works.