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

🙂

Advertisements
Advertisements

2 responses to “‘Saved’ event not triggering on ‘CRM Page’ hosted control – USD”

  1. krish Avatar
    krish

    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. Kiran Raj Avatar

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

Leave a comment