function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
inbaljS2inbaljS2 

oncomplete attribute is not working

Hi All, 

I am trying to invoke a callout to an external company using httpRequest and response. 

 

after researching the community I have found that the oncomplete attribute should be used. 

 

so i have split my 'submit' function to 2: submit which called on the action attribute and to 'calloutRequest' that invoke the callout and called on the oncomplete attribute.

 

the 'calloutRequest' function is never invokes...

any suggestions?

Thanks, 

Inbal

 

Best Answer chosen by Admin (Salesforce Developers) 
inbaljS2inbaljS2

Hi Wes,

 

You are correct I have managed to figure it out few hours after posting this issue. 

I needed to create it as an <apex:actionFunction> and the action in there called my controller method. 

 

Thank you for your help, 

Inbal

All Answers

WesNolte__cWesNolte__c

Hey

 

Please post your code. As a tip the "action" method will typically call Apex code and the "oncomplete" should reference a JavaScript function (including actionFunction).

 

Wes

inbaljS2inbaljS2

Hi Wes,

 

You are correct I have managed to figure it out few hours after posting this issue. 

I needed to create it as an <apex:actionFunction> and the action in there called my controller method. 

 

Thank you for your help, 

Inbal

This was selected as the best answer