• Tom Jansen
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hey all, 

the title says it all.. I am already at the fourth step and the first 3 all verified perfectly. But now I just got this error message which makes no sense at all..

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: UEFMYGOW
Everyone knows the standard Sales Path for Opportunities. The final stage in the Path is 'Closed'. When you choose this stage, you get a pop-upscreen where you can choose Closed Won, Closed Lost or any other Stages you definied for Closed.
Is there a way you can achieve the same functionality with a Custom Sales Path?
Hey all, 

the title says it all.. I am already at the fourth step and the first 3 all verified perfectly. But now I just got this error message which makes no sense at all..

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: UEFMYGOW
Everyone knows the standard Sales Path for Opportunities. The final stage in the Path is 'Closed'. When you choose this stage, you get a pop-upscreen where you can choose Closed Won, Closed Lost or any other Stages you definied for Closed.
Is there a way you can achieve the same functionality with a Custom Sales Path?
Hi all,

I need to create a pdf (with the lead information) when a lead is created, this pdf is saved as document.

I wrote an apex class with an invocable method which fire in a process builder after 
a lead creation, and a visualforce page to insert the lead information.

This system doesn't work for the lead that fired the process builder, instead it works 
if I insert an id of existing lead.

Which is the problem?

Apex class:
public class PdfLead {
    
@InvocableMethod(label='PDF' description='creo dei pdf')   
public static list<Document> pagePdf(){
    
    Lead l = [select id, name from lead order by CreatedDate desc limit 1];
    
    PageReference pdf = Page.PageOfLead;
    pdf.getParameters().put('id', l.Id);
    
    Blob body;
    
    try{
    // returns the output of the page as a PDF
    body = pdf.getContent();
    } catch (VisualforceException e) {
      body = Blob.valueOf('Some Text');
    }
      
 
    List<Document> doc = new List<Document>();
    Document d = new Document(); 
        d.folderid='00lU00000018TxaIAE';
        d.Name = l.Name; 
        d.Body = body; 
        d.ContentType = 'application/pdf';
        d.Type = 'pdf';
    doc.add(d);    
    insert doc;
    return doc;

}

}
Visualforce page:
<apex:page StandardController="Lead" renderAs="pdf">  
  <h2>Gentile {! Lead.Name }</h2>
  <br/>
  Ci risulta che lei lavora presso {!Lead.Company}<br/>
  <br/> 
  Siamo riusciti a creare il file pdf con i suoi dati<br/>
  Grazie per aver richiesto informazioni per i nostri prodotti<br/>
</apex:page>

Thanks!!