locked
Navigate to form RRS feed

  • Question

  • I have some Javascript in the OnLoad event of my Account entity form. What I want to be able to do in here is when a criteria is met, navigate to a particular window. To give you some background, I have created a custom entity called Alert and associated it with the Account entity. This means there is now an Alert link within the navigation pane of an account when you view it. I want to be able to replicate someone clicking on this Alert link.

    Friday, April 6, 2012 2:35 PM

All replies

  • Hi,

    I'm a little bit confused with your requirements.

    If your Alert form is just another section on the same page you can iterate through tabs on a form and call tab.setDisplayState('expanded'); tab.setFocus();

    If you want to navigate to another page, you can simulate click using one of following:

    document.getElementById('your link id').click(); //IE only

    window.location.href = document.getElementById('your link id').href;

    if you use jQuery:

    $('# your link id').click();

    $('# your link id').trigger('click');

    Id of your link should be static, so if you are not going to change form in the future it is ok to hardcode it.

    Thanks,

    Alexey

    Friday, April 6, 2012 6:27 PM
  • Please give some more information about your problem.

    1. You could add custom button the form and add javascript to the button.
    Please check below links that are help full to you
    http://www.renauddumont.be/en/2011/crm-2011-ouvrir-une-fenetre-a-laide-dun-bouton-custom-et-dun-peu-de-javascript

    crmvisualribbonedit.codeplex.com<hints id="hah_hints"></hints>


    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
    Muhammad Mubasher, CRM Developer, The CRM Solutions Pvt Ltd.
    My Blogs: http://mubashersharif.blogspot.com
    My Linkedin: http://pk.linkedin.com/pub/muhammad-mubasher/34/548/305
    My Twitter: https://twitter.com/#!/mubashersharif

    Friday, April 6, 2012 8:02 PM
  • Ok, in the Account entity, I have added code to the OnLoad event which checks if the Account has any active instances of another custom entity (Alert). If it does, then I show a javascript alert message telling them so. Once the user clicks Ok to dismiss this alert, instead of showing the default Account details, it should show the list of alert entities.

    Alert is listed as a navigation item in the left-hand navigation pane in the account window (underneath all the other ones such as Activities, Accounts, Contacts, etc). Clicking on this manually loads the Associated Alert view in the frame on the right, I want to replicate this but automatically after the user dismisses the javascript alert.

    Friday, April 6, 2012 11:02 PM