Difference between revisions of "Pandora - Add a UTA Role (Company or Contact) and Associate Feature"

From SmartWiki
Jump to: navigation, search
m
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function is used to associate a single organisation or contact with a UTA level 1, 2, or 3 record.  This function is also used to associate a contact with an organisation record through the Associate/Association feature and to create Consumer/Provider relationships
+
This function is used to associate a single organisation, contact or Provider with a UTA level 1, 2, or 3 record.  This function is also used to associate a contact with an organisation record through the Associate/Association feature, create a parent-child relationships between 2 companies  and to create Consumer/Provider relationships
  
  utarole_add(flag,callbackfunc,parenttype,parentobject,childtype,childoject,roleid)
+
  utarole_add(flag,callbackfunc,parenttype,parentobject,childtype,childobject,roleid,rset)
  
 
{| border="1"
 
{| border="1"
Line 15: Line 15:
 
|'''Callbackfunc''' || User created JavaScript function to manage the callback from an asynchronous function.
 
|'''Callbackfunc''' || User created JavaScript function to manage the callback from an asynchronous function.
 
|-
 
|-
|'''parenttype'''||Type of object to attach a child object (use 23 for Level 1, 26 for Level 2)
+
|'''parenttype'''||Type of object to attach a child object (23 is  Level 1; 26 is Level 2; 30 is company; 40 is user)
 
|-
 
|-
 
|'''parentobject'''|| The ID of the parent object
 
|'''parentobject'''|| The ID of the parent object
 
|-
 
|-
|'''childtype'''||Type of child object to be attached to the parent object (30: company, 40: user)
+
|'''childtype'''||Type of child object to be attached to the parent object (23 is  Level 1; 26 is Level 2; 30 is company; 40 is user)
 
|-
 
|-
 
|'''childobject'''||The ID of the child object
 
|'''childobject'''||The ID of the child object
Line 41: Line 41:
 
       ss_developer_key="@system.ss_developer_key@";
 
       ss_developer_key="@system.ss_developer_key@";
 
   if (roleid==10901){
 
   if (roleid==10901){
      successMSG="Research Officer has been added to the application";
 
 
       var lineItemSelectRO= document.getElementById("RoID");
 
       var lineItemSelectRO= document.getElementById("RoID");
 
       var lineItemId= lineItemSelectRO.options[lineItemSelectRO.selectedIndex].value;
 
       var lineItemId= lineItemSelectRO.options[lineItemSelectRO.selectedIndex].value;
Line 50: Line 49:
 
     }
 
     }
 
       utarole_add(false ,"","23","@opportunityid@","40",lineItemId,roleid);
 
       utarole_add(false ,"","23","@opportunityid@","40",lineItemId,roleid);
       alert(successMSG);
+
       alert("Research Officer has been added to the application");
      $("#savedraftbutton").click()
 
 
   }
 
   }
 
   <input class=ButtonSm type="Button" onclick="addOfficer(10901)" value="Add RO" />
 
   <input class=ButtonSm type="Button" onclick="addOfficer(10901)" value="Add RO" />
Line 66: Line 64:
 
Level 2 Provider to Level 1 Consumer
 
Level 2 Provider to Level 1 Consumer
 
  utarole_add(false,"",26,PROVIDER_EVENTID,23,CONSUMER_OPPORTUNTYID,ROLEID,rset);
 
  utarole_add(false,"",26,PROVIDER_EVENTID,23,CONSUMER_OPPORTUNTYID,ROLEID,rset);
 +
 +
 +
===Companies===
 +
 +
Company Relationships are used to link one company in a hierarchical structure(i.e. parent and child relationship). In the syntax below the parent object is first company, while the child object is the second company. 
 +
utarole_add(false,"",30,COMPANYID,30,COMPANYID,,rset);
 +
 +
Company [[Association_Settings|Associations]] are used to link a company to a contact. In the syntax below the parent object is first company, while the child object is the user. 
 +
utarole_add(false,"",30,COMPANYID,40,USERID,ROLEID,rset);
 +
  
 
==See Also==
 
==See Also==

Latest revision as of 15:16, 27 January 2015

This function is used to associate a single organisation, contact or Provider with a UTA level 1, 2, or 3 record. This function is also used to associate a contact with an organisation record through the Associate/Association feature, create a parent-child relationships between 2 companies and to create Consumer/Provider relationships

utarole_add(flag,callbackfunc,parenttype,parentobject,childtype,childobject,roleid,rset)
Parameter Description
Flag Asynchronous processing Flag

Set to False for synchronous processing.

Set to True for asynchronous processing.

Callbackfunc User created JavaScript function to manage the callback from an asynchronous function.
parenttype Type of object to attach a child object (23 is Level 1; 26 is Level 2; 30 is company; 40 is user)
parentobject The ID of the parent object
childtype Type of child object to be attached to the parent object (23 is Level 1; 26 is Level 2; 30 is company; 40 is user)
childobject The ID of the child object
Returns

Notes

Associate a company or a contact with a Level 1

Parent type could be level 1, 2 or 3 or company (for the associate)

Parentobject = ID of Level 1, 2 or 3 or company ID

RoleID = Role

Example (Add a contact to Level 1)

 function addOfficer(roleid){
      ss_developer_key="@system.ss_developer_key@";
  if (roleid==10901){
      var lineItemSelectRO= document.getElementById("RoID");
      var lineItemId= lineItemSelectRO.options[lineItemSelectRO.selectedIndex].value;
      if(lineItemId=="0"){
        alert("Please select a research officer.");
        return;
     }
   }
      utarole_add(false ,"","23","@opportunityid@","40",lineItemId,roleid);
      alert("Research Officer has been added to the application");
 }
 <input class=ButtonSm type="Button" onclick="addOfficer(10901)" value="Add RO" />

Consumer/Provider

  • To determine the ROLEID for Consumer/Provider relationships go to the UTA Connection Roles setting within the UTA, right-click or hover over the hyperlink for the relevant role. The ROLEID is the parameter listed as statusid in the URL.

Level 1 Provider to Level 1 Consumer:

utarole_add(false,"",23,PROVIDER_OPPORTUNTYID,23,CONSUMER_OPPORTUNTYID,ROLEID,rset);

Level 1 Provider to Level 2 Consumer:

utarole_add(false,"",23,PROVIDER_OPPORTUNTYID,26,CONSUMER_EVENTID,ROLEID,rset);

Level 2 Provider to Level 1 Consumer

utarole_add(false,"",26,PROVIDER_EVENTID,23,CONSUMER_OPPORTUNTYID,ROLEID,rset);


Companies

Company Relationships are used to link one company in a hierarchical structure(i.e. parent and child relationship). In the syntax below the parent object is first company, while the child object is the second company.

utarole_add(false,"",30,COMPANYID,30,COMPANYID,,rset);

Company Associations are used to link a company to a contact. In the syntax below the parent object is first company, while the child object is the user.

utarole_add(false,"",30,COMPANYID,40,USERID,ROLEID,rset);


See Also