IN MSCRM Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/in-mscrm/ Microsoft Dynamics CRM . Microsoft Power Platform Sun, 21 Jun 2020 09:20:47 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 IN MSCRM Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/in-mscrm/ 32 32 176351444 Submit Feedback of https://github.com/MicrosoftDocs , how to submit a issue with page or product of Microsoft doc http://microsoftdynamics.in/2020/06/07/submit-feedback-of-https-github-com-microsoftdocs-how-to-submit-a-issue-with-page-or-product-of-microsoft-doc/ Sun, 07 Jun 2020 14:45:13 +0000 http://microsoftdynamics.in/?p=3532 The post Submit Feedback of https://github.com/MicrosoftDocs , how to submit a issue with page or product of Microsoft doc appeared first on Microsoft Dynamics 365 Blog.

]]>

Recently while helping a friend informs, encountered a bug or issue with the snippet code mentioned in Doc.microsoft.com, Incorrect syntax was identified

  • The requirement was to hide create a button on the business process flow on a certain condition and Microsoft document gives a function to use getNavigationBehavior()

Refer : https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-data-process/stage/getnavigationbehavior

  • but was getting Error : formContext.data.process.getActiveStage.getNavigationBehavior is not a function
  • After some debugging found the Document page code need some amendment

  • If this type of issue is identified on page , we have an option to submit feedback and raise It in https://github.com/MicrosoftDocs

The post Submit Feedback of https://github.com/MicrosoftDocs , how to submit a issue with page or product of Microsoft doc appeared first on Microsoft Dynamics 365 Blog.

]]>
3532
Show Progress Indicator (Out of the box) Microsoft Dynamics 365 CRM V9 http://microsoftdynamics.in/2018/01/16/show-progress-indicator-out-of-the-box-microsoft-dynamics-365-crm-v9/ Tue, 16 Jan 2018 05:00:00 +0000 Yesterday used a nice feature progress indicator, before we use to write custom JS to show loading progress image but now we can use new JavaScript function of the Xrm.Utility namespace : showProgressIndicator. showProgressIndicator closeProgressIndicator —————————————————————————————————— function setFaxNumber() {     Xrm.Utility.showProgressIndicator(“Loading contact Info..”);     setTimeout(setFaxNumberafterdelay, 3000); } function setFaxNumberAfterDelay() {     var phoneNumber = Xrm.Page.getAttribute(“telephone1”).getValue();...

The post Show Progress Indicator (Out of the box) Microsoft Dynamics 365 CRM V9 appeared first on Microsoft Dynamics 365 Blog.

]]>
Yesterday used a nice feature progress indicator, before we use to write custom JS to show loading progress image but now we can use new JavaScript function of the Xrm.Utility namespace : showProgressIndicator.

  • showProgressIndicator
  • closeProgressIndicator
show progress indicator (loading image)

——————————————————————————————————

function setFaxNumber() {
    Xrm.Utility.showProgressIndicator(“Loading contact Info..”);
    setTimeout(setFaxNumberafterdelay, 3000);
}
function setFaxNumberAfterDelay() {
    var phoneNumber = Xrm.Page.getAttribute(“telephone1”).getValue();
    if (phoneNumber != null) {
        Xrm.Page.getAttribute(“description”).setValue(phoneNumber);
    }
    Xrm.Utility.closeProgressIndicator();

}

———————————————————————————

The post Show Progress Indicator (Out of the box) Microsoft Dynamics 365 CRM V9 appeared first on Microsoft Dynamics 365 Blog.

]]>
2746
Entity for Views in CRM based on View Ownership – SavedQuery and UserQuery Entity http://microsoftdynamics.in/2018/01/07/entity-for-views-in-crm-based-on-view-ownership-savedquery-and-userquery-entity/ Sun, 07 Jan 2018 15:14:00 +0000 There are 2 types of View in CRM entity based on View Ownership , which are stored in two different entities. 1)  Organisation or System View – stored in the View Entity (SavedQuery)2)  Individual, personal or User/Team View – stored in the Saved View Entity (UserQuery) Below is the Fetch XML that you can use to...

The post Entity for Views in CRM based on View Ownership – SavedQuery and UserQuery Entity appeared first on Microsoft Dynamics 365 Blog.

]]>
There are 2 types of View in CRM entity based on View Ownership , which are stored in two different entities.

1)  Organisation or System View – stored in the View Entity (SavedQuery)
2)  Individual, personal or User/Team View – stored in the Saved View Entity (UserQuery)

Below is the Fetch XML that you can use to retrieve the Data of the entites

1)  Organisation or System View

<fetch top="5000" >
  <entity name="savedquery" >
    <attribute name="name" alias="ViewName" />
    <attribute name="createdbyname" alias="Owner" />
    <attribute name="description" alias="Description" />
    <attribute name="returnedtypecode" alias="returnCode" />
    <attribute name="fetchxml" alias="fetchXML" />
  </entity>
</fetch>

2)  Individual, personal or User/Team View

<fetch top="5000" >
  <entity name="userquery" >
    <all-attributes/>
    <attribute name="name" />
    <order attribute="name" descending="false" />
    <attribute name="ownerid" />
    <attribute name="modifiedon" />
    <attribute name="userqueryid" />
  </entity>
</fetch>

We can retrieve the data of these entries by C# also you can see the full code example here:
https://msdn.microsoft.com/en-us/library/gg594431.aspx

You can also use LINQ query for retrieving these view.

Happy CRMing 😊

The post Entity for Views in CRM based on View Ownership – SavedQuery and UserQuery Entity appeared first on Microsoft Dynamics 365 Blog.

]]>
2755
Add value in option set – Status Reason C# http://microsoftdynamics.in/2018/01/07/add-value-in-option-set-status-reason-c/ Sun, 07 Jan 2018 14:49:00 +0000 Reference to be used – using Microsoft.Crm.Sdk.Messages; var response = ((InsertStatusValueResponse)service.Execute ( new InsertStatusValueRequest {     AttributeLogicalName = “statuscode”,     EntityLogicalName = “task”,     Label = new Microsoft.Xrm.Sdk.Label(“Auto Closed”, 1033),     StateCode = 1 //Status: 0 active & 1 inactive } )).NewOptionValue; Happy Coding 😊

The post Add value in option set – Status Reason C# appeared first on Microsoft Dynamics 365 Blog.

]]>
Reference to be used – using Microsoft.Crm.Sdk.Messages;
var response = ((InsertStatusValueResponse)service.Execute
(
new InsertStatusValueRequest
{
    AttributeLogicalName = “statuscode”,
    EntityLogicalName = “task”,
    Label = new Microsoft.Xrm.Sdk.Label(“Auto Closed”, 1033),
    StateCode = 1 //Status: 0 active & 1 inactive
}
)).NewOptionValue;

Happy Coding 😊

The post Add value in option set – Status Reason C# appeared first on Microsoft Dynamics 365 Blog.

]]>
2756
Validation to accept only Numeric Character in MS CRM http://microsoftdynamics.in/2018/01/07/validation-to-accept-only-numeric-character-in-ms-crm/ Sun, 07 Jan 2018 14:46:00 +0000 Below script is a generic validation which will show for error if field is having anything except numeric value function ValidateOnlyNumeric(context) {     var fieldname = context.getEventSource().getName();     var phone = Xrm.Page.getAttribute(fieldname).getValue();     if (checkFormat(phone)) {         Xrm.Page.getControl(fieldname).clearNotification();     } else {         Xrm.Page.getControl(fieldname).setNotification(“Please enter only numeric characters”);     } } function checkFormat(phone) {     var regex = /^d+$/;     if (regex.test(phone)) {         return true;     } else {         return false;     }...

The post Validation to accept only Numeric Character in MS CRM appeared first on Microsoft Dynamics 365 Blog.

]]>

Below script is a generic validation which will show for error if field is having anything except numeric value


function ValidateOnlyNumeric(context) {
    var fieldname = context.getEventSource().getName();
    var phone = Xrm.Page.getAttribute(fieldname).getValue();
    if (checkFormat(phone)) {
        Xrm.Page.getControl(fieldname).clearNotification();
    } else {
        Xrm.Page.getControl(fieldname).setNotification(“Please enter only numeric characters”);
    }
}
function checkFormat(phone) {
    var regex = /^d+$/;
    if (regex.test(phone)) {
        return true;
    } else {
        return false;
    }
}

To enable it for any field just register it on change of the required field with function name “ValidateOnlyNumeric” and check “Pass execution context as first parameter ” and save an publish it will start working

Hope it helps

Happy Coding 😊

The post Validation to accept only Numeric Character in MS CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
2757
Create and Send Email Message Activity from javascript using api D365 / MS CRM 2016 http://microsoftdynamics.in/2018/01/07/create-and-send-email-message-activity-from-javascript-using-api-d365-ms-crm-2016/ Sun, 07 Jan 2018 09:06:00 +0000 For Creating email message activity from java script MS CRM , you can update and use the below code according to your requirement. Here to show I have taken up a scenario to send a email to system user when a Quote is won. Replace the User GUID for to and from user in “fromFieldIdSystemAdmin”...

The post Create and Send Email Message Activity from javascript using api D365 / MS CRM 2016 appeared first on Microsoft Dynamics 365 Blog.

]]>
For Creating email message activity from java script MS CRM , you can update and use the below code according to your requirement. Here to show I have taken up a scenario to send a email to system user when a Quote is won.

Replace the User GUID for to and from user in “fromFieldIdSystemAdmin” and  “toPartyUsersId”

function CreateEmail() {
    var fromFieldIdSystemAdmin = "53536B3D-4D71-4FC2-857C-0477750A92BE"; //todo Email from User GUID
    var toPartyUsersId = ["53536B3D-4D71-4FC2-857C-0477750A92BE"]; //todo Email To user array
    var quoteId = Xrm.Page.data.entity.getId();
    quoteId = quoteId.replace(/[{}]/g, "");
  var customerLookUp = Xrm.Page.getAttribute("customerid");
    var accountName = null;
    if (customerLookUp != null)
        accountName = customerLookUp.getValue()[0].name;
    var webapiPath = Xrm.Page.context.getClientUrl() + "/api/data/v8.0/emails";
    var email = {};
    //Lookup
    email["regardingobjectid_quote@odata.bind"] = "/quotes(" + quoteId + ")"; //Regarding is quote
    email["subject"] = "Quote Sent ";
    email["description"] = "See attachment for the Quote that was set as Won";
    var parties = [];
    //ActivityParty (From)
    var sender = {};
    sender["partyid_systemuser@odata.bind"] = "/systemusers(" + fromFieldIdSystemAdmin + ")";
    sender["participationtypemask"] = 1; //From
    parties.push(sender);
    for (i = 0; i < toPartyUsersId.length; i++) {
        var receiver = {};
        receiver["partyid_systemuser@odata.bind"] = "/systemusers(" + toPartyUsersId[i] + ")";
        receiver["participationtypemask"] = 2; //To
        parties.push(receiver);
    }
    email["email_activity_parties"] = parties;
    var service = new XMLHttpRequest();
    service.open("POST", webapiPath, false);
    service.setRequestHeader("Accept", "application/json");
    service.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    service.setRequestHeader("OData-MaxVersion", "4.0");
    service.setRequestHeader("OData-Version", "4.0");
    service.send(JSON.stringify(email));
    if (service.readyState == 4) {
        if (service.status == 204) {
            var uri = service.getResponseHeader("OData-EntityId");
            var regExp = /(([^)]+))/;
            var matches = regExp.exec(uri);
            var emailGblId = matches[1];
            SendEmail(emailGblId);
        } else {

            Xrm.Utility.alertDialog(this.statusText);
        }
    }
}

function SendEmail(emailGblId) {
    var parameters = {};
    parameters.IssueSend = true;
    var req = new XMLHttpRequest();
    req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.1/emails(" + emailGblId + ")/Microsoft.Dynamics.CRM.SendEmail", true);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 200) {
                var results = JSON.parse(this.response);
            } else {
                Xrm.Utility.alertDialog(this.statusText);
            }
        }
    };
    req.send(JSON.stringify(parameters));
}

function successCallback() {
}
function errorCallback() {
}

Happy Coding 😊

SOURCE : mscrm.com

The post Create and Send Email Message Activity from javascript using api D365 / MS CRM 2016 appeared first on Microsoft Dynamics 365 Blog.

]]>
2759
Xrm.Page.ui control (client-side reference) http://microsoftdynamics.in/2017/12/18/xrm-page-ui-control-client-side-reference/ Mon, 18 Dec 2017 10:47:00 +0000 http://microsoftdynamics.in/2017/12/18/xrm-page-ui-control-client-side-reference/ xrm.page.ui.controls.get

The post Xrm.Page.ui control (client-side reference) appeared first on Microsoft Dynamics 365 Blog.

]]>

SOURCE : msdn.microsoft.com

Xrm.Page.ui control (client-side reference)

Dynamics CRM 2013
This topic has not yet been rated – Rate this topic
Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online
The control object provides methods to change the presentation or behavior of a control and identify the corresponding attribute.
You access controls using the following collections: Xrm.Page.ui.controlsXrm.Page.ui Section.controls, or Xrm.Page.data.entity Attribute.controls. TheXrm.Page.getControl method is a shortcut method to access Xrm.Page.ui.controls.get.
Each of the syntax examples in this topic show the use of the Xrm.Page.getControl method to access a control. Which control depends on the arguments passed to the method. The args parameter to access a single control must be either the name of the control or the index.
When a form displays a business process flow control in the header, additional controls will be added for each attribute that is displayed in the business process flow. These controls have a unique name like the following: header_process_<attribute name>.
Controls displayed in the form header are accessible and have a unique name like the following: header_<attribute name>.
For controls that are bound to attributes it is common to access controls through the Xrm.Page.data.entity Attribute.controls collection

 

Disabled
Detect the state and enable or disable controls using the getDisabled and setDisabled methods.

getAttribute
Get the attribute that the control is bound to.

getControlType
Get information about the type of control.

getName
Get the name of the control

getParent
Get the section object that the control is in.

Label
Get or change the label for a control using the getLabel and setLabel methods.

Lookup control methods and events
Control the results displayed for a user to choose from when they set the value of a lookup control using the addCustomFilteraddCustomViewgetDefaultView,setDefaultView methods.

You can add or remove event handlers for the PreSearch event using the addPreSearch and removePreSearch methods.

Notification
Display and remove notifications to users about a control using the setNotification and clearNotification methods.

OptionSet control methods
Modify the options displayed in OptionSet controls using the addOptionclearOptions, and removeOption methods.

refresh
Refresh the data displayed in a subgrid.

setFocus
Set focus on a control.

setShowTime
Specify whether a date control should show the time portion of the date.

Visible
Determine which controls are visible and show or hide them using the getVisible and setVisible methods.

Web resource and IFRAME control methods
Interact with web resource and IFRAME controls using the getDatasetDatagetInitialUrlgetObjectsetSrc and getSrc methods.

 

Use getDisabled and setDisabled to detect whether a control is disabled or to enable or disable it.
Control Types: standard, lookup, optionset.

 

getDisabled

Returns whether the control is disabled.
Xrm.Page.getControl(arg).getDisabled()
Return Value
Type: Boolean. True if the control is disabled, otherwise false.

 

setDisabled

Sets whether the control is disabled.
Xrm.Page.getControl(arg).setDisabled(bool)
Arguments
Type: Boolean. True if the control should be disabled, otherwise false.

 

Returns the attribute that the control is bound to.
Control Types: standard, lookup, optionset.
Xrm.Page.getControl(arg).getAttribute()
noteNote
Controls that are not bound to an attribute (subgrid, web resource, and IFRAME) do not have this method. An error will be thrown if you attempt to use this method on one of these controls.

Return Value
Type: Object: An attribute.

Remarks
The constituent controls within a quick view control are included in the controls collection and these controls have the getAttribute method. However, the attribute is not part of the attribute collection for the entity. While you can retrieve the value for that attribute using getValue and even change the value using setValue, changes you make will not be saved with the entity.
The following code shows using the value the contact mobilephone attribute when displayed on an account entity form using a quick view control namedcontactQuickForm. This code will hide the control when the value of the attribute is null.
var quickViewMobilePhoneControl = Xrm.Page.getControl("contactQuickForm_contactQuickForm_contact_mobilephone");
 if (quickViewMobilePhoneControl.getAttribute().getValue() == null)
 {
  quickViewMobilePhoneControl.setVisible(false);
 }

 

Returns a value that categorizes controls.
Control Types: all.
Xrm.Page.getControl(arg).getControlType()
Return Value
Type: String

Possible return values of getControlType:

Return Value Description
standard
A Standard control.
iframe
An IFRAME control
lookup
A Lookup control.
optionset
An OptionSet control
subgrid
A subgrid control
webresource
A web resource control
notes
A Notes control

 

Returns the name assigned to the control.
noteNote
The name assigned to a control is not determined until the form loads. Changes to the form may change the name assigned to a given control.

Control Types: all.
Xrm.Page.getControl(arg).getName()
Return Value
Type: String. The name of the control.

 

Returns a reference to the section object that contains the control.
Control Types: all.
Xrm.Page.getControl(arg).getParent()
Return Value
Type: Xrm.Page.ui section (client-side reference) object.

 

Get or change the label for a control using the getLabel and setLabel methods.
Control Types: all.

 

getLabel

Returns the label for the control
Xrm.Page.getControl(arg).getLabel()
Return Value
Type: String. The label of the control.

 

setLabel

Sets the label for the control.
Xrm.Page.getControl(arg).setLabel(label)
Arguments
Type: String. The new label for the control.

 

Control the results displayed for a user to choose from when they set the value of a lookup control using the addCustomFilteraddCustomViewgetDefaultView,setDefaultView methods. The Lookup control also exposes the PreSearch event so that you can programmatically add event handlers using the addPreSearch andremovePreSearch methods.
Control Types: lookup.

 

addCustomFilter

Use add additional filters to the results displayed in the lookup. Each filter will be combined with any previously added filters as an ‘AND’ condition.
Xrm.Page.getControl(arg).addCustomFilter(filter, entityLogicaName)
Arguments
filterXml
Type: String: The fetchXml filter element to apply. For example:

<filter type="and">
 <condition attribute="address1_city" operator="eq" value="Redmond" />
</filter>
entityLogicalName
Type: String: (Optional) If this is set the filter will only apply to that entity type. Otherwise it will apply to all types of entities returned.

Remarks
More information: FetchXML schema.

This method is only available for Updated Entities.

This method can only be used in a function in an event handler for the Lookup Control PreSearch Event.

 

addCustomView

Adds a new view for the lookup dialog box.
Xrm.Page.getControl(arg).addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, isDefault)
Arguments
viewId
Type:String: The string representation of a GUID for a view.

noteNote
This value is never saved and only needs to be unique among the other available views for the lookup. A string for a non-valid GUID will work, for example “{00000000-0000-0000-0000-000000000001}”. It is recommended that you use a tool like guidgen.exe to generate a valid GUID. The guidgen.exe tool is included in the Windows SDK.

entityName
Type: String: The name of the entity.

viewDisplayName
Type: String: The name of the view.

fetchXml
String: The fetchXml query for the view.

layoutXml
Type:String: The XML that defines the layout of the view.

isDefault
Type:Boolean: Whether the view should be the default view.

Remarks
This method does not work with Owner lookups. Owner lookups are used to assign user-owned records.

 

DefaultView

You can detect which view is the default view to be shown to allow users to select records in a lookup and change the default view using getDefaultView and setDefaultView.

 

getDefaultView

Returns the Id value of the default lookup dialog view.
Xrm.Page.getControl(arg).getDefaultView()
Return Value
Type: String. The Id value of the default view.

 

setDefaultView

Sets the default view for the lookup control dialog.
Xrm.Page.getControl(arg).setDefaultView(viewGuid)
Arguments
Type: String. The Id of the view to be set as the default view.

 

PreSearch event

You can add or remove event handlers for the Lookup Control PreSearch Event using the addPreSearch and removePreSearch methods.
Use the PreSearch event to control what results are displayed for the control using the form data current as the user is beginning to search for records.
Both of these methods have the Execution context (client-side reference) passed as the first parameter.

 

addPreSearch

Use this method to apply changes to lookups based on values current just as the user is about to view results for the lookup.
Xrm.Page.getControl(arg).addPreSearch(handler)
Arguments
Type: Function to add.

Remarks
This method is only available for Updated Entities.

The argument is a function that will be run just before the search to provide results for a lookup occurs. You can use this handler to call one of the other lookup control functions and improve the results to be displayed in the lookup.

 

removePreSearch

Use this method to remove event handler functions that have previously been set for the PreSearch event.
Xrm.Page.getControl(arg).removePreSearch(handler)
Arguments
Type: Function to remove.

Remarks
This method is only available for Updated Entities.

 

Use setNotification to display a notification about the control and clearNotification to remove it.

 

setNotification

Display a message near the control to indicate that data is not valid. When this method is used on Microsoft Dynamics CRM for tablets a red “X” icon appears next to the control. Tapping on the icon will display the message.
Xrm.Page.getControl(arg).setNotification(message,uniqueId)
Remarks
Setting a notification on a control will block the form from saving.
This method is only available for Updated Entities.
Arguments
message
Type: String: The message to display.

uniqueId
Type: String: The id to use to clear just this message when using clearNotification.

Return Value
Type: Boolean : Indicates whether the method succeeded.

 

clearNotification

Remove a message already displayed for a control.
Xrm.Page.getControl(arg).clearNotification(uniqueId)
Arguments
uniqueId
Type: String: The id to use to clear a specific message set using setNotification.

If the uniqueId parameter is not used the current notification shown will be removed.

Remarks
This method is only available for Updated Entities.
Return Value
Type: Boolean: Indicates whether the method succeeded.

 

Use the addOptionclearOptions, and removeOption methods to manipulate options available for OptionSet controls. See Sample: Create dependent OptionSets (picklists)for an example of these functions being put to use.

 

addOption

Adds an option to an option set control.
Xrm.Page.getControl(arg).addOption(option, [index])
ImportantImportant
This method does not check that the values within the options you add are valid. You should only add options that have been defined for the specific option set attribute that the control is bound to. Use the attribute getOptions or getOption methods to get valid option objects to add using this method.

Arguments
option
Type: Object: An option object to add to the OptionSet.

index
Type: Number: (Optional) The index position to place the new option. If not provided the option will be added to the end.

 

clearOptions

Clears all options from an Option Set control.
Xrm.Page.getControl(arg).clearOptions()

 

removeOption

Removes an option from an Option Set control.
Xrm.Page.getControl(arg).removeOption(number)
Arguments
Type: Number: The value of the option you want to remove.

 

Refreshes the data displayed in a Sub-Grid
Xrm.Page.getControl(arg).refresh()
noteNote
The refresh method is not available in the form OnLoad Event.

 

Sets the focus on the control.
Xrm.Page.getControl(arg).setFocus()

 

Specify whether a date control should show the time portion of the date.
Control Types: standard control for datetime attributes.
Xrm.Page.getControl(arg).setShowTime(bool)
Remarks
This method is only available for Updated Entities.

 

Determine which controls are visible and show or hide them using the getVisible and setVisible methods.

 

getVisible

Returns a value that indicates whether the control is currently visible.
noteNote
If the containing section or tab for this control is not visible, this method can still return true. To make certain that the control is actually visible; you need to also check the visibility of the containing elements.

Xrm.Page.getControl(arg).getVisible()
Return Value
Type: Boolean. True if the control is visible, otherwise false.

 

setVisible

Sets a value that indicates whether the control is visible.
Xrm.Page.getControl(arg).setVisible(bool)
Arguments
Type: Boolean. True if the control should be visible, otherwise false.

noteNote
When you selectively show fields to users in code that runs in the Onload event, we recommend that you configure the fields to not be visible by default and then usesetVisible(true) to show the fields when conditions are right. Using setVisible(false) to hide fields in the Onload event may result in the field briefly appearing to the user before being hidden.

If you are hiding a larger number of fields using setVisible(false), consider if you can group them together into tabs or sections and hide the tab or section rather than the fields separately. This will provide better performance.

 

Use these methods to interact with web resource and IFRAME controls.
noteNote
These methods does not work with Microsoft Dynamics CRM for tablets.

 

Data

Web resources have a special query string parameter named data to pass custom data. The getData and setData methods only work for Silverlight web resource added to a form. For more information see Passing Data from a Form to an Embedded Silverlight Web Resource.
For web page (HTML) web resources, the data parameter can be extracted from the getSrc method or set using the setSrc method.

 

getData

Returns the value of the data query string parameter passed to a Silverlight web resource.
Xrm.Page.getControl(arg).getData()
Return Value
Type: String. The data value passed to the Silverlight web resource.

 

setData

Sets the value of the data query string parameter passed to a Silverlight web resource.
Xrm.Page.getControl(arg).setData(string)
Arguments
Type: String. The data value to pass to the Silverlight web resource.

 

getInitialUrl

Returns the default URL that an IFRAME control is configured to display. This method is not available for web resources.
Xrm.Page.getControl(arg).getInitialUrl()
Return Value
Type: String. The initial URL.

 

getObject

Returns the object in the form that represents an I-frame or web resource.
Xrm.Page.getControl(arg).getObject()
Return Value
Type: Object. Which object depends on the type of control.

An IFRAME will return the IFrame element from the Document Object Model (DOM).

A Silverlight web resource will return the Object element from the DOM that represents the embedded Silverlight plug-in.

 

Src

IFRAMEs or web resources have a src property to define what to display in the embedded window. You can get or change the src property using the getSrc and setSrcmethods.

 

getSrc

Returns the current URL being displayed in an IFRAME or web resource.
Xrm.Page.getControl(arg).getSrc()
Return Value
Type: String. A URL representing the src property of the IFRAME or web resource.

 

setSrc

Sets the URL to be displayed in an IFRAME or web resource.
Xrm.Page.getControl(arg).setSrc(string)
Arguments
Type: String: The URL.

SOURCE : mscrm.com

The post Xrm.Page.ui control (client-side reference) appeared first on Microsoft Dynamics 365 Blog.

]]>
2768
Meta Data File Generator http://microsoftdynamics.in/2017/12/18/meta-data-file-generator/ Mon, 18 Dec 2017 07:26:00 +0000 http://microsoftdynamics.in/2017/12/18/meta-data-file-generator/ MSCRMMetaDataFileGenerator Tool For Report Creation In MS CRM This is a tool which is introduced for generating early bound class file without using SDK and boring cmd line. Follow the screen shots to know how to use this simple Tool Click here to download Keep visit for updates. SOURCE : mscrm.com

The post Meta Data File Generator appeared first on Microsoft Dynamics 365 Blog.

]]>

MSCRMMetaDataFileGenerator Tool For Report Creation In MS CRM

This is a tool which is introduced for generating early bound class file without using SDK and boring cmd line.

Follow the screen shots to know how to use this simple Tool

Click here to download

Keep visit for updates.

SOURCE : mscrm.com

The post Meta Data File Generator appeared first on Microsoft Dynamics 365 Blog.

]]>
2773
How to Disable Get CRM for Outlook Message in Microsoft dynamics CRM http://microsoftdynamics.in/2017/08/02/how-to-disable-get-crm-for-outlook-message-in-microsoft-dynamics-crm/ Wed, 02 Aug 2017 09:55:00 +0000 http://microsoftdynamics.in/2017/08/02/how-to-disable-get-crm-for-outlook-message-in-microsoft-dynamics-crm/ CRM regularly displays a Get CRM for Outlook message, regardless if the user has already downloaded and activated the Outlook client.Get CRM for Outlook message can be removed permanently by following below steps : 1. Naviagate to Settings, then to Administration, and then System Settings: 2. Set outlook client is advertised to users in the message bar...

The post How to Disable Get CRM for Outlook Message in Microsoft dynamics CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
CRM regularly displays a Get CRM for Outlook message, regardless if the user has already downloaded and activated the Outlook client.
Get CRM for Outlook message can be removed permanently by following below steps :

1. Naviagate to Settings, then to Administration, and then System Settings:

2. Set outlook client is advertised to users in the message bar = No

All done , now Get CRM for outlook message will not appear again.

Hope this was helpful.

Like us on facebook : https://www.facebook.com/microsoftdynamicsindia/

The post How to Disable Get CRM for Outlook Message in Microsoft dynamics CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
2776
Set only contact entity or only Account entity customer field lookup in case / Opportunity for ms crm http://microsoftdynamics.in/2016/03/11/set-only-contact-entity-or-only-account-entity-customer-field-lookup-in-case-opportunity-for-ms-crm/ Fri, 11 Mar 2016 10:01:00 +0000 http://microsoftdynamics.in/2016/03/11/set-only-contact-entity-or-only-account-entity-customer-field-lookup-in-case-opportunity-for-ms-crm/ Set potential customer look up field to only for contact entity record. By default out of the box functionality gave a pop up with two entity type -contact & account for customer lookup field , if your requirement is to set only contact or only account as entity it can be done using javascript as...

The post Set only contact entity or only Account entity customer field lookup in case / Opportunity for ms crm appeared first on Microsoft Dynamics 365 Blog.

]]>

Set potential customer look up field to only for contact entity record.

By default out of the box functionality gave a pop up with two entity type -contact & account for customer lookup field ,
if your requirement is to set only contact or only account as entity it can be done using javascript as given below ,

Both Contact and Account are viewed by Default 

Only Contact records are views
Only Contact is selected and read only

Both account and contact shown by default 
function disableaccountfromcustomer() {
debugger;
//timeout of 1sec
    setTimeout(function () {
debugger;
        var getid = $(‘#customerid_i’); //customer field id contain account and contact both view
        getid .attr(‘defaulttype’, ‘2’); // default advance find entity type to contact
        getid .attr(‘lookuptypes’, ‘2’); //change lookup view to contact
    }, 1000);

}

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Set only contact entity or only Account entity customer field lookup in case / Opportunity for ms crm appeared first on Microsoft Dynamics 365 Blog.

]]>
2784