• STar14
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
Hi ,
I am trying to use setSortBy() method in apex while using Report API. The method is not sorting the columns. 
Please let me know if i am missing anything in here.TIA
Reports.ReportResults results = Reports.ReportManager.runReport('00O11000000l9wC',true);
  Reports.ReportMetadata RM = results.getReportMetadata();
  System.debug('Detail columns: ' + rm.getDetailColumns());
  //Sorting code
  Reports.SortColumn sortcolumn = new Reports.SortColumn();
  sortcolumn.setSortColumn('CAT_Focal_File__c.Workday_Id__c');
  sortcolumn.setSortOrder(ASCENDING);
  System.debug('@@@1 '+results.getAlldata());	
  list<Reports.SortColumn> lstcolumns = new list<Reports.SortColumn>();
  lstcolumns.add(sortcolumn);
  rm.setSortBy(lstcolumns);
  Reports.ReportFactWithDetails factDetails =
    (Reports.ReportFactWithDetails)results.getFactMap().get('T!T');
  List<Reports.ReportDetailRow> allRows = factDetails.getRows();
  string s = (string)allRows.get(0).getDataCells().get(1).getValue();
  system.debug('@@@@@s '+s)

 
I have written the following queuable class :


public class LeadTriggerQueueable implements Queueable{
   list<Rejected_Hold_List__c> lstRejectedLead = new list<Rejected_Hold_List__c>();
          public LeadTriggerQueueable(list<Rejected_Hold_List__c> lstRejectedLead){
                 this.lstRejectedLead = lstRejectedLead;
                 system.debug('####lstRejectedLeadConstructor '+lstRejectedLead);
             }
    
    //Method to create insert records for an sobject
     public void execute(QueueableContext context) {
         system.debug('####Inside execute');
          insert lstRejectedLead;
          system.debug('####lstRejectedLeadExecute '+lstRejectedLead);
     }
 }


But my execute method fails to run. I am calling this class from before insert trigger. I am not sure if i am missing something in here. Can someone point in right direction?
Hi every one,

I written one formula for displaying images for different condition.

IF( Total_Lead_Score__c<20, IMAGE('/resource/1502342615000/Star1', 'Star1'),
IF( Total_Lead_Score__c<40, IMAGE('/resource/1502342589000/Star2', 'Star2'),
IF( Total_Lead_Score__c<60, IMAGE('/resource/1502342560000/Star3', 'Star3'),
IF( Total_Lead_Score__c<60, IMAGE('/resource/1502311560000/Star3', 'Star4'),
IMAGE('/resource/1502342499000/Star5','Star5')))))


This produces a Compiled formula too big error

CASE( Total_Lead_Score__c ,
Total_Lead_Score__c<20,IMAGE("/resource/1502342615000/Star1"),
Total_Lead_Score__c<40,IMAGE("/resource/1502342589000/Star2"),
Total_Lead_Score__c<40,IMAGE("/resource/1502377589000/Star3"),
Total_Lead_Score__c<40,IMAGE("/resource/15023222000/Star4"),
IMAGE("/resource/1502342560000/Star5")
)

Error: Incorrect number of parameters for function 'IMAGE()'. Expected 2, received 1
 
Hi All,
We have a set up On Demand Email to Case in our org. The customer send some information in the email body and i need to parse the email body to get the information for the fields and populate it on the case record.Can someone help me in resolving this.

Thanks ,
Sana Tarique