It's possible to create a lookup in visualforce page to choose one of two visualforce pages with the data from object?

I have one object, and I have to choose one pdf or another according the value choosed in picklist?

I appreciate your help.

  • welcome to salesforce.stackexchange user8715. Your questions is a bit confusing to me (could just be me thoug), could you maybe add some more detail, or maybe show us what you've already got? – Samuel De Rycke Jun 20 '14 at 14:15
  • Hello Samuel De Rycke I've got 2 visualforce pages rendered PDF. When I create a new record I have a button create pdf to a visualforce page, and in this new window I have to choose in a lookup or link lists, which visualforce page I want and send me to new pdf, but with the information from record. – user8715 Jun 20 '14 at 14:24
  • What have you done so far? If you share what you have written, maybe someone can help out. – AslamK Jun 20 '14 at 15:19
  • Just maked the visualforce page with table, rendered pdf. Let me see if I can explain better. After I create a record I can choose between 2 different pdf type. So I have a button Pdf, but inside this button I have to choose 1 of 2 pdfs. And this is my problem I don't know how create this part – user8715 Jun 20 '14 at 15:33

If you are creating a custom button, set the content source to URL then you can use a formula to set up your conditions and resulting pages... /apex/pdfPage1?id={!MyObject__c.Id}

  • The URL doesn't work IF(ISPICKVAL(tipo__c, "X"), /cs20.salesforce.com/apex/page1?={!Invoice__c.Id}, IF(ISPICKVAL(tipo__c, "Y"), /cs20.salesforce.com/apex/page2?={!Invoice__c.Id})) – user8715 Jun 21 '14 at 14:18
  • you don't need the cs20.salesforce.com, just have the /apex... that way it will work in test and production environments. If you want to hardcode the instance then start with cs20... – Jenny B Jun 23 '14 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.