[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

CRM - Web/ Outlook Conflicts

Hi

We have a custom form called Application Form created on our CRM system. This form is associated on the Details screen under Contacts, where the user can create associated records. Addtionally, under the Workplace->Extensions folder we are showing the view of records for this entity just for ease of user access.  

Our issue is to allow the user to create New records using this form at the Contact parent level but prevent them creating new records at the Workplace->Extensions folder level..
In order to prevent this I've placed the piece of Javascript code in the ApplicationForm
OnLoad()  event.  If the form is opened via the New button at another level besided the Contact level it will give an warning message and then close itself.  

This works fine in the CRM Web inface but fails thru the Outlook one. The error says 'window.opener.parent.document' is null....  

Anyone any ideas how I can adapt this for both installations ?

thanks


var parentForm = window.opener.parent.document.crmForm;
// check whether form being opened from application view of main CRM page, not via Contact form.
if (crmForm.FormType == 1 && parentForm == null) {
   alert("Please created New Application Form via the CRM Contact Form, Not this way!");
  crmForm.detachCloseAlert();
  window.close();    
  return;
}
0
BigBlueMan
Asked:
BigBlueMan
1 Solution
 
Feridun KadirPrincipal ConsultantCommented:
I think you've discovered one of the issues of using unsupported techniques in Javascript.

Might a better method be to just test whether the parent contact field is empty?  If the user creates the application form in extensions then the parent contact field (the lookup) is blank but if they do it from inside a contact form the lookup field will have the name of the contact and therefore won't be blank. This way you can use supported methods and it should work in Outlook and the Web.
0
 
BigBlueManAuthor Commented:
Yeh I should have realised that one... thanks for your help..
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now