Service Manager

Home 

PromptAndExecuteAction

Asks a yes/no question and executes a quick action depending on the answer.

Syntax

PromptAndExecuteAction(objectRef, prompt, yesAction, noAction)

Enabled For

For a description of the business object categories, see Notes on "Enabled For".

Business Object Category Yes/No
Business Rules: Before-Save Rules No
Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load) Yes
Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load) Yes1
Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load) Yes
Business Rules: Editing Rules Yes2
Business Rules: Initialization Rules Yes1
Business Rules: Read Only Rules No
Business Rules: Required Rules No
Business Rules: Validation Rules No
Client Expressions No
Object Permissions No
Services Yes
LDAP Yes
Mobile Yes
Quick Actions (except UI Quick Actions) Yes1
UI Quick Actions No
Reports Yes1
Search/Dashboard without field references Yes1
Search/Dashboard with field references No
1. Except in services.
2. Except in services and when this field appears on a form or is triggered by such a field.

Parameters

objectRef

A reference to the business object instance to which the two quick actions apply.

NOTE: This built-in function will be deprecated in a future release because of the unusual way in which it handles this first parameter.

 

This parameter behaves differently than any other function parameter. It looks like an expression, but it is not. This built-in function is the only one that uses this syntax.

 

The value for this parameter must always be inside quotes. This parameter is a string in this form: '$(Parent(RelationshipReference)' where the relationship reference is of the form BusinessObjectName#.InternalReferenceName. However, the function ignores the InternalReferenceName value and only looks for the parent of the BusinessObjectName#.

prompt The text of the prompt. This should be a question that can be answered yes or no.
yesAction

The name of the quick action to execute if the answer is yes.

 

NOTE: If more than one quick action with this name exists tenant-wide, the function call fails.

noAction

The name of the quick action to execute if the answer is no.

NOTE: If more than one quick action with this name exists tenant-wide, the function call fails.

Return Value

Boolean value. Returns true or false if there is no such business object.

Example

$(PromptAndExecuteAction( '$(Parent(Incident#.Rev3))', 'Task belongs to an incident with no other unfinished tasks. Select [Yes] to set incident to resolved, select [No] to create a new task, or select [Cancel] to cancel the task and save the operation.', 'Resolve Incident', 'New TaskAssignment'))


Was this article useful?