Opening an iFrame in a Modal Dialog with Custom Parameters in Resco Mobile App

By | January 8, 2021

Sometimes working with the Resco Mobile app, we need an Iframe to open programmatically within the application same as Dynamics 365 CRM. For example, opening a web resource in a window on click of a custom ribbon button, we can add the same functionality in Resco Mobile App as well. In order to open child IFrame in a dialog window by using another i.e. parent Iframe, we can use the “MobileCRM.UI.IFrameForm.showModal” function of Resco.

For instance, let’s say we want to open a custom dialog on click of “Show Duplicate Accounts” command which will list out all Account records with same “Name” and “Phone”. We’ll pass the parameter to the child iframe and get it as well within the child iframe.

add custom command

We have created 2 iframe, one is Parent and the second one is Child. We added the Parent iFrame on the Account form with the below code in order to open the child iframe on the click of custom command i.e. “Show Duplicate Accounts” of Account form.

Please find the below code which is used to open child Iframe with the options (parameters) on click of “Show Duplicate Accounts” command

open child iframe

Options property of showModal() carries the custom parameters that is specified when opening the dialog using MobileCRM.UI.IFrameForm.showModal function.

Below is the code which is used to get the options (parameters) within the child iFrame

get the options

Same as EntityForm.requestObject function on entity form; to get the parameters within child iFrame we used MobileCRM.UI.IFrameForm.requestObject function of jsBridge as shown in above code.

So, by using the iFrame.options.text, we will get our parameters that passed to the child iFrame. Now if we go to the Mobile App, select any Account and click on the “Select Duplicate Accounts” command, the Modal Dialog will open with the list of duplicate Accounts as shown in the below screenshots

show duplicate accounts

duplicate accounts

Conclusion

Similar to Dynamic 365 CRM, we can open an IFrame in a Modal dialog window with custom parameters in Resco Mobile App as well.