Skip to main content
15-Moonstone
September 11, 2017
Solved

Create a Message Box from a Script.

  • September 11, 2017
  • 1 reply
  • 4826 views

Hello,

I like to create a message box from a rule-based event.

Trying to use command "window.alert" I always get error 'not defined'.

Using lookupbean I fail cause I find a message only for package siEnvironmentBean, which does work for IM.

 

Does anyone have an idea that works?

My script example:

function abort(s)
{
    eb.abortScript(s, true);
}
var eb = bsf.lookupBean("siEnvironmentBean");
main()
{
abort("Attention!  \You copied Content.  \Please check whether copied content is still correct!");
};

 

Happy for all hints,

Klaus

Best answer by LLawton

Hello Klaus,

Sorry, but you just cannot ask the user anything, especially "are you sure..." in a pop up message.

If you consider the underlined words in: "The only way to display a pop up message is via a trigger that aborts the transaction after the user pressed the OK/Apply buttons.", you realize that once you get to that point, all changes are lost, so informing the user will not help.

The only way I get close to that is by using labels or fields that I make relevant based on what the user enters.

It's very primitive but it does the job in some limited cases.

In this example, the text in red appears when the user selects a value in another field:

PromptUser.png

We have asked PTC many times over the years for such a feature but I don't think it will happen until they redesign the UI and we keep asking.

1 reply

17-Peridot
September 29, 2017

Hello Klaus,

you like to show in the Integrity Client a popup message when a server trigger ended, to provide the user some more information?

Is this what you want?

Volker

khoppe15-MoonstoneAuthor
15-Moonstone
September 29, 2017

My intention is to create a popup message to the user which is thrown following a rule-based Trigger.
One example:  User copies an item from another. The popup shall be "Dear User. Please check field "xyz" whether the list of content that you copied there is still valid."

The popup shall in this case only be an interruption before final saving of the item.

The activity comes from user's client and is no server-related process (which would not know the user's client).

 

Klaus

16-Pearl
October 26, 2017

"An interruption before final saving of the item" : This cannot be done with triggers (or any other way in fact).

The only way to display a pop up message is via a trigger that aborts the transaction after the user pressed the OK/Apply buttons. Then the changes are lost and you cannot go back.

In other words, you cannot output a message after some validation that says "please make a correction" and lets you go back to your edit in progress.

This is one big headache in Integrity with no easy workaround.

The way I deal with minimal validations is via constraints, but it's not easy or comprehensive.