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
Kalai ArumugamKalai Arumugam 

Custom button not working partially

Custom button on the top is not working whereas the bottom button on the same page works fine. I'm the admin and have all the access to the objects here. Tried in different browsers Chorome, IE latest verions, same issue.
{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")} 

if ('{!Sales_Order__c.Status__c}' == 'Ready for Review' ) {

sforce.apex.execute("CreateOrder","SendApprovalRequest", {orderid:"{!Sales_Order__c.Id}"}); 
alert('Record sent for approval');
window.location.reload();

}
else{
alert('You can not Submit for Approval when status is in Draft');
}

 
Mahesh DMahesh D
Hi Kalai,

May be one of the button is Standard button and the other one is Custom. May be standard button is working and custom button is not working.

Please provide more information, about the issue what you are seeing on the screen.

Please do let me know if it helps you.

Regards,
Mahesh
Kalai ArumugamKalai Arumugam
Mahesh,

The page don't have any standard button, it has only the above mentioned custom button.

Also, I see the success alert 'Record sent for approval' when clicking the top button and does nothing. 
But, the below button don't show any success alert however it submits for approval.

I'm not sure, why this wiered behaviour in the same page on same button. :-(

Thanks,
-Kalai
Mahesh DMahesh D
Hi Kalai,

Just I tested in my DE environment and in both button clicks are working in the same way.

Yes its wiered behaviour, can we do onething, create a new button and place it in the page layout and do testing.

Regards,
Mahesh