Display Alert message from Editable Grid View

I have some code that runs in the onBeforeUpdate event.

If I have an error, then I can simply put:

	
sc_error_message($error_message);
sc_error_exit();

The message is displayed and the update canceled.

Sometimes I just want to display a warning message, and continue with the update.
sc_alert($warn_message); works if I have an Editable Grid, but it does NOT work if I have an Editable Grid View.

I cannot use just sc_error_message($error_message); because even without the sc_error_exit(); the transaction is eventually canceled and the update does not occur.

Any suggestions on how to accomplish this?

Thanks.

have you tried a simple echo $message; ?

Nina, Thank you for the suggestion. I tried that and it did not work either. When I monitor the return from the update request, I can see the messages in the information that is returned. But it is never displayed to the user. I suspect that either it is not being looked for, or the iframe is closed too quickly.

It’s a ‘real’ work-around because it will require you to do it without popups. Create a variable on the screen wherever you want it named {errm} Set font specs to bold and red (i.e.). Clear this field in oninit, and set it on error. Since it will be in your header/footer I think you need to make the variable global and set it as default value.

Albert,

Editable Grid View does the update via and iframe and ajax, so the page does not get refreshed. Putting it in the header won’t work. But thanks for the idea. I suppose that I could put a custom field on each row, and set it when I do the update… Seems a shame to go through all that work coding it when I can see the message get passed back from the application. Scriptcase just ignores it… :frowning: