Difference between revisions of "Pandora Functions Descriptions"

From SmartWiki
Jump to: navigation, search
 
(41 intermediate revisions by 5 users not shown)
Line 9: Line 9:
 
* Utility functions – these functions provide additional general functionality to the API.
 
* Utility functions – these functions provide additional general functionality to the API.
  
==='''General System Functions'''===
+
==='''Session Level Functions'''===
  
These functions are general to the entire instance.
+
These functions are used to enable a valid session in which process can be performed and once created, determine user and related organisation attributes.
{| border="1"
+
Unless a function is established, no functionality is available.
 +
 
 +
{| border="1" cellpadding="5"  
 
!Function
 
!Function
 
!Description
 
!Description
Line 18: Line 20:
 
|[[Pandora - Log in a User|Session_Login (Find)]] ||Enables Login to the instance.
 
|[[Pandora - Log in a User|Session_Login (Find)]] ||Enables Login to the instance.
 
|-
 
|-
|[[Pandora - Current User’s Information|Session_getCurrentUser (Find)]] ||Enables retrieving the current user information.
+
|[[Pandora - Logout a User|session_logout(flag,callbackfunc)]]||Enables logout of the instance.
 +
|-
 +
|[[Pandora - Verify If a Session Exists|session_islogin(flag,callbackfunc)]] || Retrieve active user information.
 +
|-
 +
|[[Pandora - Current User’s Information|Session_getCurrentUser (Find)]] ||Retrieve the current user information.
 +
|-
 +
|[[Pandora - Retrieve Current User’s Organisational Information|Session_getCurrentCompany (Find)]] || Retrieve the current user’s organisational information.
 +
|}
 +
 
 +
 
 +
==='''Information Finding Functions'''===
 +
 
 +
These functions return record sets containing multiple records based on the filter passed to the functions.
 +
Each of these functions uses the following parameters:
 +
 
 +
*Fields – the fields list to be retrieved and created in the recordset.  Notes an ID field will be prefixed onto the user specified field list providing the unique identifier for each record.
 +
*Filter – the criteria by which fields should be retrieved.
 +
*Order – the field list to control the sort sequence of the records set.
 +
*Start – the starting record to be returned.  The default is 0.
 +
*End – the end record to be returned.  The default is 200.
 +
*Pref -
 +
 
 +
{| border="1" cellpadding="5"
 +
!Function
 +
!Description
 +
|-
 +
|[[Pandora - Locate an Organisation|company_find(flag,callbackfunc,fields,filter,order,start,end,prefix)]] ||Search function to retrieve organisations.
 
|-
 
|-
|[[Pandora - Retrieve Current User’s Organisational Information|Session_getCurrentCompany (Find)]] || Enables retrieving the current user’s organisational information.
+
|[[Pandora - Locate a Contact/User|contact_find(flag,callbackfunc,fields,filter,order,start,end,prefix)]] ||search function to retrieve contacts.
 
|-
 
|-
|[[Pandora - Send a Message|send_msg(flag,callbackfunc,msgtype,format,fromadd,touserid,cc,subject,body)]] ||Enables sending a message (email or quick message).
+
|[[Pandora - Find a Level 1 Contact|levelonecontact_find(flag,callback,appid,opportunityid,fields,filter,order,start,end,prefix)]]|| Level 1 contact search.
 +
|-
 +
|[[Pandora - Find a Level 1 Company|levelonecompany_find(flag,callback,appid,opportunityid,fields,filter,order,start,end,prefix)]]|| Level 1 company search.
 +
|-
 +
|[[Pandora - Find a Level 2 or 3 Contact|level23contact_find(flag,callbackfunc,appid,level,eventid,fields,filter,order,start,end,prefix,groupby)]]|| Level 2/3 contact search.
 +
|-
 +
|[[Pandora - Find a Level 2 or 3 Company|level23company_find(flag,callbackfunc,appid,level,eventid,fields,filter,order,start,end,prefix,groupby)]]|| Level 2/3 company search.
 +
|-
 +
|[[Pandora - Locate a UTA Level 1 Entity|levelone_find(flag,callbackfunc,appid,fields,filter,order,start,end,prefix,specialfind,groupby)]] || Level 1 item search.
 +
|-
 +
|[[Pandora - Locate a UTA Level 2 Entity|level23_find(flag,callbackfunc,appid,level,fields,filter,order,start,end,prefix)]]||Level 2 item search.
 +
|-
 +
|[[Pandora - Locate a UTA Level 3 Entity|level23_find(flag,callbackfunc,appid,level,fields,filter,order,start,end,prefix)]]|| Level 3 item search.
 +
|-
 +
|[[Pandora - Locate a UTA Invoice Entity|invoice_find(flag,callbackfunc,appid,fields,filter,order,start,end,prefix)]]|| UTA invoice search.
 +
|-
 +
|[[Pandora - Locate a UTA Invoice Item|invoiceitem_find(flag,callbackfunc,appid,invoiceid, fields,filter,order,start,end,prefix)]]|| Enables access to UTA invoice items.
 +
|-
 +
|[[Pandora - Return a Record Set of Level 1 Skills|leveloneskills_find(flag,callbackfunc,objectid)]]|| Enables return of a record set of skills for Level 1 items.
 +
|-
 +
|[[Pandora - Return a Skill List from a Skill Category|skills_find(flag,callbackfunc,skilltypeid)]]|| Enables return of a record set of skill categories for Level 1 items.
 +
|}
 +
 
 +
==='''Recordset Retrieval Functions'''===
 +
 
 +
{| border="1" cellpadding="5"
 +
!Function
 +
!Description
 +
|-
 +
|[[Pandora - Create a Contact Recordset (HTML)|contact_list(flag,callbackfunc,fields,filter,html,order,start,end,cfidused)]]|| Enables creation of a contact recordset.
 +
|-
 +
|[[Pandora - Returns All Webforms Recordset|webform_list(flag/callbackfunc,actionname,formid,scoreid,filter,order)]]|| Enables return of all webforms recordset.
 +
|-
 +
|[[Pandora - Create an Organisation Recordset (HTML)|company_list(flag,callbackfunc,fields,filter,html,order,start,end,cfidused)]]|| Enables return of an organisation recordset.
 +
|-
 +
|[[Pandora - Create UTA Level 1 Recordset (HTML)|levelone_list(flag,callbackfunc,appid,fields,filter,html,order,start,end,cfidused)]]||Enables return of UTA Level 1 recordset.
 +
|-
 +
|[[Pandora - Create UTA Level 2 or 3 Recordset (HTML)|level23_list(flag,callbackfunc,appid,level,fields,filter,html,order,start,end,cfidused)]] ||Enables return of UTA Level 2 or 3 Recordset
 +
|}
 +
 
 +
 
 +
==='''Information Update Functions'''===
 +
 
 +
The following functions are used to update an existing record or create a new record.  These functions only work with a single record.
 +
 
 +
{| border="1" cellpadding="5"
 +
!Function
 +
!Description
 +
|-
 +
|[[Pandora - Update Contact (One Record)|contact_update(flag,callbackfunc,rset,loginfornew)]]||Enables update of single contact or creation of new user.
 +
|-
 +
|[[Pandora - Update User Setting|usersetting_update(flag,callbackfunc,userid,key,value)]]||Enables update of user system settings.
 +
|-
 +
|[[Pandora - Update Organisations (One Record)|company_update(flag,callbackfunc,rset)]]|| Enables update of single organisation or creation of new organisation.
 +
|-
 +
|[[Pandora - Update Category|category_update(flag,callbackfunc,recordset)]]||Enables update of a category list of a company or creation of a new category list.
 +
|-
 +
|[[Pandora - Update UTA Level 1 Entity (One Record)|levelone_update(flag,callbackfunc,appid,rset)]]||Enables update of single UTA level one entity or creation of new UTA level one entity.
 +
|-
 +
|[[Pandora - Update UTA Level 2 or 3 Entity (One Record)|level23_update(flag,callbackfunc,appid,level,rset)]]|| Enables update of single UTA level 2 or 3 entity or creation of new UTA level 2 or 3 entity.
 +
|-
 +
|[[Pandora - Update Parent of UTA Level 2 or 3 Entity|level23_parentupdate(flag,callbackfunc,appid,level,eventid,parentid)]]|| Enables update of parent id of UTA level 2 or 3 entities.
 +
|-
 +
|[[Pandora - Delete UTA Level 2 or 3 Entity (One Record)|level23_delete(flag,callbackfunc,appid,level,eventid)]]|| Deletes a single UTA level 2 or 3 entity
 +
|-
 +
|[[Pandora - Update UTA Invoice Items Entity|invoiceitem_update(flag,callbackfunc,appid,rset)]]|| Enables update of single invoice line items or creation of new invoice line items.
 +
|-
 +
|[[Pandora - Update UTA Invoice Entity|invoice_update(flag,callbackfunc,appid,rset)]]||Enables update of single invoice record or creation of new invoice record.
 +
|-
 +
|[[Pandora - Add a UTA Role (Company or Contact) and Associate Feature|utarole_add(flag,callbackfunc,parenttype,parentobject,childtype,childoject,roleid)]]|| Enables ability to associate an organisation or contact with a UTA level 1, 2 or 3 record.
 +
|-
 +
|[[Pandora - Remove a UTA Role (Company or Contact) and Associate Feature|utarole_remove(flag,callbackfunc,parenttype,parentobject,childtype,childoject,roleid)]]||Enables ability to remove an organisation or contact with a UTA level 1, 2 or 3 record.
 
|-
 
|-
|Company (All) ||Enables organisation search functions to retrieve all organisations.
+
|[[Pandora - Update UTA Role Custom Fields (Company or Contact) and Associate Feature|utarole_update(flag,callbackfunc,parenttype,objectid,objecttype,rset)]]||Update role/category based custom fields for an organisation or contact attached to a UTA record or for company/contact associations
 
|-
 
|-
|Company Below (Find,Update) || Enables organisation search functions to retrieve only organisations at the user’s hierarchical level and lower.
+
|[[Pandora - Locate a UTA Level 1 Skill|leveloneskills_update(flag,callbackfunc,objectid,rs)]] ||Enables access to Level 1 skills.
 
|-
 
|-
|Contact (All) ||Enables contact search functions can retrieve all contacts.
+
|[[Pandora - Update a System Variable|sysvar_update(flag,callbackfunction,varname,value)]] ||Update or create a system variable
 +
|}
 +
 
 +
==='''Messaging Functions'''===
 +
 
 +
The following function is used to trigger a message.
 +
 
 +
{| border="1" cellpadding="5"
 +
!Function
 +
!Description
 
|-
 
|-
|Contact Below (Find,Update) ||Enables contact search functions to retrieve contacts at the user’s hierarchical level and lower
+
|[[Pandora - Send a Message|send_msg(flag,callbackfunc,msgtype,format,fromadd,touserid,cc,subject,body)]] ||Enables sending a message (email or quick message).
 
|}
 
|}
  
==='''UTA Specific Functions'''===
+
==='''Utility Functions'''===
{| border="1"
+
 
 +
The following functions are used for specific purposes.
 +
 
 +
{| border="1" cellpadding="5"  
 
!Function
 
!Function
 
!Description
 
!Description
 
|-
 
|-
|[[Pandora - Locate a UTA Level 1 Entity|levelone_find(flag,callbackfunc,appid,fields,filter,order,start,end,prefix)]] ||Enables access to Level 1 items.
+
|[[Pandora - Format Date Function|format_date(d)]]|| Enables date formatting.
 +
|-
 +
|[[Pandora - Variables Replace|variables_replace(flag,callbackfunc,objecttype,objectid,content)]]|| Invokes the variable processor and returns formatted content.
 
|-
 
|-
|[[Pandora - Locate a UTA Level 2 Entity|level23_find(flag,callbackfunc,appid,level,fields,filter,order,start,end,prefix)]]||Enables access to Level 2 items.
+
|[[Pandora - Trigger a Workflow|trigger_workflow(objectid,wfid,objecttype)]]|| Triggers a workflow.
 
|-
 
|-
|UTA - Level Three Item (All) || Enables access to Level 3 items I UTAs.
+
|[[Pandora - Loading Variables|variables_replace(flag,callbackfunction,40,userid,variable)]]||Obtains [[System Variables]] or other values.
 +
|}
 +
 
 +
 
 +
==='''Transaction Functions'''===
 +
{| border="1" cellpadding="5"
 +
!Function
 +
!Description
 
|-
 
|-
|UTA - Invoices (All) ||Enables access to UTA invoices (invoice item and invoice line item).
+
|[[Pandora - Update or Create Transaction|trans_update(flag,callbackfunc,rset,linkobjectid,linktype)]]||Updates or creates transaction record.
 
|-
 
|-
|UTA - Level One Skills (Find,Update) ||Enables access to Level 1 skills.
+
|[[Pandora - Delete Transaction|trans_delete(flag,callbackfunc,transid)]]||Deletes a transaction record.
 
|-
 
|-
|UTA - Use Level One Item Security Matrix (All) ||Enforces UTA security for Level 1 items.
+
|[[Pandora - Find Transaction|trans_find(flag,callback,trstatusid,trltranslinkid,trlobjectid,fields,filter,order,start,end,prefix)]]||Finds a transaction record.
 
|-
 
|-
|UTA - Use Level Two Item Security Matrix (All) ||Enforces UTA security for Level 2 items.
+
|[[Pandora - Update or Create Transaction Intersection to Level 1 or Level 2|translink_add(flag,callbackfunc,translinkid,transid,objectid,linktype,recordset)]]||Updates intersection table between Transactions and Level 1 or Level 2 records.
 
|-
 
|-
|UTA - Use Level Three Item Security Matrix (All) ||Enforces UTA security for Level 3 items.
+
|[[Pandora - Remove Transaction Intersection to Level 1 or Level 2|translink_remove(flag,callbackfunc,translinkid,transid,objectid,linktype)]]||Removes the intersection between Transactions and Level 1 or Level 2 records.
 +
 
 
|}
 
|}
  
Line 59: Line 180:
 
The following guides are common to all function calls.
 
The following guides are common to all function calls.
  
Field Referencing
+
Referencing Fields
* Standard fields are referenced by name. ,’firstname,lastname’.
+
* Standard fields are referenced by name as''' 'firstname,lastname'.''' (see [[Database Field Names]])
* Custom fields by filename (recommended) or field ID.
+
* Custom fields should be referenced by field name as''' '$fieldname1$,$fieldname2$' '''(recommended)
* Fields specified = recordset fields.
+
* Custom fields can also be referenced by field ID as''' 'cf_123456' '''
* First field always ID.
+
* Fields specified will be the fields returned to the recordset.
* Standard fields when field list empty.
+
* When referencing the fields in the recordset, the first parameter is always the record index.
 +
* If the fieldlist parameter is empty the Standard fields will be returned.
  
 
[[Category:Pandora]]
 
[[Category:Pandora]]

Latest revision as of 20:12, 10 March 2015

Function Overview

Pandora functions are are divided into a number of types.

  • Session Level Functions – these functions are used to manage the session associated with the processing being performed.
  • Information Finding Functions – these functions are used to retrieve multi-record recordsets based on provided criteria.
  • List functions
  • Update Functions – these functions are used to create new entities within the system.
  • Utility functions – these functions provide additional general functionality to the API.

Session Level Functions

These functions are used to enable a valid session in which process can be performed and once created, determine user and related organisation attributes. Unless a function is established, no functionality is available.

Function Description
Session_Login (Find) Enables Login to the instance.
session_logout(flag,callbackfunc) Enables logout of the instance.
session_islogin(flag,callbackfunc) Retrieve active user information.
Session_getCurrentUser (Find) Retrieve the current user information.
Session_getCurrentCompany (Find) Retrieve the current user’s organisational information.


Information Finding Functions

These functions return record sets containing multiple records based on the filter passed to the functions. Each of these functions uses the following parameters:

  • Fields – the fields list to be retrieved and created in the recordset. Notes an ID field will be prefixed onto the user specified field list providing the unique identifier for each record.
  • Filter – the criteria by which fields should be retrieved.
  • Order – the field list to control the sort sequence of the records set.
  • Start – the starting record to be returned. The default is 0.
  • End – the end record to be returned. The default is 200.
  • Pref -
Function Description
company_find(flag,callbackfunc,fields,filter,order,start,end,prefix) Search function to retrieve organisations.
contact_find(flag,callbackfunc,fields,filter,order,start,end,prefix) search function to retrieve contacts.
levelonecontact_find(flag,callback,appid,opportunityid,fields,filter,order,start,end,prefix) Level 1 contact search.
levelonecompany_find(flag,callback,appid,opportunityid,fields,filter,order,start,end,prefix) Level 1 company search.
level23contact_find(flag,callbackfunc,appid,level,eventid,fields,filter,order,start,end,prefix,groupby) Level 2/3 contact search.
level23company_find(flag,callbackfunc,appid,level,eventid,fields,filter,order,start,end,prefix,groupby) Level 2/3 company search.
levelone_find(flag,callbackfunc,appid,fields,filter,order,start,end,prefix,specialfind,groupby) Level 1 item search.
level23_find(flag,callbackfunc,appid,level,fields,filter,order,start,end,prefix) Level 2 item search.
level23_find(flag,callbackfunc,appid,level,fields,filter,order,start,end,prefix) Level 3 item search.
invoice_find(flag,callbackfunc,appid,fields,filter,order,start,end,prefix) UTA invoice search.
invoiceitem_find(flag,callbackfunc,appid,invoiceid, fields,filter,order,start,end,prefix) Enables access to UTA invoice items.
leveloneskills_find(flag,callbackfunc,objectid) Enables return of a record set of skills for Level 1 items.
skills_find(flag,callbackfunc,skilltypeid) Enables return of a record set of skill categories for Level 1 items.

Recordset Retrieval Functions

Function Description
contact_list(flag,callbackfunc,fields,filter,html,order,start,end,cfidused) Enables creation of a contact recordset.
webform_list(flag/callbackfunc,actionname,formid,scoreid,filter,order) Enables return of all webforms recordset.
company_list(flag,callbackfunc,fields,filter,html,order,start,end,cfidused) Enables return of an organisation recordset.
levelone_list(flag,callbackfunc,appid,fields,filter,html,order,start,end,cfidused) Enables return of UTA Level 1 recordset.
level23_list(flag,callbackfunc,appid,level,fields,filter,html,order,start,end,cfidused) Enables return of UTA Level 2 or 3 Recordset


Information Update Functions

The following functions are used to update an existing record or create a new record. These functions only work with a single record.

Function Description
contact_update(flag,callbackfunc,rset,loginfornew) Enables update of single contact or creation of new user.
usersetting_update(flag,callbackfunc,userid,key,value) Enables update of user system settings.
company_update(flag,callbackfunc,rset) Enables update of single organisation or creation of new organisation.
category_update(flag,callbackfunc,recordset) Enables update of a category list of a company or creation of a new category list.
levelone_update(flag,callbackfunc,appid,rset) Enables update of single UTA level one entity or creation of new UTA level one entity.
level23_update(flag,callbackfunc,appid,level,rset) Enables update of single UTA level 2 or 3 entity or creation of new UTA level 2 or 3 entity.
level23_parentupdate(flag,callbackfunc,appid,level,eventid,parentid) Enables update of parent id of UTA level 2 or 3 entities.
level23_delete(flag,callbackfunc,appid,level,eventid) Deletes a single UTA level 2 or 3 entity
invoiceitem_update(flag,callbackfunc,appid,rset) Enables update of single invoice line items or creation of new invoice line items.
invoice_update(flag,callbackfunc,appid,rset) Enables update of single invoice record or creation of new invoice record.
utarole_add(flag,callbackfunc,parenttype,parentobject,childtype,childoject,roleid) Enables ability to associate an organisation or contact with a UTA level 1, 2 or 3 record.
utarole_remove(flag,callbackfunc,parenttype,parentobject,childtype,childoject,roleid) Enables ability to remove an organisation or contact with a UTA level 1, 2 or 3 record.
utarole_update(flag,callbackfunc,parenttype,objectid,objecttype,rset) Update role/category based custom fields for an organisation or contact attached to a UTA record or for company/contact associations
leveloneskills_update(flag,callbackfunc,objectid,rs) Enables access to Level 1 skills.
sysvar_update(flag,callbackfunction,varname,value) Update or create a system variable

Messaging Functions

The following function is used to trigger a message.

Function Description
send_msg(flag,callbackfunc,msgtype,format,fromadd,touserid,cc,subject,body) Enables sending a message (email or quick message).

Utility Functions

The following functions are used for specific purposes.

Function Description
format_date(d) Enables date formatting.
variables_replace(flag,callbackfunc,objecttype,objectid,content) Invokes the variable processor and returns formatted content.
trigger_workflow(objectid,wfid,objecttype) Triggers a workflow.
variables_replace(flag,callbackfunction,40,userid,variable) Obtains System Variables or other values.


Transaction Functions

Function Description
trans_update(flag,callbackfunc,rset,linkobjectid,linktype) Updates or creates transaction record.
trans_delete(flag,callbackfunc,transid) Deletes a transaction record.
trans_find(flag,callback,trstatusid,trltranslinkid,trlobjectid,fields,filter,order,start,end,prefix) Finds a transaction record.
translink_add(flag,callbackfunc,translinkid,transid,objectid,linktype,recordset) Updates intersection table between Transactions and Level 1 or Level 2 records.
translink_remove(flag,callbackfunc,translinkid,transid,objectid,linktype) Removes the intersection between Transactions and Level 1 or Level 2 records.

General Guidelines

The following guides are common to all function calls.

Referencing Fields

  • Standard fields are referenced by name as 'firstname,lastname'. (see Database Field Names)
  • Custom fields should be referenced by field name as '$fieldname1$,$fieldname2$' (recommended)
  • Custom fields can also be referenced by field ID as 'cf_123456'
  • Fields specified will be the fields returned to the recordset.
  • When referencing the fields in the recordset, the first parameter is always the record index.
  • If the fieldlist parameter is empty the Standard fields will be returned.