Home > CRM > ‘Saved’ event not triggering on ‘CRM Page’ hosted control – USD

‘Saved’ event not triggering on ‘CRM Page’ hosted control – USD

We have an Account form hosted in ‘CRM Page’ hosted control on USD. We got a requirement to navigate another page on CRM form Save event.

Below are the steps I initially followed

  • Created a new Hosted Control of type ‘CRM Page’
CRM Page Hosted Control

CRM Page Hosted Control

  • Go to ‘Events’ from Command Bar and open ‘Saved’ event
Saved event - Hosted Control

Saved event – Hosted Control

  • On ‘Saved’ event of Hosted Control, added a new ‘Action’ to Navigate to Bing
Navigate Action

Navigate Action

  • Save and close
  • Open the USD and open ‘Account’ record

But the ‘Saved’ event did not trigger when I click Save button from CRM page.

Reason

  • Looks like this is known issue with my USD version (Got fixed in latest USD version)

Fix

To fix this, below are workaround steps to hook the ‘Saved’ event to CRM hosted control.

  • Open ‘PageLoadComplete’ event of Hosted Control
PageLoadComplete Event

PageLoadComplete Event

  • Create a new ‘Action Call’
    • Action : ExecutionTimeout (Note : Create a new UII action if you can’t find ExecutionTimeout)
    • Data : milliseconds=6000
ExecutionOnTimeout Action Call

ExecutionOnTimeout Action Call

  • Create a new ‘Sub Action Call’
Sub Action Call

Sub Action Call

  • Add below Script using ‘RunXrmCommand’ Action

Script :

function hookSavedEvent(execContext)

{

window.open(“http://event/?eventname=Saved”); // notify USD of save

setTimeout(“top.ScanForData();”, 4000);

}

// Add ‘hookSavedEvent’ to Save event of CRM form

Xrm.Page.data.entity.addOnSave(hookSavedEvent);

Register Script Action

Register Script Action

  • Save & Close the forms
  • Close and reopen the USD client application to test the behavior now
  • Open ‘Account’ form, click on ‘Save’
USD CRM Form Save Action

USD CRM Form Save Action

  • We get a new tab with Bing page
USD - Navigated To Bing Page on Save

USD – Navigated To Bing Page on Save

🙂

Advertisement
Categories: CRM Tags: , , ,
  1. krish
    April 23, 2015 at 5:29 PM

    Hi Rajeev,
    How are you, I need some help on How to retrieve the entire emails information sent out of a Email Campaign Activity. Basically, for every email or letter send as a part of an email or letter campaign activity, the campaign creator is expecting to see a record providing the email delivery status etc.

  2. August 20, 2015 at 4:40 PM

    The solution didnt work for us. we cant even see a pageloadComplete event when a page is saved in USD debugger.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: