-
What other method we can apply to access id instead of giving direct id in Salesforce?
public class sample { public Boolean batchStatusBool {get;set;} public String batchStatus {get;set;} public integer batch1 {get;set;} public integer batch2 {get;set;} Id batchId; public Boolean pollerBool {get;set;} public sample() { batchStatusBool = false; pollerBool = false; } public void callAcctUpdateBatch() { batchStatusBool = true; updatecontact obj = new updatecontact(); checkBatchStatus(); } public void checkBatchStatus() { AsyncApexJob job = [SELECT Id,totaljobitems,Status,NumberOfErrors FROM AsyncApexJob WHERE Id ='7072w000002G7IP']; batchStatus = job.Status; batch1 = job.totaljobitems; batch2 = job.NumberOfErrors; if(batchStatus == 'Completed') { pollerBool = false; } else { pollerBool = true; } } }What other method we can apply to access id instead of giving direct id?
-
This discussion was modified 6 years, 9 months ago by
Deepak.
-
This discussion was modified 6 years, 9 months ago by
Log In to reply.
Popular Salesforce Blogs
How Integrating Salesforce with Accounting Tools Helps Businesses to Change the Operational Paradigm
In a world where work from home has become the new normal, businesses quickly need to adapt to the changing market scenario. Companies must take…
Auditing Salesforce Org - Salesforce Security Guide
As we all know, security is the first priority in Salesforce. Salesforce provides different types of security features so customers' data is safe. In this…
Popular Salesforce Videos
Accenture + Salesforce: Making an Impact
Our people and communities are important connection points for support. Hear more from our Salesforce professionals. Check out this video to learn everything you need…
How to write your first Apex program? | Salesforce Apex basics
In this video, we have explained that how you can write your first apex program in Salesforce. We used developer console to write the code.…
How to Get Started with Data Prep | Salesforce
Good data preparation allows for efficient analysis, limits errors and inaccuracies that can occur to data during processing, and makes all processed data more accessible…