0

Currently I'm displaying orders and related objects in a visualforce page. The new requirement is:

  1. For every order a hyperlink/button will be added.

  2. On clicking that button, a related document from SAP server will be downloaded using a unique number (order id).

For example: (http: www.somelink.com/id=12345)

How would I need to start this? I know how to expose a webservice from apex. I'm pretty excited because this is a great opportunity for me to learn webservices in salesforce.

Suggestions and references would be appreciated. Thanks.

2
  • 1
    document from SAP should be downloaded on local System or in Salesforce ? Dec 17, 2014 at 13:22
  • It would be downloaded on local system of the user onclick of the link
    – MnZ
    Dec 17, 2014 at 13:25

2 Answers 2

1

On the object -"order" where you can see the record values for an order, create a formula(text) field

And try something like this::

HYPERLINK('https://somelink.com/'& File_Name__c , 
'https://somelink.com/'& File_Name__c )

where file_name__c is the file on that particular server/endpoint.

Note - file_name__c should be a value in records.

1

The above answer is good if you want an SObject field to be used as the hyperlink, otherwise you could just do the following in your VF page.

<apex:outputLink target="_blank" value="https://yourSAPServer/{!myRecordId}">Download File</apex:outputLink>

You could easily put this inside a repeat or a table too. As long as you just want to download the file, you shouldn't need to worry about webservices.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .