You need to sign in to do that
Don't have an account?
rohitr
Pass Console Id (Primary Object Id) to controller.
How to pass id using the console functon "sforce.console.getFocusedPrimaryTabObjectId()" to a controller.
I'm getting the same on the javascript. But cannot pass. Tried using hiddenfield and actionfunction.
javascript:
function testGetFocusedPrimaryTabObjectId() {
sforce.console.getFocusedPrimaryTabObjectId(showObjectId);
}
var showObjectId = function showObjectId(result) {
//Display the object ID
invokeController(result.id);
alert('Object ID: ' + result.id);
};
page:
<apex:actionFunction name="invokeController" action="{!save}" reRender="outtext">
<apex:param value="{!primeTabValue}"/>
</apex:actionFunction>
this is my code and in controller am using get; set; for the primeTabValue variable.
Am able to get the id on alert box. but not on the variable.
Any help would be much appreciated.
I'm getting the same on the javascript. But cannot pass. Tried using hiddenfield and actionfunction.
javascript:
function testGetFocusedPrimaryTabObjectId() {
sforce.console.getFocusedPrimaryTabObjectId(showObjectId);
}
var showObjectId = function showObjectId(result) {
//Display the object ID
invokeController(result.id);
alert('Object ID: ' + result.id);
};
page:
<apex:actionFunction name="invokeController" action="{!save}" reRender="outtext">
<apex:param value="{!primeTabValue}"/>
</apex:actionFunction>
this is my code and in controller am using get; set; for the primeTabValue variable.
Am able to get the id on alert box. but not on the variable.
Any help would be much appreciated.
Try if this helps,
//First find the ID of the primary tab to put the new subtab in
sforce.console.getEnclosingPrimaryTabId(openSubtab);
//First find the ID of the current primary tab
sforce.console.getFocusedPrimaryTabId(getCaseId);
https://developer.salesforce.com/forums/ForumsMain?id=906F000000096sGIAQ
Also Vote for this Idea,
https://success.salesforce.com/ideaView?id=08730000000XhSBAA0
Regards,
Ashish
in fact your class member variable "primeTabValue" isn't assigned at all, if you do it like that. In your method "InvokeController" do this:
String message = Apexpages.currentPage().getParameters().get('primeTabValue');
and you will get the value. You don't need the class member variable at that point.
Best,
Andreas
Visualforce page:
In this example you have two ways of passing the ID to the controller to then build your code since the normal way to get the parameters does not work (ApexPages.currentPage().getParameters().get('id');) This is due to the fact that tab are encapsulated like in a iframe.
Also keep in mind that since the console does not behave the same as a regular Visualforce page and the extension controller is not getting information from your current object you can't populate the data. For that reason, you would need to build the controller.
VF page:
Controller: