Failover Cluster ISCSI over domain Controller

I was trying to make a fail over cluster using the following settings

VM 1= SQLA, Domain Controller

VM2= SQLP, Domain computer

Moreover I have created three iscsi drives on the SQLA machine. the idea was to use these disks while creating the fail over Cluster. The Drives were created successfully on SQLA machine and even the SQLP machine initiator machine was able to  connect to the drives.

After running the Validation before creating the cluster I received the Following Warning1

Solution: First of all a cluster can not be created on domain controller machine. both the machine needs to be in the same organization unit.

however when we try creating the cluster we receive the following errors:

2

3

the “cluster service” stops responding and even the iscsi Drive created in the target doesn’t shows up.

so in order to resolve this issue, turn the Cluster Service to disable and restart the Microsoft ISCSI target service. this will at least bring back your iscsi drives on target.

Once again the cluster will not be created on domain controller machine. and the cluster service will only be enabled once the cluster is setup between at least two computers.

Moreover in order to remove the node from the failed cluster you need to run the power shell command:

For Removing the Cluster nodes, when failed to load:

import-module failoverclusters
clear-clusternode

moreover these are some more helping Cluster Commands once the cluster is created successfully:

getting the cluster name created
Get-Cluster
getting the specific cluster created
Get-Cluster -Name Cluster1

issue: http://serverfault.com/questions/777464/failover-cluster-creation-error

Advertisements

Dynamics CRM Common Framework

I was asked to develop a framework that consist of common used java-script in dynamics CRM. I ll be sharing my findings in the code mentioned below

/**
Test Functions -- Start
**/

/***
// Method Name: testFunction
// Method Description:
// Created: Sept 04, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: testParam Desc: description of individual param goes here
// return bool Desc: Success or Failure
// Revisions: Example:Sue (2/19/2009) - Method Name - Changes done --REF:SUE_1
***/
function testFunction(testparam) {
    var testVar = testparam;

    //start:SUE_1
    testVar = false;
    //end:SUE_1

    return testVar;
}

/***
// Method Name: testFunctionAlert
// Method Description:
// Created: Sept 04, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: testParam Desc: sending param from the Entity
// return bool Desc: Success or Failure
// Revisions: 
***/
function testFunctionAlert(testparam) {
    alert(testparam);
    return true;
}

/**
Test Functions -- End
**/



/**
Conversion Functions -- Start
**/

/***
// Method Name: toUpperCaseAlpha
// Method Description: Convert the Alpha Text in to UpperCase in the Attribute
// Created: Sept 04, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: srcTxtAttribObj Desc: Attribute Object Pass
// return undefined Desc: N/A
// Revisions: 
***/
function toUpperCaseAlpha(srcTxtAttribObj) {
    //need to discuss with kashif in order to do upper case do we need to confirm the field type
    var attributeVal = srcTxtAttribObj.getValue();
    if (IsAlpha(attributeVal)) {
        if (attributeVal) {
            srcTxtAttribObj.setValue(attributeVal.toUpperCase());
        }
    }
    else {
        //need to discuss with kashif if any other than alphabetic case happens
        srcTxtAttribObj.setValue("");
    }
}


/***
// Method Name: toTitleCaseAlpha
// Method Description: Convert the Alpha Text in to Title Case in the Attribute
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: srcTxtAttribObj Desc: Attribute Object Pass
// return undefined Desc: N/A
// Revisions: 
***/
function toTitleCaseAlpha(srcTxtAttribObj) {
    var attributeVal = srcTxtAttribObj.getValue();
    if (IsAlpha(attributeVal)) {
        if (attributeVal) {
            srcTxtAttribObj.setValue(attributeVal.replace(/\w+/g, function (txt) {
                return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
            }
                                                                )
                                                                );
        }
    }
    else {
        //need to discuss with kashif if any other than alphabetic case happens
        srcTxtAttribObj.setValue("");
    }
}


/***
// Method Name: toDateFormat_DDMMYYY
// Method Description: Convert the date in to DD MM YYYY
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: srcDateAttribObj Desc: Attribute Object Pass
// return undefined Desc: N/A
// Revisions: 
***/
function toDateFormat_DDMMYYY(srcDateAttribObj) {
    var dateAttributeVal = srcDateAttribObj.getValue();
    if (dateAttributeVal) {
        var tempDateObj = new Date(dateAttributeVal || Date.now()),
            month = '' + (tempDateObj.getMonth() + 1),
            day = '' + tempDateObj.getDate(),
            year = tempDateObj.getFullYear();

        //not required
        /*if (month.length < 2) month = '0' + month;
        if (day.length < 2) day = '0' + day;*/
        dateString = [day, month, year].join('/');
        tempDateObj = new Date(dateString);
        srcDateAttribObj.setValue(tempDateObj);
    }
}


/**
Conversion Functions -- End
**/


/**
Validation Functions -- Start
**/


/***
// Method Name: IsAlpha
// Method Description: Tests if the value entered is Alphabetic either with space or not
// Created: Sept 04, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: srcTxtObj Desc: pass text obj
// return bool  Desc: true if matches the criteria
// Revisions: 
***/
function IsAlpha(srcTxtObjVal) {

    var AplhaRegEx = /^[a-zA-Z ]+$/; //regular expression for Alphabet Or Space Character

    if (AplhaRegEx.test(srcTxtObjVal)) {
        return true;
    }
    return false;
}

/***
// Method Name: IsAlphaNumeric
// Method Description: Tests if the value entered is Alphabetic or Numeric either with space or not
// Created: Sept 04, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: srcTxtObj Desc: pass text obj
// return bool  Desc: true if matches the criteria
// Revisions: 
***/
function IsAlphaNumeric(srcTxtObjVal) {

    var AplhaNumRegEx = /^[a-zA-Z][a-zA-Z0-9_\s]*$/; //regular expression for Alphabet Or Space Or Numeric Character

    if (AplhaNumRegEx.test(srcTxtObjVal)) {
        return true;
    }
    return false;
}


/***
// Method Name: IsNumeric
// Method Description: Tests if the value entered is Alphabetic or Numeric either with space or not
// Created: Sept 04, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: srcTxtObj Desc: pass text obj
// return bool  Desc: true if matches the criteria
// Revisions: 
***/
function IsNumeric(srcTxtObjVal) {

    var AplhaNumRegEx = /^[0-9]+$/; //regular expression for Numeric Character

    if (AplhaNumRegEx.test(srcTxtObjVal)) {
        return true;
    }
    return false;
}






/***
// Method Name: IsFieldExistsOnForm
// Method Description: Confirms if the field exists on form
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: pass field name
// return bool  Desc: true if Field Exists
// Revisions: 
***/
function IsFieldExistsOnForm(fieldName) {
    var fieldAttribute = Xrm.Page.getAttribute(fieldName);
    return fieldAttribute != null;
}

/***
// Method Name: IsSectionExistsOnForm
// Method Description: Confirms if the section exists on form
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: tabName, sectionName Desc: pass tab and section name
// return bool  Desc: true if Field Exists
// Revisions: 
***/
function IsSectionExistsOnForm(tabName, sectionName) {
    var section = Xrm.Page.ui.tabs.get(tabName).sections.get(sectionName);
    return section != null;
}

/***
// Method Name: IsTabExistsOnForm
// Method Description: Confirms if the section exists on form
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: tabName Desc: pass tab name
// return bool  Desc: true if Field Exists
// Revisions: 
***/
function IsTabExistsOnForm(tabName) {
    var tab = Xrm.Page.ui.tabs.get(tabName);
    return tab != null;
}


/**
Validation Functions -- end
**/




/**Utility Functions -- start
**/


/***
// Method Name: GetOptionSetText
// Method Description: Gets the option set Text
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: pass the field name
// return string  Desc: returns the option set Text Name
// Revisions: 
***/
function GetOptionSetText(fieldName) {
    if (IsFieldExistsOnForm(fieldName)) {
        var text = '';
        if (Xrm.Page.getAttribute(fieldName).getValue() != null) {
            text = Xrm.Page.getAttribute(fieldName).getSelectedOption().text;
        }
        return text;
    }
}

/***
// Method Name: GetLookupValueID
// Method Description: Gets the Look up Value ID
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: lookUpName Desc: pass the Look up Field Name
// return string  Desc: returns the lookupid
// Revisions: 
***/
function GetLookupValueID(lookUpName) {
    var name = '';
    var lookupid;
    var lookupObject = Xrm.Page.getAttribute(lookUpName);

    if (lookupObject != null) {
        var lookUpObjectValue = lookupObject.getValue();
        if ((lookUpObjectValue != null)) {
            name = lookUpObjectValue[0].name;
            lookupid = lookUpObjectValue[0].id;
        }
    }

    return lookupid;
}

/***
// Method Name: SetLookupValue
// Method Description: Sets the Look up Value for a particular Entity
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: lookUpName Desc: pass the Look up Field Name
// return string  Desc: returns the lookupid
// Revisions: 
***/
function SetLookupValue(lookup, name, id, entityType) {
    if (IsFieldExistsOnForm(lookup)) {
        var lookupid = null;
        var lookupObject = Xrm.Page.getAttribute(lookup);
        var value = new Array();
        value[0] = new Object();
        value[0].id = id;
        value[0].name = name;
        value[0].entityType = entityType;

        Xrm.Page.getAttribute(lookup).setValue(value);
    }
}

/***
// Method Name: GetFormType
// Method Description: get form type
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: N\A Desc: N\A
// return string  Desc: returns the form type
// Revisions: 
***/
function GetFormType() {
    var FormType = Xrm.Page.ui.getFormType();
    if (FormType != null) {
        switch (FormType) {
            case 1:
                return "create";
                break;
            case 2:
                return "update";
                break;
            case 3:
                return "readonly";
                break;
            case 4:
                return "disabled";
                break;
            case 6:
                return "bulkedit";
                break;
            default:
                return null;
        }
    }
}

/***
// Method Name: HideField
// Method Description: hides the field
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: field name that needs to be hidden
// return N/A  Desc: N/A
// Revisions: 
***/
function HideField(fieldName) {
    if (IsFieldExistsOnForm(fieldName)) {
        var fieldControl = Xrm.Page.ui.controls.get(fieldName);
        fieldControl.setVisible(false);
    }
}

/***
// Method Name: showField
// Method Description: shows the field
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: field name that needs to be hidden
// return N/A  Desc: N/A
// Revisions: 
***/
function showField(fieldName) {
    if (IsFieldExistsOnForm(fieldName)) {
        var fieldControl = Xrm.Page.ui.controls.get(fieldName);
        fieldControl.setVisible(true);
    }
}

/***
// Method Name: EnableField
// Method Description: Enable the field on the form
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: field name that needs to be enabled
// return N/A  Desc: N/A
// Revisions: 
***/
function EnableField(fieldName) {
    if (IsFieldExistsOnForm(fieldName)) {
        var fieldControl = Xrm.Page.ui.controls.get(fieldName);
        fieldControl.setDisabled(true);
    }
}


/***
// Method Name: DisableField
// Method Description: Disable the field on the form
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: field name that needs to be enabled
// return N/A  Desc: N/A
// Revisions: 
***/
function DisableField(fieldName) {
    if (IsFieldExistsOnForm(fieldName)) {
        var fieldControl = Xrm.Page.ui.controls.get(fieldName);
        fieldControl.setDisabled(false);
    }
}

/***
// Method Name: SetFocusField
// Method Description: Focus on the Field
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: fieldName Desc: field name that needs to be focused
// return N/A  Desc: N/A
// Revisions: 
***/
function SetFocusField(fieldName) {
    if (IsFieldExistsOnForm(fieldName)) {
        var fieldControl = Xrm.Page.ui.controls.get(fieldName);
        fieldControl.setFocus();
    }
}

/***
// Method Name: ShowTab
// Method Description: show the tab
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: tabName Desc: tab name that needs to be shown
// return N/A  Desc: N/A
// Revisions: 
***/
function ShowTab(tabName) {
    if (IsTabExistsOnForm(tabName)) {
        Xrm.Page.ui.tabs.get(tabName).setVisible(true);
    }
}

/***
// Method Name: HideTab
// Method Description: Hide the Tab
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: tabName Desc: tab name that needs to be hidden
// return N/A  Desc: N/A
// Revisions: 
***/
function HideTab(tabName) {
    if (IsTabExistsOnForm(tabName)) {
        Xrm.Page.ui.tabs.get(tabName).setVisible(false);
    }
}


/***
// Method Name: ShowSection
// Method Description: Show the section
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: tabName,sectionName Desc: tabName which contains the Section
// return N/A  Desc: N/A
// Revisions: 
***/
function ShowSection(tabName, sectionName) {
    if (IsSectionExistsOnForm(tabName, sectionName)) {
        Xrm.Page.ui.tabs.get(tabName).sections.get(sectionName).setVisible(true);
    }
}

/***
// Method Name: HideSection
// Method Description: Show the section
// Created: Sept 07, 2015 04:09PM
// Author: Sabih Ahmed Khan
// param: tabName,sectionName Desc: tabName which contains the Section
// return N/A  Desc: N/A
// Revisions: 
***/
function HideSection(tabName, sectionName) {
    if (IsSectionExistsOnForm(tabName, sectionName)) {
        Xrm.Page.ui.tabs.get(tabName).sections.get(sectionName).setVisible(false);
    }
}


/***
// Method Name: sectiondisable
// Method Description: Disable the Section
// Created: Sept 07, 2015 04:09PM
// Author: N/A
// param: tabName,sectionName Desc: tabName which contains the Section
// return N/A  Desc: N/A
// Revisions: 
***/
function sectiondisable(sectionname, disablestatus) {
    var ctrlName = Xrm.Page.ui.controls.get();
    for (var i in ctrlName) {
        var ctrl = ctrlName[i];
        var ctrlSection = ctrl.getParent().getName();
        if (ctrlSection == sectionname) {
            ctrl.setDisabled(disablestatus);
        }
    }
}

/***
// Method Name: setTodayDate
// Method Description: Function Moved Sets the Today Date
// Created: Sept 07, 2015 04:09PM
// Author: N/A
// param: dateFieldAttrib Desc: date field attribute to be passed in
// return N/A  Desc: N/A
// Revisions: 
***/
function setTodayDate(dateFieldAttrib) {
    var currentDate = new Date();
    dateFieldAttrib.setValue(currentDate);
}
/**Utility Functions -- end
**/

        

Missing Default Order Settings with DIXF Products import

guyterry's Dynamics AX blog

I was importing new Released Products into Microsoft Dynamics AX 2012 R3 using Data Import Export Framework’s ‘Products’ entity. Although the import was apparently successful, I found that fields on the Default Order Settings form were all greyed out.

Default Order Settings All fields on the Default Order Settings form are greyed out.

I had last encountered this problem nearly two years ago in AX 2012 FP. At that time, DIXF was in Beta, and Microsoft were not accepting bug reports. Thinking about filing one now, I decided to investigate the cause. The Default Order Settings form has three datasources:

  • InventItemInventSetup
  • InventItemPurchSetup
  • InventItemSalesSetup

Looking at these tables, I could see that DIXF had created records for my imported items, but the field ‘InventDimIdDefault’ was blank. With items created using the AX client (and which did not have a default site defined) this field contained the value ‘AllBlank’. I decided, for a quick fix, to…

View original post 403 more words

CRM 2011 Useful JScripts

useful quick api

Lakshman Reddy's Blog

Get the value from a CRM field
var value = Xrm.Page.getAttribute(“CRMFieldSchemaName”).getValue();

Set the value of a CRM field
Xrm.Page.getAttribute(“CRMFieldSchemaName “).setValue(“New Value”);

Get the value from a CRM OptionSet field
var value = Xrm.Page.getAttribute(“CRMOptionSetSchemaName”).getValue();

Get the text from a CRM OptionSet field
var text = Xrm.Page.getAttribute(“CRMOptionSetSchemaName”).getText();

Set the value of a CRM OptionSet field
Xrm.Page.getAttribute(“CRMOptionSetSchemaName”).setValue(“1”); // OptionSet Value

Get the selected text of a CRM OptionSet field
Xrm.Page.getAttribute(“CRMOptionSetSchemaName”).getSelectedOption().text;

Get the selected value of a CRM OptionSet field
Xrm.Page.getAttribute(“CRMOptionSetSchemaName”).getSelectedOption().value;

Get the text and value of a CRM Lookup field
var lookupObject = Xrm.Page.getAttribute(“CRMLookupSchemaName”).getValue();
lookupObject[0].name; // text of lookup
lookupObject[0].id; // Guid of lookup

Set the value of a CRM Lookup field
var lookupData = new Array();
var lookupItem = new Object();
lookupItem.id = “4A2A54CB-349C-E111-8D26-1CC1DEE8DA78”; // Guid of record
lookupItem.name = “New Contact”; // Entity record name
lookupItem.entityType = “EntitySchemaName”;
lookupData[0] = lookupItem;
Xrm.Page.getAttribute(“CRMLookupSchemaName”).setValue(lookupData);

Disable CRM field
Xrm.Page.ui.controls.get(“CRMFieldSchemaName”).setDisabled(true);

Hide CRM field
Xrm.Page.ui.controls.get(“CRMFieldSchemaName”).setVisible(false);

Hide…

View original post 271 more words

Get Lookup id / Text / EntityName in CRM using JavaScript

Arun Potti's MS CRM blog

It is required sometimes to get Lookup Id / Text / Entity schema name of the selected record from Lookup. To get that follow the below task.

Task: Get record GUID, record Name and Entity Type from the Phone Call entity OnChange of To field.

Solution: Please follow the below steps,

Step 1: Create a web resource of type Jscript and name it as “new_phonecall”.

Step 2: Click on Text Editor, copy paste the below code.

function toOnChange(){
getLookupDetails("to");
}

function getLookupDetails(lookupSchemaName) {
var lookupObj = Xrm.Page.getAttribute(lookupSchemaName); //Check for Lookup Object
if (lookupObj != null) {
var lookupObjValue = lookupObj.getValue();//Check for Lookup Value
if (lookupObjValue != null) {
var lookupEntityType = lookupObjValue[0].entityType, //To get EntityName
lookupRecordGuid = lookupObjValue[0].id, // To get record GUID
lookupRecordName = lookupObjValue[0].name; //To get record Name  if (lookupEntityType != null && lookupRecordGuid != null && lookupRecordName != null) { Xrm.Utility.alertDialog("Entity Type : " + lookupEntityType…

View original post 96 more words

FetchXML Formatter Tool

Arun Potti's MS CRM blog

It is a Light weight windows application and this tool will be helpful when you are extensively working with FetchXML in Javascript / C# code to get desired result.

Functionality:

It will take FetchXML from Advance Find as an input and convert that into desired format, which can be used into Javascript / C# for further coding.

Pros:

  1. No Need to spend time for FetchXML formatting
  2. It is easy to use.
  3. Works for both Javascript and C# code

Example:

Let us take a simple example of the below FetchXML,

 <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="contact">
    <attribute name="fullname" />
    <attribute name="telephone1" />
    <attribute name="emailaddress1" />
    <attribute name="contactid" />
    <order attribute="fullname" descending="false" />
    <filter type="and">
      <condition attribute="ownerid" operator="eq-userid" />
      <condition attribute="statecode" operator="eq" value="0" />
    </filter>
  </entity>
</fetch>

Provide this as an input to FetchXML formatter Tool, 1. Check Javascript radio…

View original post 140 more words

Retrieve records using Fetch XML & Java Script in CRM 2011/13

beautifully explained fetch XML

Arun Potti's MS CRM blog

Task: Retrieve Arun Potti Business Phone on onload of Contact record in Contact Entity using FetchXML & Javascript

Solution:

Step 1: Goto http://xrmsvctoolkit.codeplex.com/, and download the Zip folder. Unzip XrmServiceToolkit the folder.

Step 2: Open the XrmServiceToolkit folder, you can find the below Javascript files.

FetchXML - Pic 1

Goto Microsoft Dynamics CRM –> Settings –> Customization –> Webresources.

Create jquery, json2 and XrmServiceToolkit javascript webresources. While creating web resources browse for the respective files and provide the path of XRMServiceToolkit.

Step 3: Add all 3 files to the contact entity,

FetchXML - Pic 2

Step 4: Goto Microsoft Dynamics CRM –> Sales –> Contacts, click on Advance find button. Create new criteria as shown below by clicking on New button,

FetchXML - Pic 3

Step 5: Click on Download Fetch XML button, to get FetchXML code. You can see the below XML,

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">  <entity name="contact">    <attribute name="fullname" />    <attribute name="telephone1" />    <attribute name="contactid" />…

View original post 218 more words