Difference between revisions of "Pandora Filter Examples"

From SmartWiki
Jump to: navigation, search
Line 1: Line 1:
==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,"\\'")+"'";
 
  
 
* 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:
 
* 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:
Line 11: Line 8:
 
  var od=grs.getfieldbyname(1,'oprid');
 
  var od=grs.getfieldbyname(1,'oprid');
  
 +
===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,"\\'")+"'";
  
 
[[Category:Pandora]]
 
[[Category:Pandora]]

Revision as of 13:09, 27 November 2012


  • 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');

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,"\\'")+"'";