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
AndrewTaylorAndrewTaylor 

External Objects (beta) - Can't Pass Id to VF page via button?

I'm trying to use the new External Objects (beta), and have a custom VF page for the object.

When I try to add a button to the standard page layout, I don't see a way to pass the record Id.  If I try to use a URL for a custom button, I can't add any fields from my External Object (e.g. MyObject__x.Id).  If I just use a Visualforce page, the record is not passed through in the link.

I realize this is in beta, so there might not be many people using this yet, but if anyone else is struggling with this, would be curious to hear.
Ashish_SFDCAshish_SFDC

Hi AJ, 


How have you defined the controller for the External Object?


Jconsultant
Try this:

create a variable in your controller

public String selectedLetterID {get;set;}

Then set it with the param tag.

<apex:inputfield value="{!letter.Suppressed__c}" id="suppressBox" onclick="SupressLetter('{!letter.Id}');return false;"/>


<apex:actionFunction name="SupressLetter" action="{!suppressLetter}" rerender="out">
    <apex:param name="firstparam" assignto="{!selectedLetterID}" value="" />
</apex:actionFunction>

Then update your record based on the id that is now assigned to your new variable in your controller method.


https://developer.salesforce.com/forums/ForumsMain?id=906F000000098K2IAI


Regards,

Ashish