function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sunfishettesunfishette 

Looking for suggestions on Visualforce issue

Right now I have a visualforce page that uses my opportunity for a standardController.  I am looking to add the funtionality of supplying my partner portal customers with the option of selecting an "opportunity" and printing/viewing a pdf file that is attatched to it.  I have scoured the force.com boards and googled some other places (stack overflow) for an idea on how to best approach this.  I have found some fine suggestions on returning a relatedList, and various things, but I am still not sure this is even possible.  Especially if the opportunity has multiple files attached to it that are not invoices.

 

Is it possible for a partner portal user to log in, view the VF page list of closed opportunities, select it as a hyperlink and view/print the pdf (even if its in a sep. window!) ??  As I have said, I have read quite a few board postings, but they are all in disagreement with one another!  Some say yes, some say no.  Most provide no arguments to support their statements.  Even the "Development with the Force.com Platform" book provided no thoughts (that I could find).

 

Here is a typical output:

Date                 Opportunity Name      Status      Invoiced    Invoice Number    Paid     

1/15/2012        Widgets                        Closed      Yes           123456                 

2/1/2012          Thingy's                        Open          Yes           456789

1/8/2012           Doo-dads                    Closed      Yes           740593                   Yes

 

What I want is for the user to click on the invoice number that is a link and they can view the invoice.

 

What say you all ?

 

Thanks!

 

 

 

sfdcfoxsfdcfox

Should be perfectly feasible, assuming the user will be granted access to the attachment (and I suspect it would be). The properly constructed URL would be:

 

<apex:outputLink target="_blank" value="/servlet/servlet.FileDownload?file={!record.id}">{!record.name}</apex:outputLink>

 

sivaextsivaext

Hi 

 

you create one button on standard visualforce page. like this

 

<apex:CommandButton action="{!printPdf}" value="PDF"/>

 

inside controller 

 

public PageReference printPDF()

{

    PageReference pg=new PageReference('apex/visualforcepagename');

    pg.setRedirect(true);

    return pg;

}

 

at visualforce page name 

 

create one more visualforce page with rendered="PDF"

 

 

sunfishettesunfishette

sfdcfox -

 

I like your answer, its very close to what I need to accomplish, except,  I am running into an issue with this:

"

Unable to Access Page The value of the "file" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
Back

"

which I am almost positive is in regards to the 18 alphanumeric id ... but not sure how to handle the issue.

 

When I click on the outputLink, i seem to get three capital letters appended to the records id.

Like this:

a1Tg00000004Ca4

a1Tg00000004Ca4EAE

 

and this:

a1Tg00000004CaE

a1Tg00000004CaEEAU

 

Knowing the cause of the error, I still cant see how to get around it.

Here:  http://success.salesforce.com/questionDetail?qid=a1X30000000KJ03EAG is someone having a similar issue.

 

Could you shed some light on this?

Thank you!

 

sunfishettesunfishette

Sivaext,

Thank you for your reply.  Unfortunately, I am not able to understand your logic at this time.  I am new to salesforce and apex, and your solution is not detailed enough for me to comprehend.  I come from a strictly static HTML / CSS background and sometimes this is a coding nightmare for me.

 

Perhaps when I get better at visualforce / apex, I will be able to take what you have given me and use it appropriately.  I rely quite heavily on Force.Com and manuals to help me fill in the gaps right now, but that gap is a wee bit too big.

 

Thanks anyway,

- A rookie.

 

 

 

sfdcfoxsfdcfox

18 character ID values won't affect your link; salesforce.com fully supports 15 and 18 character generated ID values. Can you please copy and paste the entire link that's generated?