We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

after another API version update there is a new field representing closing status. instead of MasterLabel you should use ApiName, they may differ. so the code snippet inside mergLeadWithExistingAccount() method should look like: LeadStatus convertStatus = [SELECT Id, ApiName FROM LeadStatus WHERE IsConverted=true LIMIT 1]; lc.setConvertedStatus(...


0

Based on this answer, the correct way to set the Content Type for an xlsx file is to use application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, not text/xlsx.


0

Your code is not asking for XLSX format. You're asking for either CSV or XLS format, depending on which lines are commented out. Changing the filename or MIME type on the attachment object has no effect on what file format is produced. Inspecting the URL generated when exporting an XLSX-format report in Lightning yields the URL format https://<mydomain&...


0

public static void DoExport() { ApexPages.PageReference rept = new ApexPages.PageReference('/00O0K00000AwUifUAF?csv=1&isdtp=p1'); List<Messaging.EmailFileAttachment> attnt = new list<Messaging.EmailFileAttachment>(); Messaging.EmailFileAttachment attnt1=new Messaging.EmailFileAttachment(); //attachment.setBody(Blob.valueof(...


0

After you upsert listAttendanceRate you do not reinitilize it. So after you upserted entries for all users, you just keep adding additional entries (with the same external ID). This explains why it is not happening if the activity is only today - you only call upsert once. move listAttendanceRate = new List(); to before your loop over the users, and you ...


1

I don't think it makes sense for me to analyze all your code and "optimize" it for you. I'll give you some ideas about what you could do to limit repeating yourself. This is not anything you can immediately copy and paste in your org, they're things you'll have to play around with and test on your own If the differences are only in queries, then you could ...


0

Implement Database.AllowsCallouts That is , your code will be global class exportReport3 implements Schedulable, Database.AllowsCallouts { global void execute(SchedulableContext sc) { ApexPages.PageReference report = new ApexPages.PageReference('/00O90000008euMXAUH?csv=1'); Messaging.EmailFileAttachment attachment = new Messaging....


1

The UI only allows on-the-hour scheduling, but if you use System.scheduleJob, you can specify the minute and second as well. Be aware that jobs will still only run when resources are available, but this extra flexibility should provide you with the desired "staggering" of jobs.


Top 50 recent answers are included