{"id":26372,"date":"2021-01-08T11:56:33","date_gmt":"2021-01-08T11:56:33","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=26372"},"modified":"2021-01-08T11:56:33","modified_gmt":"2021-01-08T11:56:33","slug":"opening-an-iframe-in-a-modal-dialog-with-custom-parameters-in-resco-mobile-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/01\/opening-an-iframe-in-a-modal-dialog-with-custom-parameters-in-resco-mobile-app\/","title":{"rendered":"Opening an iFrame in a Modal Dialog with Custom Parameters in Resco Mobile App"},"content":{"rendered":"<p style=\"text-align: justify;\">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 \u201cMobileCRM.UI.IFrameForm.showModal\u201d function of Resco.<\/p>\n<p style=\"text-align: justify;\">For instance, let\u2019s say we want to open a custom dialog on click of \u201cShow Duplicate Accounts\u201d command which will list out all Account records with same \u201cName\u201d and \u201cPhone\u201d. We\u2019ll pass the parameter to the child iframe and get it as well within the child iframe.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/add-custom-command.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26373 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/add-custom-command.png\" alt=\"add custom command\" width=\"608\" height=\"73\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/add-custom-command.png 608w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/add-custom-command-300x36.png 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">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. \u201cShow Duplicate Accounts\u201d of Account form.<\/p>\n<p>Please find the below code which is used to open child Iframe with the options (parameters) on click of <strong>\u201cShow Duplicate Accounts\u201d<\/strong> command<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/open-child-iframe.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26379 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/open-child-iframe.png\" alt=\"open child iframe\" width=\"839\" height=\"255\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/open-child-iframe.png 839w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/open-child-iframe-300x91.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/open-child-iframe-768x233.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/open-child-iframe-660x201.png 660w\" sizes=\"(max-width: 839px) 100vw, 839px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Options property of showModal() carries the custom parameters that is specified when opening the dialog using MobileCRM.UI.IFrameForm.showModal function.<\/p>\n<p style=\"text-align: justify;\">Below is the code which is used to get the options (parameters) within the child iFrame<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/options-in-chile-iframe.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26375 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/options-in-chile-iframe.png\" alt=\"get the options\" width=\"947\" height=\"732\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/options-in-chile-iframe.png 947w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/options-in-chile-iframe-300x232.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/options-in-chile-iframe-768x594.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/options-in-chile-iframe-660x510.png 660w\" sizes=\"(max-width: 947px) 100vw, 947px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">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.<\/p>\n<p style=\"text-align: justify;\">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 \u201cSelect Duplicate Accounts\u201d command, the Modal Dialog will open with the list of duplicate Accounts as shown in the below screenshots<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/show-duplicate-accounts-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26377 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/show-duplicate-accounts-2.png\" alt=\"show duplicate accounts\" width=\"827\" height=\"264\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/show-duplicate-accounts-2.png 827w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/show-duplicate-accounts-2-300x96.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/show-duplicate-accounts-2-768x245.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/show-duplicate-accounts-2-660x211.png 660w\" sizes=\"(max-width: 827px) 100vw, 827px\" \/><\/a><\/p>\n<h2><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/duplicate-account.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26378 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/duplicate-account.png\" alt=\"duplicate accounts\" width=\"827\" height=\"324\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/duplicate-account.png 827w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/duplicate-account-300x118.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/duplicate-account-768x301.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/duplicate-account-660x259.png 660w\" sizes=\"(max-width: 827px) 100vw, 827px\" \/><\/a><\/h2>\n<h2>Conclusion<\/h2>\n<p style=\"text-align: justify;\">Similar to Dynamic 365 CRM, we can open an IFrame in a Modal dialog window with custom parameters in Resco Mobile App as well.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/click-2-export-microsoft-dynamics-crm-reports\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26380 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/click2export.jpg\" alt=\"\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/click2export.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/click2export-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/click2export-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/01\/click2export-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/01\/opening-an-iframe-in-a-modal-dialog-with-custom-parameters-in-resco-mobile-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,19],"tags":[449,545,592,2115,1445],"class_list":["post-26372","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","tag-custom-parameters","tag-dynamics-365-crm","tag-dynamics-crm","tag-opening-an-iframe","tag-resco-mobile-app"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/26372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=26372"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/26372\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=26372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=26372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=26372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}