I am trying to send an OpportunityId to my external application which is hosted on external service. The App is written in Java if it matters. The VF page config:

<apex:page standardController="Trial__c">
Return to <apex:outputLink value="/{!$CurrentPage.parameters.opptyId}"> Opportunity</apex:outputLink> >

<apex:canvasApp applicationName="<My Connected App>" height="1200px" width="100%"
                parameters="{opportunityId:'{!$CurrentPage.parameters.opptyId}'}" />  </apex:page>

I have Connected App "My Connected App" configured with a SAML authentication. What I have already tried is to set a Canvas.CanvasLifecycleHandler Apex class. My intend was to set a Connected App Custom Attribute which later on a client side I can read from a SAML assertion. Have to admit if I manually set the attribute and it's value I can read it in my client application. The approach didn't have much success. Next thing I tried is to configure Custom Connected App Handler extending Auth.ConnectedAppPlugin. That looked very promising to me. But using Developer Console found that plugin never been fired. So no success with that approach as well.

So now I am at your mercy and rely on your wisdom.

Please advice.

Many thanks in advance.

  • How is opportunity linked to your Trial__c record ? – Mohith Shrivastava Sep 11 '16 at 18:49

I use a very similar approach with a Canvas app that appears for Contacts.

<apex:page standardController="Contact">
    <apex:CanvasApp developerName="CanvasAppNameHere" maxHeight="infinite" maxWidth="infinite" parameters="{TargetId:'{!Contact.Id}'}" />    

Then in the client application I extract the value from the root > context > environment > parameters by the TargetId key.

You mention that if you manually set the value then it works. I assume this means you are replacing {!$CurrentPage.parameters.opptyId} in the Visualforce page with a hard coded ID? If that is the case then it is the merge field that is problematic. Does the return to Opportunity link work? Is the opptyId query string parameter correctly defined in the URL?

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.