Alert Message When you save

Alert Message When you save

Postby adamatio » Tue Jan 08, 2013 1:38 am

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
adamatio
 
Posts: 4
Joined: Fri Dec 28, 2012 12:20 am

Re: Alert Message When you save

Postby admin » Tue Jan 08, 2013 10:50 am

Andrea,

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

Steven
admin
Site Admin
 
Posts: 3153
Joined: Mon Jun 15, 2009 9:53 am

Re: Alert Message When you save

Postby adamatio » Fri Apr 05, 2013 11:30 pm

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
adamatio
 
Posts: 4
Joined: Fri Dec 28, 2012 12:20 am

Re: Alert Message When you save

Postby massiws » Sun Apr 07, 2013 3:14 am

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 8228 times

- insert this SQL in Default value SQL object field
Code: Select all
SELECT 'This is a new record!'

editScreen.png
text object on edit screen
editScreen.png (2.17 KiB) Viewed 8228 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.png
alert on clone procedure
alert.png (8.28 KiB) Viewed 8228 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
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

Re: Alert Message When you save

Postby mlgeek » Sun Apr 07, 2013 4:20 am

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.
mlgeek
 
Posts: 23
Joined: Wed May 09, 2012 3:54 am

Re: Alert Message When you save

Postby massiws » Sun Apr 07, 2013 6:42 pm

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.
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

Re: Alert Message When you save

Postby admin » Mon Apr 08, 2013 10:14 am

.
admin
Site Admin
 
Posts: 3153
Joined: Mon Jun 15, 2009 9:53 am


Return to Custom Code