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
DevelopementDevelopement 

Custom Button

Hello,

I need to create a "Approve" button on my custom object "ERP" also when I click on Approve it should ask the confirmation that "Are you sure you want to Approve"?

 

Can anyone help me to create this.

 

Thanks a lot in advance.

 

Shruti

Dev@Force.ax647Dev@Force.ax647

Add a custom button on detail page and select javascript to execute and add following code in that. Make sure to create approval process first.

 

if(confirm("Are you sure?"))
{
     window.location="p/process/Submit?retURL=%2F{!ERP__c.Id}&id={!ERP__c.Id}"; 
}

 

DevelopementDevelopement

Actually the situation is:

I want to show Button "Approve", once I click on it  will pop up "Are you sure".

 

I am only going to approve it, so there is no approval process.So I want once it approved "approve" button should be hidden and email notification should go to all my team.

 

Thanks,

 

Shruti

ryanjuptonryanjupton

How are you handling the email generation. It still might be easier and faster to use an approval process. The default button action for approving a record is what you are desribing you want.

DevelopementDevelopement

I know it would be easier , but due to some limitation I can't use the approval process.

So how can I achieve this? 

 

for e mail generation, I had an idea, i will create a custom field checkbox and when the Approve button is click it should update the checkbox and when checkbox is true emila should trigger.

 

I know it's sound complicated but I need to do this way/

 

Can anyone help me with this?

 

Shruti