locked
addCustomView and its New button RRS feed

  • Question

  • Using the below link able to get Xrm.Page.ui object called addCustomView  work to get Custom Lookup.

    http://www.harris-tech.com/blogs/bid/54720/Creating-Filtered-Lookups-in-CRM-2011

    It works quite well to filter Customers and Suppliers in the respective form.

    Problem is when clicking new button would like to populate Relationship field Optionset in accounts to Supplier or Customer.

     There are 2 separate forms one for Customer and another for Supplier. If there is a way to inject parameters to the New Button.

    When the Account form loaded based on the Parameter appropriate form can be opened and Relationship Optionset can be set.

    Any suggestion…..


    Hari Prabhu
    Monday, September 5, 2011 2:22 PM

Answers

  • Using window.parent.opener.location.href managed to get DefaultViewId parameter from the query string of the custom Lookup.

    By passing it to the Form Load event, defining which form to show and what default values to be set.

     

    Can anyone give a better solution to add our own New button and disabling the existing button.

     


    Hari Prabhu
    • Marked as answer by Hari Prabhu Thursday, September 8, 2011 9:04 AM
    Thursday, September 8, 2011 9:04 AM

All replies

  • Not tried on 2011 however I can populate a llokup field while open form using following code:-

    url = 'http://<ServerName>/uat/userdefined/edit.aspx?_CreateFromType=10001&_CreateFromId='+crmForm.ObjectId+'&etc=10063';
    
    
    
    window.open(url, null, "status=no,toolbar=no,menubar=no,location=no");
    
    
    
    

     


    Regards Faisal
    • Edited by Faisal Fiaz Monday, September 5, 2011 2:54 PM
    Monday, September 5, 2011 2:54 PM
  • Need to either override or add parameters to Properties and New button.

    if there is a possibility to add parameter to each record getting added to the grid then when clicking properties button we can use that parameter values to open right form.

    Need a solution to add parameters in New button as well.

     


    Hari Prabhu
    Monday, September 5, 2011 3:07 PM
  • Is it possible to use mapping to populate fields?

    Second option would be use workflow/plugin or javascript to populate fields

     


    Regards Faisal
    Monday, September 5, 2011 3:12 PM
  • Is there an option to add Parameter or replace existing code in Properties and New Button to get have our desired functionality included?


    Hari Prabhu
    Monday, September 5, 2011 3:21 PM
  • You can hide the button and show a new button with your logic. Please explore mapping as you may be able to do this with mapping which is quite easy and don't require any development:-

    http://crm-pitstop.blogspot.com/2009/08/you-might-have-noticed-how-certain.html 


    Regards Faisal
    Monday, September 5, 2011 3:34 PM
  • Would it be possible to provide a link or code snippet to hide existing button and display our button in Lookup Form Please.


    Hari Prabhu
    Monday, September 5, 2011 3:42 PM
  • Using window.parent.opener.location.href managed to get DefaultViewId parameter from the query string of the custom Lookup.

    By passing it to the Form Load event, defining which form to show and what default values to be set.

     

    Can anyone give a better solution to add our own New button and disabling the existing button.

     


    Hari Prabhu
    • Marked as answer by Hari Prabhu Thursday, September 8, 2011 9:04 AM
    Thursday, September 8, 2011 9:04 AM