-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
5Questions
-
6Replies
Report Api sorting isnt working in apex
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
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)
-
- STar14
- June 05, 2020
- Like
- 0
- Continue reading or reply
Trailhead - Apex Automation logic Challenge failing for Apex Specialist Superbadge !
Hi, I have completed the test class for the Test Automation logic challenge. Both my trigger and helper class are getting 100% covered. But the challenge is not complted due to the following error:
Challenge Not yet complete... here's what's wrong:
The 'MaintenanceRequestHelper' class did not achieve 100% code coverage via your test methods. Make sure that you chose 'Run All' tests in the Developer Console at least once before attempting to verify this challenge.
Can some one point me in the right direction to move forward with the badge completion. TIA !!!
Challenge Not yet complete... here's what's wrong:
The 'MaintenanceRequestHelper' class did not achieve 100% code coverage via your test methods. Make sure that you chose 'Run All' tests in the Developer Console at least once before attempting to verify this challenge.
Can some one point me in the right direction to move forward with the badge completion. TIA !!!
-
- STar14
- July 27, 2018
- Like
- 0
- Continue reading or reply
Execute method fails to implement in queueable apex
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?
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?
-
- STar14
- October 04, 2017
- Like
- 0
- Continue reading or reply
Partner WSDL issue:Not able to generate Apex class using the SFDC Partner WSDL
Hi All,
I am trying to generate apex class using the SFDC Partner WSDL , however i am getting the following issue while parsing the WSDL:
Apex Generation Failed
Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType
Can someone please point me what i am doing wrong in here.
Thanks in Advance !!
I am trying to generate apex class using the SFDC Partner WSDL , however i am getting the following issue while parsing the WSDL:
Apex Generation Failed
Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType
Can someone please point me what i am doing wrong in here.
Thanks in Advance !!
-
- STar14
- September 17, 2017
- Like
- 0
- Continue reading or reply
To Update fields on Case from email Body on Email to Case functionality !
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
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
-
- STar14
- August 09, 2017
- Like
- 0
- Continue reading or reply
Report Api sorting isnt working in apex
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
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)
- STar14
- June 05, 2020
- Like
- 0
- Continue reading or reply
Execute method fails to implement in queueable apex
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?
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?
- STar14
- October 04, 2017
- Like
- 0
- Continue reading or reply
Formula for insert Image?
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
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
- Guru Vemuru 1
- August 10, 2017
- Like
- 0
- Continue reading or reply
To Update fields on Case from email Body on Email to Case functionality !
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
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
- STar14
- August 09, 2017
- Like
- 0
- Continue reading or reply