Archive

Posts Tagged ‘Scriptlet’

Denote an Unsaved record in a Session – USD

We got a requirement to denote an unsaved record with * in a session.

Below is the scenario.

  • User opens an Account record in USD
  • USD opens a new Account Session
  • User clicks ‘Create Task’ link from Agent Script.
  • System should display * on ‘Task’ Tab until it gets Saved.
USD - Unsaved Task

USD – Unsaved Task

It’s very easy to achieve using ‘Scriptlet’.

Add a Scriptlet “SetTaskTitle” and set to the hosted control’s Display name (i.e., [[$Scriptlet.SetTaskTitle]] )

USD - Using Scriptlet To Set Display Name

In the “SetTaskTitle” Scriptlet

  • if Task.Subject == “”
    • Set DisplayName=”Task *”
  • Else
    • Set DisplayName=”Task.Subject”
USD - Scriptlet

USD – Scriptlet

Script Text:

function SetTaskTitle() {
if (“[[task.subject]+]” != “”) {
return “[[task.subject]+]”;
}
else
return “Task *”;
}
SetTaskTitle();

Once the Task gets Saved, Tab name changes to ‘Task.Subject’

USD - Saved Task

USD – Saved Task

🙂

Categories: USD Tags: , ,