[Vtigercrm-developers] Vtiger_Edit_Js.recordPreSave event

Estefan Civera estefan.civera at gmail.com
Tue Dec 29 13:45:12 GMT 2015


Hi all,

In the invoice module I need to show a message confirmation before save
invoice.
I've add a new recordpresave event to give me the confirmation of saving
invoice, but when I press Yes and I submit form seems that this submit
invoke yet recordPreSave and I see another time the confirmation message and
so on.

why this behaviour? I've wrote the code starting  from recordpresave 
Account!


Inventory_Edit_Js("Invoice_Edit_Js",{},{
    
        registerRecordPreSaveEvent : function(form) {
            
            
		var thisInstance = this;
		if(typeof form == 'undefined') {
			form = this.getForm();
		}
		
		form.on(Vtiger_Edit_Js.recordPreSave, function(e, data) {                

                    var message =
app.vtranslate('JS_EDIT_DEADLINES_CONFIRMATION');
                    Vtiger_Helper_Js.showConfirmationBox({'message' :
message}).then(
                            function(e) {
                                   
//thisInstance.duplicateCheckCache[accountName] = false;
                                    form.submit();
                            },
                            function(error, err) {

                            }
                    );
                    e.preventDefault();
		});
	},

registerEvents: function(){
		.....
                this.registerRecordPreSaveEvent();

	}
	



-----
Ing. Estefan Civera
Vtiger developer and consultant
http://www.estefancivera.net
Italy
--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Vtiger-Edit-Js-recordPreSave-event-tp18045.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.


More information about the vtigercrm-developers mailing list