My Photo

Microsoft Dynamics 365

Official Blog for Microsoft Dynamics Functional and Technical Solutions....
Browsing Category " JCRRIPT "

How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365

How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013


This code will help you..................

function dynamicoptionset() {

//get value in no in variable
    var totaldivision = Xrm.Page.getAttribute("fieldname" ).getValue();
    if (totaldivision == null || totaldivision == "" )
        return;
    else {

Passing URL to Iframe , Get and Set url to iframe using javascript in mscrm 2011



//Passing URL to Iframe
function iffffff() {

    var IFrame = Xrm.Page.ui.controls.get( "IFRAME_iframes" );
    //url value will  be saved in Url variable
    var Url = IFrame.getSrc();
    alert(Url);
    //add new url or add subs to the existing
    var trget = Url + "/movie" ;
    alert(trget);

USE HTML CODE USING JAVASCRIPT IN MSCRM 2011 , MSCRM 2013



function pwd_onchange() {
    var fieldTable1 = Xrm.Page.getAttribute( "new_password").getValue();
    fieldTable1.innerHTML = '<input tabIndex="1050" class="ms-crm-Text" id="new_password" style="ime-mode: auto;"  type="password" maxLength="100" _events="[object Object]" control="[object Object]" attrName="new_password" req="0"/>';
    Xrm.Page.getAttribute("new_password" ).setValue(Xrm.Page.getAttribute("new_password").innerHTML);
}

COPY MULTIPLE FIELD VALUES TO ANOTHER FIELDS USING JAVASCRIPT MS CRM 2011 , 2013


//When Both Address are same

function WhenSameAddress()
{

var check = Xrm.Page.getAttribute("new_bothaddressaresame").getValue() ;
if(check==true)
{
//Get Values from Correspondence Address
var street1 = Xrm.Page.getAttribute("new_castreet1").getValue() ;
var street2 = Xrm.Page.getAttribute("new_castreet2").getValue() ;
var street3 = Xrm.Page.getAttribute("new_castreet3").getValue() ;
var country = Xrm.Page.getAttribute("new_cacountry").getValue() ;
var state = Xrm.Page.getAttribute("new_castate").getValue() ;
var city= Xrm.Page.getAttribute("new_cacity").getValue() ;
var pincode = Xrm.Page.getAttribute("new_capincode").getValue() ;
//alert(street1 + street2 + street3);
//Set values to permanent Address

Xrm.Page.getAttribute("new_pastreet1").setValue(street1);
//Xrm.Page.getControl("new_pastreet1").setFocus(true);
Xrm.Page.getAttribute("new_pastreet2").setValue(street2);
Xrm.Page.getAttribute("new_pastreet3").setValue(street3);
Xrm.Page.getAttribute("new_pacountry").setValue(country);
Xrm.Page.getAttribute("new_pastate").setValue(state);
Xrm.Page.getAttribute("new_pacity").setValue(city);
Xrm.Page.getAttribute("new_papincode").setValue(pincode);



}
else
{
Xrm.Page.getAttribute("new_pastreet1").setValue(' ');
//Xrm.Page.getControl("new_pastreet1").setFocus();
Xrm.Page.getAttribute("new_pastreet2").setValue(' ');
Xrm.Page.getAttribute("new_pastreet3").setValue(' ');
Xrm.Page.getAttribute("new_pacountry").setValue();
Xrm.Page.getAttribute("new_pastate").setValue();
Xrm.Page.getAttribute("new_pacity").setValue();
Xrm.Page.getAttribute("new_papincode").setValue();


}
}


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