4 Replies Latest reply: Oct 5, 2012 2:02 AM by CristinaS RSS

    Query Custom Object3 using Like


      A customer has many models attached to him .Each model info is maintained in custom object 3 . We have maintained External Unique Id of model(object3) in the format custno-modelno .So each model is identified uniquely by external unique id. I want to delete all the models of that customer using webservice delete mechanism . Inorder to accomplish that we are query the object based on external unique Id to get all models assigned to the customer and delete . In the query expression tried to use LIKE operator ( ex : find all models for customer 1234; query-expression is 'LIKE 1234-' ). But query does not result all the models .
      Can anyone help me on this .We are using ondemand 19
        • 1. Re: Query Custom Object3 using Like

          I have noticed that your expression does not have a wildcard but I supporse that you use one as long as you mentioned that not all the records are returned.
          Does the WS user who performs the delete operation have access to those records? Do the omitted records have anything in common?
          • 2. Re: Query Custom Object3 using Like
            Have the customer generate a list in the browser with the row id and export it to a .csv file. Then write a simple web service delete program that will delete by row id.

            This way the customer can be responsable for the creation of the list of objects to be deleted.

            Also remember you can bundle up, up to 20 row ids in a single delete WS call. Makes things go much faster that way.
            • 3. Re: Query Custom Object3 using Like

              Thanks . All the models for a particular customer have customer number - in common. So If the query can give all the models of that customer i can omit all the models using delete operation .

              Example :
              customer # 1234
              model1: t20 externalunique id: 1234 - t20
              model2: t40 externalunique id: 1234 - t40

              similarly all models of the customer have 1234 - in their external unique Id .So I was trying to perform query using ' LIKE 1234-' here '-' is a wildcard .
              But the WS did not give back any result .

              Only if we query '1234-t20' then the response document is not null.

              I would like to know the query expression in such a scenario.

              The WS user trying to perform delete operation has the required permission

              Edited by: 963173 on Oct 4, 2012 11:34 PM
              • 4. Re: Query Custom Object3 using Like

                if you use a searchspeck like in the below example the query should return all the external unique IDs that begin with 1234

                searchspec="[ExternalUniqueID] LIKE '1234*'">

                - please make sure that between the square brackets is the name of the field you want to filter on
                - make sure that you use * as wilcard