Creating a Script to Start a Task
You can use a browser script or a server script to start a task. Your script calls the Task UI Service business service. It then passes the name of the task to the LaunchTaskFromScript business service method to start the task. Processing varies depending on the type of script that you use as follows:
-
Browser script. Siebel CRM handles the InvokeMethod methods for a script on the client objects, and then passes them to their server equivalents.
-
Server script. Siebel CRM calls the server script in the context of the Object Manager at the required pre- or post-event.
In this situation, browser script or server script does not use the CanInvokeMethod method.
Siebel CRM does the following work at run time:
-
The Task UI Service examines the name of the task and makes sure the user possesses the license and responsibility to run the task. For more information, see Adding a Responsibility to a Task.
-
If Siebel CRM allows the user to run the task, then the service passes the pointer of the active business component to the Task UI framework, designating it as the context business component.
-
If any of the following situations exist, then an error is created:
-
The task requires a business component that is not the same as the context business component.
-
The task is not active in the current Workspace context.
-
-
If Siebel CRM does not encounter an error, then it runs the task and opens the task pane.
Note the following restrictions when using a script with a task:
-
Calling a task from a script requires UI context, meaning that Siebel CRM can reference a record in an applet. You must not configure Siebel CRM to start a task from a script that does not include UI context, such as a script for a Workflow Process, or from an event where the UI did not finish processing, such as the Applet_Load event.
-
A script can pass only the name of the task. It cannot pass any other parameters.
-
You can use a script only to start a task. You cannot use a script to interact with a task in any other way.
For more information, see About Event Handling.