Calling Apex method from a Custom Button and Submit to Approval Process
Get link
Facebook
X
Pinterest
Email
Other Apps
To call Apex method from a Custom Button and Submit to Approval Process : Salesforce
1. Create a custom button
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var approval = confirm("Are you sure want to send it for approval process?");
if(approval == true)
{
sforce.apex.execute("ApprovalSubmit","sentToApproval",{recordId:"{!Interviewer__c.Id}"});
alert("Set Record for Approval");
}
2. Create a apex class :
global class ApprovalSubmit{
webservice static void sentToApproval(Id recordId) {
Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
req1.setComments('Submitted for Approval');
req1.setObjectId(recordId);
Approval.ProcessResult res = Approval.Process(req1);
}
}
Happy Sharing...
Everyone has their own favourites, so please feel free to share yours in the comments below!
User Data Privacy User Data Privacy Our Chrome extension does not collect any personal data or user information. We are committed to respecting your privacy and ensuring a secure browsing experience. You can use our extension with confidence, knowing that your data remains private and secure. If you have any concerns or questions regarding privacy or data security, please feel free to contact us at sanjayibirds2013@gmail.com .
Salesforce LWC : Compact Layout showing on Hover Sometime we have requirement to show Account name link on standard views, a popup with the Compact Layout shows the details of that record. LWC Parent Component : Template (HTML Code) LWC : JS (Process Code) import { LightningElement,api } from 'lwc'; export default class AccountComponent extends LightningElement { @api recordId; @track objRecordId; handleMouseover(event) { console.log(this.recordId); this.objRecordId = null const toolTipDiv = this.template.querySelector('div.ModelTooltip'); toolTipDiv.style.opacity = 1; toolTipDiv.style.display = "block"; // eslint-disable-next-line window.clearTimeout(this.delayTimeout); // esli...
Salesforce : Multi-Factor Authentication Evidence that users provide when logging in to confirm their identity.. One factor is something users know. For Salesforce logins, with user credeantial Two factors are verification methods that a user has in their possession, such as a mobile device with an authenticator app installed or a physical security key. How Multi-Factor Authentication Works 1. A user enters their username and password, as usual. 2. A user is prompted to provide one of the verification methods that Salesforce supports.. Salesforce verification methods: Salesforce Authenticator : A free mobile app that integrates seamlessly into your login process from Salesforce Third-party authenticator apps : This code is sometimes called a time-based one-time password, or TOTP for short. Users can pick from a wide variety of options, including Google Authenticator, Microsoft Authenticator, or Authy. Security keys : Small physical tokens that look like...
Comments
Post a Comment