• Kushi
  • NEWBIE
  • -2 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 17
    Replies
There is a lookup on the Opportunity teams to Employee role but it still doesnt show when I try to create a report type. I have tried adding the Empl role object via lookup in the report type but no luck.

Any idea how this can be achieved?
  • January 09, 2018
  • Like
  • 0
I hae an apex class that converts the reports to a pdf and sends an email to the user.

Here is the Apex Class -
public class ReportChartController{

    public String reportId { get; set; }

    public List<Report> reportIdList {get;set;}
    
    public List<SelectOption> reportOptionList {get;set;}
    
    //retrive list of reports
    public ReportChartController(){
        reportIdList = new List<Report>();
        reportOptionList = new List<SelectOption>();
        for(Report rpt : [select Id,Name,FolderName from Report where FolderName='Print Folder']){
            System.debug('Report Name :'+rpt.Name);
            reportIdList.add(rpt);
            reportOptionList.add(new SelectOption(rpt.Id,rpt.Name));
        }
    }
        
    public PageReference reportSelectionChange(){
        System.debug('Selected Report '+reportId);
        String url = '/apex/ReportPDF?rptid='+reportId;
        PageReference pageRef = new PageReference(url);
        pageRef.setRedirect(false);
        return new PageReference(url);
    }
    
    public void sendEmail(){
        String email = UserInfo.getUserEmail();
        System.debug('Report ID :'+reportId+' Email: '+email);
        ReportUtils.sendReportExcelAttachment(reportId, email);
    }
    
    public void emailPDF(){
        String email = 'test@usbank.com';
        System.debug('Report ID :'+reportId+' Email: '+email);
        ReportUtils.sendReportPDFAttachment(reportId, email);
    }    
  }

Can someone help me in completing the test class.

Here is the test class-
​@isTest
public class ReportChartController_Test {
    
    static testMethod void reportSelectionChange()
    {
        test.startTest();
        List<Report> report_Obj  =  [SELECT Id,FolderName,Name from Report];
       // System.assertEquals(true,report_Obj.size()>0);
        ReportChartController rc = new ReportChartController();
        rc.reportId = (String)report_Obj.get(0).get('Id');
        rc.reportIdList = report_Obj;
        rc.reportOptionList = new List<SelectOption>();
              
        rc.reportSelectionChange();
      //  rc.sendEmail();
       // rc.emailPDF();
        test.stopTest();     
    }
  }

Thanks,
Kushi
  • January 04, 2018
  • Like
  • 0
There is a lookup on the Opportunity teams to Employee role but it still doesnt show when I try to create a report type. I have tried adding the Empl role object via lookup in the report type but no luck.

Any idea how this can be achieved?
  • January 09, 2018
  • Like
  • 0

Hi,

I tried to user appexchange for this like EasyDescribe/Schema surfer but it doesn't include description... Any ideas?

Thanks!

Hi All
I have a requirement like i have 20 user which have manager aslo.when i am creating record it will display record owner ,but want to populate manager of that perticular user..How can i map this 
Hi, 

  I need to create a formual field based on a date which quater it belongs to and the week 

  Example : Date = 1-Jan-2018 I need a formula to display as Q4-W1
                   Date = 1-Feb-2018 I need a formula to display as Q1-W1
                   Date = 8-Feb-2018 I need a formula to display as Q1-W2
                   Date = 1-May-2018 I need a formula to display as Q2-W1
                   Date = 8-May-2018 I need a formula to display as Q2-W2

Please suggest me how to get this done in using salesforce formula.

Thanks
Sudhir
  • January 03, 2018
  • Like
  • 0
Does salefsorce dataloader support bulk api 2.0?
HI All,

Actually my requirement is whenever case is created or closed a case , at that time i want calculate fiscal quarter based on calendar.
Below function is working using formula filed. but i have sturck . please let me know how to write a condtion for whenever case is created or closed a case on Maintance record type.

For your refrence here i am enclosing my code.
 
CASE(
    MONTH(TODAY()),

    1, "Q1",
    2, "Q1",
    3, "Q1",

    4, "Q2",
    5, "Q2",
    6, "Q2",

    7, "Q3",
    8, "Q3",
    9, "Q3",

    "Q4"
)

Please help me on this.

Thanks,
Chanti.​
I am developing this in SFDC.
I have a custom field whose type is URL.
I noticed that if I do the following, I can set the url of the case record.
myCase.customField = 'xxx.salesforce.com/recordid_of_othercase/d'
I would like to create 5 links of 5 different recordids in this custom field instead of having just one link for one recordid.
Q1. Can I do this in one custom field in some way or should I create 5 custom fields and fill each field with recordid?
Q2. I heard that I can change the way the url looks, having caseNumber field instead of a long url. What is the exact format of the code for this?
Thank you.
Hello,

I am using joined report

Is it possibel to take a screenshot of a report (or converting report in to pdf)and get it in apex.

I will later use it to email by scheduler

thank you
  • September 23, 2015
  • Like
  • 1

While the API docs have a lot of great examples using cURL, I don't see an example of how to actually obtain the access token. I tried the following with no joy:

 

 

curl grant_type=authorization_code \
  client_id=MY-CONSUMER-KEY \
  client_secret=MY-CONSUMER-SECRET \
  https://na5.salesforce.com/services/oath2/token

 

 

Thanks

 

Jeff Douglas

Appirio, Inc.

http://blog.jeffdouglas.com

 

Author: The Salesforce Handbook

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.