• Jarvis Howard
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hey everyone, I'm not a developer, but have managed to write this test class which works well in Sandbox, but don't know how to write a test class. 
Also - is there any way I can get this to save to 'files' rather than just 'attachments'?

Code is below:

public class OrderAttachPDFExt{
    ApexPages.StandardController controller;
    public Order order {get;set;}
    public PageReference rtn;
    public OrderAttachPDFExt(ApexPages.StandardController c){
        order = (Order)c.getRecord();
        rtn = c.view();
    }
    public PageReference attachOrderGeneratePDF() {
        /* Get the page definition */
        PageReference pdfPage = Page.OrderGeneratePDF;
        pdfPage.getParameters().put('id',order.id);
        /* generate the pdf blob */
        Blob pdfBlob = pdfPage.getContent();
        /* create the attachment against the offer */
        Attachment a = new Attachment(parentId = order.id, name=order.OrderNumber +'.pdf', body = pdfBlob);
        /* insert the attachment */
        insert a;
        /* send the user back to the offer detail page */
        return rtn;
    }
}
Hi,

I have installed TOM, and the approval processes all seem to be working perfectly.
I dont know what the function of the 'Pay Cycle' or 'payroll System' is or what they are used for.
I assume the Time Off Balances accrue automatically, but dont know what rate this is at, or how this information is provided.

Is anybody able to help me with these queries?

Thanks, Jarvis
Hey everyone, I'm not a developer, but have managed to write this test class which works well in Sandbox, but don't know how to write a test class. 
Also - is there any way I can get this to save to 'files' rather than just 'attachments'?

Code is below:

public class OrderAttachPDFExt{
    ApexPages.StandardController controller;
    public Order order {get;set;}
    public PageReference rtn;
    public OrderAttachPDFExt(ApexPages.StandardController c){
        order = (Order)c.getRecord();
        rtn = c.view();
    }
    public PageReference attachOrderGeneratePDF() {
        /* Get the page definition */
        PageReference pdfPage = Page.OrderGeneratePDF;
        pdfPage.getParameters().put('id',order.id);
        /* generate the pdf blob */
        Blob pdfBlob = pdfPage.getContent();
        /* create the attachment against the offer */
        Attachment a = new Attachment(parentId = order.id, name=order.OrderNumber +'.pdf', body = pdfBlob);
        /* insert the attachment */
        insert a;
        /* send the user back to the offer detail page */
        return rtn;
    }
}
Hey there,

We are using Salesforce Lightning - and looking for a way to generate a PDF for Orders with Products and shipping information. I have the button to generate PDF, but not sure how to include all the Products (anywhere from 1-8 depending on the Order).

I'm new-ish to dev-type things in Salesforce, how can I do this?

I am a bit of a beginner at formulas, so hopefully one of you will think this is easy, and be able to help. :-)

 

Customer requirement:

 

Create a formula field that displays the Week Number (as Week 1, Week 2, etc), based on the Date entered on a particular record (same object).

 

Ex: 01/01/09 - 01/04/09 would return a value of "Week 1"  

01/05/09 - 01/11/09 = Week 2

01/12/09 - 01/18/09 = Week 3

 

and so on.....

 

Is using the CASE function the way to go, and if so, what's the shortest way to create this formula?

 

Thank you in advance!

S

 

  • April 20, 2009
  • Like
  • 0