Pandora Filter Examples

From SmartWiki
Jump to: navigation, search
  • This filter will look for Level 3s attached to the current level 2 with a value from the variable "exType" in the custom field 1301787:
 var filter="objectid='@objectid@' and tbl_1301787.valuestr="+exType;
  • This filter is used to find the intersection id for the current user associated to the Level 1 contacts section of a given Level 1 record:
grs=levelonecontact_find(false,"",103069,@opportunityid@,fields,"opr.contactid=@me.userid@","",0,1);
var od=grs.getfieldbyname(1,'oprid');
  • An example of multiple criteria
var fields="opportunityid,opportunitytype,cf_1329697,cf_1324714";
var filter="opportunitytype=11406 and (tbl_1329697.valuestr='' or tbl_1329697.valuestr not like '%-Done!%')";
var rs=levelone_find(false,"",appid,fields,filter,"",0,500,"");

Escaping Apostrophes

When searching a text field that may contain an apostrophe (') you need to add a backslash in front of the apostrophe so it is not interpreted as closing the text string:

  • The following filter can be used to search the company name field for the name in the cname field on the page.
  var filter = " name='"+frm.cname.value.replace(/'/g,"\\'")+"'";