PromptAndExecuteAction
4 min
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" docid\ u26v9fecfs6ilwa0 pvjd 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 parameter description objectref a reference to the business object instance to which the two quick actions apply 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 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 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'))
