on 04-07-2010 8:49 AM
Is it possible to return a message from a user script that is not interpreted as an error?
What I want to do is to check a few things when a project is saved and show a warning if something is not quite right.
Throwing an exception shows the message but also aborts the saving of the project. That's fine for real errors but if I just wnat to hint to the user that something he entered is not plausible that behaviour is bad.
I already tried different targets but even "saved" is called before actually saving the changes.
Is there another way of passing messages to the user besides throwing exceptions? Or is there another target I could use?
Hi
Yes there is another way to show warning messages.
You have to look for these messages in logs.
For displaying warning messages try these lines in your script.
logMsg = Logger.createLogMessage(session);
logMsg.setLogMessage("Your Message" );
Logger.warning(logMsg);
Cheers !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think it is possible to throw warning messages. I have check the IAPI a throusand times to find something but without any luck. What you can try to do is to create an extension at the top of the page and write a message into it. Via basic HTML codes you can even change the color of the text to make it more flashy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.