+ Start a Discussion
Ramon PereiraRamon Pereira 

Best way to make an outside call long time.

It is a good practice I make a SOAP call to an external service salesforce using a custom button (js)?

Many customers need to send sales order to ERP, in a standard page insert a custom button (js) that calls my apex method that performs the call to the ERP, however this time the screen is frozen to the user aguarando the ERP response. What would be the best way to make this call?
Rajiv Bhatt 16Rajiv Bhatt 16
is your webservice called in future method?
NagaNaga (Salesforce Developers) 
Hi Ra_br,

As per your question I understand that you are using the SOAP call to to an ERP to sync the sales order from salesforce to the ERP.
Now you are having issues with the screen being stuck for one user "Aguarando".I would like to let you know that the correct process is being followed by you.Does it only happen for this single user or is it a random issue?

Please let me know more and I will do my best to help you here.

Best Regards
Naga kiran
Ramon PereiraRamon Pereira
Hi name,

Thanks for the feedback.

I'm using the functions of connection.js script. I have an Apex class that consumes a WS my ERP. However our ERP takes too long to answer the request, around 45 seconds and this time the Sales Force screen is locked because the DOM this stuck waiting to answer the call made by connection.js.

I conducted some research and tried to use web works, however it does not have access to the DOM and the connection.js need.

Read this article http://www.ibm.com/developerworks/library/ws-wsajax/ and found interesting soap send packets directly from the client, without sending any information to the server. I wonder if this approach is used by other developers SalesForce.