Difference between revisions of "Use a Button to Create a Level 2"

From SmartWiki
Jump to: navigation, search
(Created page with '{{ROSV}}')
 
Line 1: Line 1:
{{ROSV}}
+
[[System Administrator]]s can create a button that will allow users to create {{l2}} records on the fly.
 +
 
 +
Steps:
 +
* On the {{l1}}, create a custom field of type {{ROSV}}
 +
* In the ''Variables'' section, enter the following:
 +
<pre style="white-space: pre-wrap;
 +
white-space: -moz-pre-wrap;
 +
white-space: -pre-wrap;
 +
white-space: -o-pre-wrap;
 +
word-wrap: break-word;"><script language=javascript>
 +
function createNewLevel2(){
 +
location.href="/Apps/app_editevent.jsp?appid=1234567&nextlevel=1&companyid=@companyid@&objectid=@opportunityid@&eventid=0";
 +
}
 +
</script>
 +
<input type="button" class=Button value="Button Label" onClick="createNewLevel2()">
 +
</pre>
 +
 
 +
'''where''':
 +
* ''appid'' = the [[application ID]] of the {{UTA}} in which the {{l2}} should be created
 +
* ''Button Label'' should be the text that should show on the button (e.g., "Create New Activity")
 +
* the other fields should be left exactly as shown:
 +
:*''companyid=@companyid@'' will associate the organization associated with the {{l1}} record on which the button was pressed with the new {{l2}} record
 +
:*''objectid=@opportunityid@'' will link the new {{l2}} record to the {{l1}} record on which the button was pressed
 +
:*''eventid=0'' will create a new, blank {{l2}} record
 +
 
 +
This {{ROSV}} field can then be referenced in a [[list view]]:
 +
 
 +
[[Image:CreateNewActivityButtonOnListView.png|link=|600px]]
 +
 
 +
...on reports...
 +
 
 +
[[Image:CreateNewActivityButtonOnReport.png|link=|600px]]
 +
 
 +
...or on the {{l1}} record itself:
 +
 
 +
[[Image:CreateNewActivityButtonOnRecord.png|link=|600px]]
 +
 
 +
 
 +
 
 +
[[Category:JavaScript]]

Revision as of 16:27, 15 November 2013

System Administrators can create a button that will allow users to create Level 2 records on the fly.

Steps:

<script language=javascript>
function createNewLevel2(){
location.href="/Apps/app_editevent.jsp?appid=1234567&nextlevel=1&companyid=@companyid@&objectid=@opportunityid@&eventid=0";
}
</script>
<input type="button" class=Button value="Button Label" onClick="createNewLevel2()">

where:

  • appid = the application ID of the in which the Level 2 should be created
  • Button Label should be the text that should show on the button (e.g., "Create New Activity")
  • the other fields should be left exactly as shown:
  • companyid=@companyid@ will associate the organization associated with the Level 1 record on which the button was pressed with the new Level 2 record
  • objectid=@opportunityid@ will link the new Level 2 record to the Level 1 record on which the button was pressed
  • eventid=0 will create a new, blank Level 2 record

This Read Only – System Variables field can then be referenced in a list view:

CreateNewActivityButtonOnListView.png

...on reports...

CreateNewActivityButtonOnReport.png

...or on the Level 1 record itself:

CreateNewActivityButtonOnRecord.png