Page 1 of 1

Alert Message When you save

Posted: Mon Jan 07, 2013 5:08 pm
by adamatio
Hello,
I need a little help to develop little alert when someone save new record because I want that user will be sure to clone the object before subscribe the new record.
I see that many user when add multiple record don't pay attention to clone the last record before start edit new one.
Someone can help me?
Many thanks
Regards
ANdrea

Re: Alert Message When you save

Posted: Tue Jan 08, 2013 2:20 am
by admin
Andrea,

Are you saying that noone can edit an old record, they can only edit a cloned record?

Steven

Re: Alert Message When you save

Posted: Fri Apr 05, 2013 4:00 pm
by adamatio
NO no,
problem was about clone procedure.
When user want to clone a record can happened that he don't clicl clone and so edit the old field,
I can show an alert when someone clic save with write "are you sure to have clone?".
Thanks for hlep

Re: Alert Message When you save

Posted: Sat Apr 06, 2013 7:44 pm
by massiws
Andrea,

you can use nuBeforeClone() function in Javascript tab to capture the clone event and do something; there could be more ways.

1st way (a simple workaround solution):
- create a text object on the form (better readonly) that informs users if that is a new/cloned record or a modified record:
textObject.png
textObject.png (25.15 KiB) Viewed 13827 times
- insert this SQL in Default value SQL object field

Code: Select all

SELECT 'This is a new record!'
text object on edit screen
text object on edit screen
editScreen.png (2.17 KiB) Viewed 13827 times
Text is displayed only when a new record is inserted or an existing record is cloned.

2nd way:
- insert this code in Javascript tab:

Code: Select all

function nuBeforeClone() {
    return confirm('Are you sure to clone this record?');
}
alert on clone procedure
alert on clone procedure
alert.png (8.28 KiB) Viewed 13827 times
so the user have to confirm the clone procedure before he start to modify something.

3th way.
If you want to be sure and alert on saving record you might (I never tryed this):
- create a text object as explained above (you may use also an hidden field);
- in nuBeforeSave() function check the value of the object and ask user to confirm.

Hope this helps,
Max

Re: Alert Message When you save

Posted: Sat Apr 06, 2013 8:50 pm
by mlgeek
Max, you're awesome. I learn a lot from how you participate on these forums and wanted to take a moment to say thank you.

Re: Alert Message When you save

Posted: Sun Apr 07, 2013 11:12 am
by massiws
mlgeek wrote:Max, you're awesome. I learn a lot from how you participate on these forums and wanted to take a moment to say thank you.
I learn a lot participating on these forums too! That's the community!
I'm glad to know this is appreciated,
thanks.

Re: Alert Message When you save

Posted: Mon Apr 08, 2013 2:44 am
by admin
.