Difference between revisions of "Pandora - Find a Level 1 Contact"

From SmartWiki
Jump to: navigation, search
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Function Overview==
+
This function is used to find a {{l1}} contact.
 
 
This function is used to find a Level 1 contact.
 
  
 
  levelonecontact_find(flag,callback,appid,opportunityid,fields,filter,order,start,end)
 
  levelonecontact_find(flag,callback,appid,opportunityid,fields,filter,order,start,end)
Line 19: Line 17:
 
|'''Fields''' ||The field list to be retrieved.
 
|'''Fields''' ||The field list to be retrieved.
 
|-
 
|-
|'''Filter'''|| The criteria to apply on the return records.
+
|'''[[Pandora Filter Examples|Filter]]'''|| The criteria to apply on the return records.
 
|-
 
|-
 
|'''Order'''|| The field to be ordered by for the return records.
 
|'''Order'''|| The field to be ordered by for the return records.
Line 31: Line 29:
  
  
==Notes==
+
Where:
  
 
Fields = always the driver for created record set.
 
Fields = always the driver for created record set.
Line 48: Line 46:
  
  
To find the role assigned to the L1 with the field is oprid:
 
*var fields="oprid";
 
*var filter=,"opr.contactid=@me.userid@";
 
*var grs=levelonecontact_find(false,"",appid,opportunityid,fields,filter,"",0,1);
 
*var od=grs.getfieldbyname(1,'oprid');
 
  
 +
==Notes==
 +
Standard field names on the intersection table:-
 +
* '''roleid''': The roleid of the user role that the contact is assigned to the Level 1 with
 +
* '''contactid''': the contact userid.
 +
* '''opportunityid''': the opportunity ID.
 +
* '''oprid''': the intersection ID of the contact/Level 1 intersection
 +
 +
 +
==Examples==
 +
* Find the contacts assigned to the current {{l1}} with [[roleid]] 12345:
 +
var drs=levelonecontact_find(false,"",appid,@opportunityid@,"contactid","opr.roleid=12345","",0,100);
 +
 +
* Find the role the current user is assigned with on a given Level 1 record, and the intersection ID
 +
:* You need the intersection ID if you want to update Custom Fields on the intersection, or trigger a UTA Role Assignment Workflow.
 +
var fields="oprid";
 +
var filter="opr.contactid=@me.userid@";
 +
var rs=levelonecontact_find(false,"",appid,opportunityid,fields,filter,"",0,1);
 +
var assignedRoleID=rs.getfieldbyname(1,'oprid');
 +
var intersectionID=grs.getfieldbyname(1,'oprid')
 +
 +
 +
 +
==See Also==
 +
* [[Pandora Filter Examples]]
  
  
 
[[Category: Pandora]]
 
[[Category: Pandora]]

Latest revision as of 13:16, 14 June 2013

This function is used to find a Level 1 contact.

levelonecontact_find(flag,callback,appid,opportunityid,fields,filter,order,start,end)
Parameter Description
Flag True or false, send synchronously or asynchronously.
Callbackfunc Function to be used after the asynchronous function call.
appid Application ID for the UTA.
opportunityid The role assigned to the L1 with the field.
Fields The field list to be retrieved.
Filter The criteria to apply on the return records.
Order The field to be ordered by for the return records.
Start The index of the first record to be returned from the record set retrieved based on the filter.
End The index of the last record to be returned from the record set retrieved based on the filter.
Returns ssRecordSet object


Where:

Fields = always the driver for created record set.

Filter = 'lastname like "y*"'

Order = 'lastname desc'

Start = 0 to 200 default = 0

End = 200 default = 200

Blank ,"","",

Prefix=??


Notes

Standard field names on the intersection table:-

  • roleid: The roleid of the user role that the contact is assigned to the Level 1 with
  • contactid: the contact userid.
  • opportunityid: the opportunity ID.
  • oprid: the intersection ID of the contact/Level 1 intersection


Examples

  • Find the contacts assigned to the current Level 1 with roleid 12345:
var drs=levelonecontact_find(false,"",appid,@opportunityid@,"contactid","opr.roleid=12345","",0,100);
  • Find the role the current user is assigned with on a given Level 1 record, and the intersection ID
  • You need the intersection ID if you want to update Custom Fields on the intersection, or trigger a UTA Role Assignment Workflow.
var fields="oprid";
var filter="opr.contactid=@me.userid@";
var rs=levelonecontact_find(false,"",appid,opportunityid,fields,filter,"",0,1);
var assignedRoleID=rs.getfieldbyname(1,'oprid');
var intersectionID=grs.getfieldbyname(1,'oprid')


See Also