Skip to Content

Button calling function import works in chrome but not in internet explorer

Hello,

I have created a button to call function import which basically sends an email to the selected recipient. I'm seeing a different behavior in IE compared to chrome.

When I click the send button multiple times the email is sent multiple times in chrome. When I do the same in IE the email is sent only once i.e. the first time.

I have placed a break point in the back end system and noticed that the calls are not happening in case of IE. The calls are made every time I click the button using chrome.

I have debugged this in both browsers and the function import returns an OK response in both cases.

Has anyone faced this issue before.

Thank You,

Kabir

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 08 at 05:29 PM

    ie is caching the ajax call.

    change method to post, you should be good.

    Add comment
    10|10000 characters needed characters exceeded

  • May 08 at 05:19 PM

    Hello Gregor,

    Thanks for your response. Here is the code:

    sap.ui.controller("cus.crm.mycalendar.CRM_MYCALExtension.view.AppointmentDetailCustom", {
    	onEmail: function(e) {
    		debugger;
    		var oModel = e.getSource().getModel();
    		var guid = this.getView().getBindingContext().getObject().Guid;
    		var emailPartners = this.getView().getBindingContext().getObject().EmailPartners;
    		if (emailPartners === "") {
    			sap.m.MessageToast.show("Please maintain an email");
    		} else {
    			oModel.callFunction("Email", // function import name
    				"GET", // http method
    				{
    					Guid: guid
    				},
    				null,
    				function(oData, response) {
    					sap.m.MessageToast.show("Email has been sent");
    				}, // callback function for success
    				function(oError) {
    					sap.m.MessageToast.show("Email could not be sent");
    				}); // callback function for error
    		} // endif
    	}
    });
    

    Thank You,

    Kabir

    Add comment
    10|10000 characters needed characters exceeded