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

From SmartWiki
Jump to: navigation, search
(Created page with 'System Administrators can create a button that will allow users to create {{l1}} records on the fly. Steps: * Create a custom field of type {{ROSV}} * In the ''Variables'' …')
 
m (Additional example added)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{JavaScript Syntax}}
 
[[System Administrator]]s can create a button that will allow users to create {{l1}} records on the fly.  
 
[[System Administrator]]s can create a button that will allow users to create {{l1}} records on the fly.  
  
Line 14: Line 15:
 
</script>
 
</script>
 
<input type="button" class=Button value="Button Label" onClick="createNewLevel1()">
 
<input type="button" class=Button value="Button Label" onClick="createNewLevel1()">
 +
</pre>
 +
'''Note:'''
 +
If you are using variables within your link you must place the script within the onclick otherwise it will not parse the variables correctly in a list view.
 +
<pre style="white-space: pre-wrap;
 +
white-space: -moz-pre-wrap;
 +
white-space: -pre-wrap;
 +
white-space: -o-pre-wrap;
 +
word-wrap: break-word;">
 +
<input type="button" class=Button value="Button Label" onClick="location.href='/Apps/app_editopportunity.jsp?appid=12345&nextlevel=1&opportunityid=0&defaultstatusid=52525&opportunitytypeid=121212&defaultownerid=@userid@'">
 
</pre>
 
</pre>
  
 
'''where''':
 
'''where''':
 
* ''appid'' = the [[application ID]] of the {{UTA}} in which the {{l1}} should be created
 
* ''appid'' = the [[application ID]] of the {{UTA}} in which the {{l1}} should be created
* ''defaultstatusid'' = the [[status ID]] to which the new record should be set
+
* ''defaultstatusid'' = the [[Determining the statusid|status ID]] to which the new record should be set. If this parameter is omitted the default status will be used.
* ''opportunitytypeid'' = the [[Determining the typeid|Template ID]] with which the new record should be associated
+
* ''opportunitytypeid'' = the [[Determining the typeid|Template ID]] with which the new record should be associated. If this parameter is omitted the default template will be used
* ''Button Label'' should be the text that should show on the button (e.g., "Create New Activity")
+
* ''Button Label'' should be the text that should show on the button (e.g., "Create New Grant")
* the other fields should be left exactly as shown:
+
* the other parameters should be left exactly as shown:
 
:*''opportunityid=0'' will create a new, blank {{l1}} record
 
:*''opportunityid=0'' will create a new, blank {{l1}} record
 +
* other parameters that can be used include ''defaultownerid'' which will set the [[owner]] of the new record to the [[contact]] with a matching [[userid]]. (See [[Pass Variables To Level 1]].)
  
 
This {{ROSV}} field can then be referenced in a [[list view]]:
 
This {{ROSV}} field can then be referenced in a [[list view]]:
  
[[Image:CreateNewActivityButtonOnListView.png|link=|600px]]
+
[[Image:CreateNewL1ButtonOnListView.png|link=|600px]]
  
 
...on reports...
 
...on reports...
  
[[Image:CreateNewActivityButtonOnReport.png|link=|600px]]
+
[[Image:CreateNewL1ButtonOnReport.png|link=|600px]]
  
 
...or on another {{l1}} record:
 
...or on another {{l1}} record:
  
[[Image:CreateNewActivityButtonOnRecord.png|link=|600px]]
+
[[Image:CreateNewL1ButtonOnRecord.png|link=|600px]]
  
 
==See Also==
 
==See Also==
 
* [[Adding a Button that Runs a JavaScript]]
 
* [[Adding a Button that Runs a JavaScript]]
 
* [[Use a Button to Create a Level 2]]
 
* [[Use a Button to Create a Level 2]]
 +
* [[Pass Variables To Level 1]]
  
 
[[Category:JavaScript]]
 
[[Category:JavaScript]]

Latest revision as of 15:37, 22 May 2015

This feature uses JavaScript syntax
Text code javascript.gif

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

Steps:

<script language=javascript>
function createNewLevel1(){
location.href="/Apps/app_editopportunity.jsp?appid=12345&nextlevel=1&opportunityid=0&defaultstatusid=52525&opportunitytypeid=121212";
}
</script>
<input type="button" class=Button value="Button Label" onClick="createNewLevel1()">

Note: If you are using variables within your link you must place the script within the onclick otherwise it will not parse the variables correctly in a list view.

<input type="button" class=Button value="Button Label" onClick="location.href='/Apps/app_editopportunity.jsp?appid=12345&nextlevel=1&opportunityid=0&defaultstatusid=52525&opportunitytypeid=121212&defaultownerid=@userid@'">

where:

  • appid = the application ID of the in which the Level 1 should be created
  • defaultstatusid = the status ID to which the new record should be set. If this parameter is omitted the default status will be used.
  • opportunitytypeid = the Template ID with which the new record should be associated. If this parameter is omitted the default template will be used
  • Button Label should be the text that should show on the button (e.g., "Create New Grant")
  • the other parameters should be left exactly as shown:
  • opportunityid=0 will create a new, blank Level 1 record

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

CreateNewL1ButtonOnListView.png

...on reports...

CreateNewL1ButtonOnReport.png

...or on another Level 1 record:

CreateNewL1ButtonOnRecord.png

See Also