Method to execute after the Profile page is saved

18 views
Skip to first unread message

Syed Qadeer

unread,
Mar 20, 2014, 2:52:51 AM3/20/14
to erpnext-dev...@googlegroups.com
hello all,

i wanted to know which javascript method should i call after i save the PROFILE in ERPNEXT.

Thanks and Regards

Maxwell Morais

unread,
Mar 20, 2014, 2:57:22 AM3/20/14
to erpnext-dev...@googlegroups.com
Hello, Syed!

You can say what you trying to do? Your question is somewhat generic.



--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/44e9a440-ca05-4774-bdbd-59ad885b9845%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3

Syed Qadeer

unread,
Mar 20, 2014, 4:27:24 AM3/20/14
to erpnext-dev...@googlegroups.com
when i save the profile, i want to reload the page , thats all i want to do .. so i was looking for a javascript function in the profile.js called " Save" but i couldnt find any .. so that when the profile form is saved

i can refresh the page.. or maybe i can redirect the user ...

Maxwell Morais

unread,
Mar 20, 2014, 4:37:43 AM3/20/14
to erpnext-dev...@googlegroups.com

It is the method

https://github.com/webnotes/wnframework/blob/develop/public/js/legacy/form.js#L633

Mas ele não faz parte do ScriptManager, você provavelmente vai ter que controlar manualmente a reescrita deste método, salvando o método original em uma variável e garantindo que ele seja executado posteriormente:

__save = cur_frm.save

cur_frm.save = function(save_action, callback, btn, on_error){
  __save(save_action, callback, btn, on_error);
  // You custom code
}


--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Maxwell Morais

unread,
Mar 20, 2014, 4:40:36 AM3/20/14
to erpnext-dev...@googlegroups.com

Sorry, for the response in portuguese

“But it is not part of the ScriptManager, you’ll probably have to manually control the rewriting of this method, saving the original method in a variable and ensuring it runs later: “

Syed Qadeer

unread,
Mar 20, 2014, 4:47:17 AM3/20/14
to erpnext-dev...@googlegroups.com
is there any possible way, that we can know that a specific field is changed or not ??
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.



--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3

Maxwell Morais

unread,
Mar 20, 2014, 4:57:04 AM3/20/14
to erpnext-dev...@googlegroups.com

If you are using version 3x this requires a hack, but it is possible, it seems that the version 4x there is already a version control log.

Look

https://github.com/webnotes/wnframework/blob/develop/public/js/wn/model/model.js#L198

With on method you can create a observer for the field

​ and emit a message when it is changed on client side​



To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/c4712656-44ca-4063-91d9-655adc5ceda3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages