Posts

Showing posts with the label MS Dynamic CRM

Dynamic Filtered Views in CRM2011

If you want to create a dynamic filterd lookup in crm2011 Ex:- If you have a account lookup & a contact lookup in a form & you want to filter & view the only contacts who's parentcustomer is equal to the selected account. You can use the following var defaultViewId; // FUNCTION: formOnLoad function formOnLoad() { var lookupFieldName = 'new_contactid'; var accountFieldName = 'new_accountid'; defaultViewId = Xrm.Page.getControl(accountFieldName).getDefaultView(); setLookup(accountFieldName, lookupFieldName, false); } // FUNCTION: setLookup function setLookup(accountFieldName, lookupFieldName, resetSelection) { // Get the selected Account Id in the [accountFieldName] indicated control var account = Xrm.Page.getAttribute(accountFieldName).getValue(); if (account != null) { var accountid = account[0].id; var accountname = account[0].name; if (resetSelection == true) { // ...

Create OrganizationServiceProxy in CRM2011 IFD

Creating OrganizationServiceProxy in crm2011 IFD vs AD different when it comes to setting credentials of the service proxy. In AD :- ClientCredentials clientCredentials=new ClientCredentials(); clientCredentials.Windows.ClientCredential = new NetworkCredential(userName, password,domain); In IFD :- clientCredentials.UserName.UserName =domain + @"\" + userName; clientCredentials.UserName.Password = password; OrganizationServiceProxy service = new Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy(organizationUri, HomeRealmUri, credentials, null);