SBX - Search With Button

SBX - Forum Post Title

Grid Click event on July update

Microsoft Dynamics CRM Forum

Ivan Ficko asked a question on 13 Oct 2017 2:24 AM
My Badges

Question Status

Verified

Did anyone manage to configure Grid click event on the new Dynamics 365 update?

Grid Click event – Override the default open behavior of data rows in an entity-bound grid:

  • As an OOB grid behavior, on double click of data row or clicking hyper link in Data row will open the entity record.
  • With this release, we can now override the default behavior to define your own custom behavior.
  • Create a command definition for an entity with Mscrm.OpenRecordItem as the value of the Id attribute (<CommandDefinition> (RibbonDiffXml)), and define custom action for the command <Actions> (RibbonDiffXml)
  • System will look for this command Id for an entity when you try to open a record from the entity-bound grid, and if present, will execute the custom action instead of opening the entity record (default behavior).

I added a simple addition to customizations.xml:

<CommandDefinitions>
  <CommandDefinition Id="Mscrm.OpenRecordItem">
    <EnableRules />
    <DisplayRules />
    <Actions>
      <JavaScriptFunction FunctionName="sayHello" Library="$webresource:new_sayHello" />
    </Actions>
  </CommandDefinition>
</CommandDefinitions>

And created new web resource JavaScript file:

function sayHello(){
	alert("Hello from grid!");
}

I just don't get alert mentioned in JavaScript file, it opens record as usual when clicking on the grid row.

Reply

Tried the same but it didn't work.

Tried both JavaScriptFunction and Url. 

But it opened the record as usual.

<CommandDefinitions>
<CommandDefinition Id="Mscrm.OpenRecordItem">
<EnableRules />
<DisplayRules />
<Actions>
<!--<JavaScriptFunction FunctionName="SampleScript" Library="$webresource:new_samplescript" >
</JavaScriptFunction>-->
<Url Address="https://www.bing.com/" WinMode="0"></Url>
</Actions>
</CommandDefinition>
</CommandDefinitions>

Not sure what we are missing here !

Reply
Alex Shlega responded on 13 Oct 2017 5:29 PM
My Badges

Does not seem to work for me either. It's unfortunate we can't download V9 SDK yet.. anyone had it in the preview? There would be default ribbon definitions there, I guess.. wondering if OpenRecordItem is there at all

Reply
Ivan Ficko responded on 15 Oct 2017 10:21 AM
My Badges

Yup that just bad that we can't access SDK v9 at the moment. The only thing we can do is to wait for the release of SDK.

Reply
jyeger responded on 15 Dec 2017 2:20 PM

did you or anyone managed to make this work?

I tried it myself but the record just open as usual

regarding the SDK I know that the dll's are available on nuget

Reply
Prasad Udawatte responded on 15 Jan 2018 6:32 AM
My Badges
Verified Answer

Hi Ivan,

I had the same issue and I lodge a ticket with MS and they got back to me saying Grid click event apply only for Unified Interface. Not the good old Web Interface :(

I had a look at the related docs.microsoft.com and finally they have updated the article saying "Supported only on Unified Interface".

Reply

Thanks for sharing this information Prasad

Reply
Ivan Ficko responded on 15 Jan 2018 1:46 PM
My Badges

Thanks for the information Prasad. I'm also sad that it's not available in the classic interface.

Reply
Prasad Udawatte responded on 15 Jan 2018 6:32 AM
My Badges
Verified Answer

Hi Ivan,

I had the same issue and I lodge a ticket with MS and they got back to me saying Grid click event apply only for Unified Interface. Not the good old Web Interface :(

I had a look at the related docs.microsoft.com and finally they have updated the article saying "Supported only on Unified Interface".

Reply

SBX - Two Col Forum

SBX - Migrated JS