cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Create a Message Box from a Script.

khoppe
14-Alexandrite

Create a Message Box from a Script.

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

1 ACCEPTED SOLUTION

Accepted Solutions
LLawton
14-Alexandrite
(To:khoppe)

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.

View solution in original post

6 REPLIES 6

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

khoppe
14-Alexandrite
(To:VolkerEckardt)

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

LLawton
14-Alexandrite
(To:khoppe)

"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.

khoppe
14-Alexandrite
(To:LLawton)

Hello,

thanks for your comment.

In the end I don't want to force the user to go back and correct, cause this would require that I already know what content would be correct. My intention is to tell the user: "Please check whether every content you use is correct, cause with copying the content from another item while creating your item you might have overtaken data that are not valid."

With this message I only like to take user's attention onto a certain field (in my case a relationship field) which he shall have a second look. Nevertheless it is his decision and he can leave that item stored without any check or change.

In other words:  I like to be like Microsoft asking the user "Do you really like to do this ... "

 

Kind regards

Klaus


LLawton
14-Alexandrite
(To:khoppe)

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.

khoppe
14-Alexandrite
(To:LLawton)

Thanks for posting out that point.

Thus I'm forced to create an idea ...   <sigh>  (see https://community.ptc.com/t5/Integrity-Ideas/Extend-EnvironmentBean-to-allow-Creation-of-a-PopupMessage/idi-p/491433#M996)

Sometimes life could be more easy ...

 

Best Regards,

Klaus

Top Tags