Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Alert Message When you save

Locked
adamatio
Posts: 4
Joined: Thu Dec 27, 2012 3:50 pm

Alert Message When you save

Unread post 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
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Alert Message When you save

Unread post by admin »

Andrea,

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

Steven
adamatio
Posts: 4
Joined: Thu Dec 27, 2012 3:50 pm

Re: Alert Message When you save

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Alert Message When you save

Unread post 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 13677 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 13677 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 13677 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
mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Re: Alert Message When you save

Unread post 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.
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Alert Message When you save

Unread post 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.
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Alert Message When you save

Unread post by admin »

.
Locked