web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Strange behaviour for custom button for web and outlook client.

(0) ShareShare
ReportReport
Posted on by 6

Hello All,

             i have a custom web page and integrated that into the MSCRM 2015.

the custom web page has one of the button say "Add New contact" , this button works fine when we use it from within the web client but the same does not work within the outlook client.

The issue is that from web client it opens the new contact form but from the outlook client it redirects to the login page.why this strange behavior .

Note:-I am calling the javascript function on clicking of the "Add New contact" button .

<script type="text/javascript">
function ShowContact() {

var _hdnWebsitePath = document.getElementById('hdnWebsitePath').value;
if (typeof Xrm !== 'undefined') {
window.parent.Xrm.Utility.openEntityForm("contact");
}
else {
window.open(_hdnWebsitePath + '/main.aspx?etn=contact&pagetype=entityrecord');
}
}
</script>

where _hdnWebsitePath  is the server path variable.

Kindly help me in resolving this issue.

*This post is locked for comments

I have the same question (0)
  • ScottDurow Profile Picture
    21 on at

    The reason that this happens is that the outlook client authentication is different to the web client. Instead of using window.open use openEntityForm instead - see msdn.microsoft.com/.../jj602956.aspx

    Hope this helps

  • EmployeeOcta Profile Picture
    6 on at

    Thanks for your suggestion Scott, but my concern is this button will be used both in mscrm web client and mscrm outlook client.

    Now in place of window.open if i use another option then will that open the form into the new window from the web client.

    If the openentityform is used in place of the window.open it throws reference error.

    to avoid this which thing or how to use any alternate thing .

    i do want to access the same method for both the client.

    Kindly help me with example.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans