CRM 2011 CrmParameter PrimaryControlId do not work in Form
-
Tuesday, August 21, 2012 5:40 PM
Hi all,
I have added a new Ribbon Button inside a custom entity form using a jscript function and the CrmParameter PrimaryControlId
<JavaScriptFunction Library="$webresource:dw_/js/_project/TextModuleBrowser.js" FunctionName="infoman.textModules.StartTextmoduleBrowserCommand">
<CrmParameter Value="PrimaryControlId" />
</JavaScriptFunction>infoman.textModules.StartTextmoduleBrowserCommand = function(primaryControlId){ /*....*/};
to find out the currently focused form control.
As I Read in the SDK the value should be the name of this control.
But i get an JScript Object which seem te be a crmForm - Type
thx
All Replies
-
Wednesday, September 05, 2012 7:18 AM
Hi,
Sorry my response may not be related to what you may be looking for but I had very tough time playing and modifying Ribbon manually until i came across this tool: VisualRibbonEditor
http://crmvisualribbonedit.codeplex.com/
Give it a try, its very easy to use and the good thing is you can read and understand the base commands and actions. Also you can add your buttons on fly, you hide/un-hide things and what not.
-
Wednesday, September 05, 2012 10:14 AM
Hi.
In SDK:
PrimaryControl An Object referencing the Control that had focus when the Ribbon Command action occurred. PrimaryControlId A string providing the Id value of the control that had focus.
My understanding it would return a string value to present the GUID Id of the focused control if exist.
Jaimie
-
Wednesday, September 05, 2012 10:43 AM
Hi,
thanks for your reply. I know the VisualRibbonEditor and also use it in out solution development.
Joachim
-
Wednesday, September 05, 2012 10:44 AM
Hi Jamie,
yes that's what I expected, too.
I think it must not be a GUID .. but the identifier of the focused control.
What I get from CRM inside the registered function is a jscript object which look like the old crmForm
Joachim
-
Saturday, November 17, 2012 9:46 PM
Does anyone have an answer for this? I have tried using both PrimaryControlId and PrimaryControl parameters. For both, I get an object passed to the JS function but it does not seem to enable me to determine which form control had the focus prior to the ribbon button being pressed. Here's my ribbondiff code:
<JavaScriptFunction FunctionName="OnCustomBtnFunc" Library="$webresource:IncidentButtonOverrides.js">
<CrmParameter Value="PrimaryControlId" />
<CrmParameter Value="PrimaryControl" />
</JavaScriptFunction>
- Edited by slanagus Saturday, November 17, 2012 9:47 PM grammar

