java - How to filter salesforce case object using SQOP API based on parameters like ""Parent Case Product Discription" -
i trying list of cases opened , assigned engineering team , specific few products.
i using soap api , trying first filter cases based on criteria s "parent case product description=some product", type=engineering escalation etc. , retrieving owner name, account name, case product version etc. "parent case product description" , type additional fields based on can filter cases salesforce gui.
however not able filter cases based on above mentioned fields these not fields of case object. checked here http://www.salesforce.com/us/developer/docs/api/content/sforce_api_objects_case.htm
i can access field(which not part of case object), e.g. account name field not there in case object retrieve using "case.account.name" in soql query. problem is, not find way access parameters "parent case product description=some product" , type=engineering escalation.
i achieve below, select ... case "parent case product description" "some product name" , type = 'engineering escalation';
please provide me pointers on how access parameters mentioned in clause.
note: please note "type" mentioned in above example different "case object field" - type.
following part of code trying.
private void querysample() { string soqlquery = "select case.parentid, accountid, casenumber, subject, ownerid, case.account.name case'"; try { queryresult qr = connection.query(soqlquery); boolean done = false; if (qr.getsize() > 0) { system.out.println("\nlogged-in user can see " + qr.getrecords().length + " records."); while (!done) { system.out.println(""); sobject[] records = qr.getrecords(); (int = 0; < records.length; ++i) { case con = (case) records[i]; string cnumber = con.getcasenumber(); string csubject = con.getsubject(); string cownerid = con.getownerid(); com.sforce.soap.enterprise.sobject.account caseaccount = con.getaccount(); string name = caseaccount.getname();
assuming "product description" custom field on case , not long test area (which not allowed in clauses), soql query this:
select id case parent.product_description__c '%something%' , type__c = 'engineering escalation'
one thing noticed in query parent relationships, prefixing case
(e.g. case.parentid
) not needed (i.e. parentid
do). doesn't matter, calling out because leading confusion traversing relationships.
also, task @ hand here, might solved better sosl search, rather soql query. sosl allow find text in long text area , can search across whole object, might work better , should faster because data indexed. might find little much, allow filter records down , further filtering soql or in java code.
Comments
Post a Comment