Skip to main content
8 events
when toggle format what by license comment
Jul 3, 2020 at 17:31 comment added sfdcfox @DhananjayPatil you can return an AsyncApexJob directly back from Apex, then you can access the fields like record.JobItemsProcessed.
Jul 3, 2020 at 16:37 comment added SFDCDJ yeah that’s why I was getting error log in wired result. Is there sample where I can get the result from asyncapexjob and get the record counts?If u can see my comment on Sanket’s reply on this post, if I use JSON.stringfy, it is returning the entire object instead of single field value. So if getrecord and getfieldvalue is not supported for asyncapexjob then how could I retrieve field value of batch job and add it to the progress bar?
Jul 3, 2020 at 16:29 comment added sfdcfox @DhananjayPatil Actually, looks like AsyncApexJob isn't supported by getRecord. Still, you should return the job Id and use that to query the current job progress.
Jul 3, 2020 at 16:17 comment added SFDCDJ Tried to use getrecord where I am passing batch job Id but it’s not giving a result. It is going to error instead of data. Could u please share sample code or any reference?
Jul 3, 2020 at 15:19 comment added sfdcfox @DhananjayPatil The import statements are useful to link the field to the code to prevent people from accidentally breaking your code by deleting the field, but the getFieldValue method only works for UI-API record data, which would be via getRecord. If you used getRecord, you wouldn't need the getBatchJobStatus method, as you could get the data directly from the UI-API.
Jul 3, 2020 at 15:17 comment added SFDCDJ when you mentioned accessing field directly, u meant I don't need to use import tab to import field in JS?
Jul 3, 2020 at 15:14 comment added SFDCDJ @sfdxfox I have already put a check in my apex class that IF existing job is in Progress, do not call same batch again. I am not able to retrieve variable bulkBatchId in getBatchJobStatus() even after declaring it public and if Batch Job is in progress.
Jul 3, 2020 at 15:02 history answered sfdcfox CC BY-SA 4.0