Tagged: dynamics crm

Start your Career with dynamics CRM

 

Functional/Technical Link Summary
Functional/Technical https://www.pluralsight.com/courses/microsoft-dynamics-365-crm-getting-started Discusses the Dynamics CRM 365 as A whole
Functional/Technical https://www.pluralsight.com/courses/dynamics-crm-what-everyone-needs-to-know Discusses the Capabilities of Dynamics CRM
Functional/Technical https://www.pluralsight.com/courses/no-code-xrm-development Discusses the Configuration/Customization Part without doing coding
Functional https://www.pluralsight.com/courses/microsoft-dynamics-365-sales Discusses the Sales Module in Depth
Functional https://mbspartner.microsoft.com/CRM/CourseModules/1335 Discusses the Service Module in Depth
Functional https://mbspartner.microsoft.com/CRM/CourseModules/1183/1566/18045 Discusses the Sales Module with Marketing Module in Depth
Functional/Technical https://www.pluralsight.com/courses/microsoft-dynamics-365-crm-customization-configuration Discusses the Customization and Configuration Basic
Technical https://mbspartner.microsoft.com/CRM/CourseModules/1324 Discusses the Customization and Configuration Advance
Technical https://www.pluralsight.com/courses/dynamics-crm-developer-part3 Discusses the .net Model of Dynamics CRM CRUD
Technical https://www.pluralsight.com/courses/dynamics-crm-developer-part4 Discusses the Advance Customization of Dynamics CRM
Technical https://mbspartner.microsoft.com/CRM/CourseModules/1185 Discusses the Installation of Dynamics CRM on- Premises and its other Modules
Functional/Technical https://mbspartner.microsoft.com/CRM/CourseModules/1327 Discusses Reporting Development in Dynamics CRM
Functional/Technical https://crmbook.powerobjects.com/ This is the CRM Website from Power Objects, for immediate reference it can be used
Technical https://www.tutorialspoint.com/microsoft_crm/ CRM Basics Customization Tutorials
Technical https://www.microsoft.com/en-us/download/details.aspx?id=50032 SDK for dynamics CRM
Functional/Technical https://technet.microsoft.com/en-us/library/hh699677.aspx?f=255&MSPPError=-2147217396

https://go.microsoft.com/fwlink/p/?linkid=838439

On Premises License Details
Functional/Technical https://technet.microsoft.com/library/dn467367.aspx

https://dynamics.microsoft.com/en-us/pricing/

Online License Details
Advertisements

What is Enterprise

In my recent meeting with one of my corporate client, we were discussing the issues that his company was facing and my first reaction to all of his problems were that why aren’t they using the Microsoft ERP Solution to overcome the short comings.

Many of the people are unaware of the fact that ERP can be solution to their complex tasks of daily routine. Moreover ERP is a very big Term, and utilizing all of its features is obviously not the solution, because ERP comes with a price. The main insight of using it is that you utilize its features completely and fully step by step; and leave the features which are not applicable to the company.

Before deciding which enterprise to go with its important that you understand that what an ERP Application can offer you and at what price. Deciding the ERP Solution heavily depends on its Licensing cost and its feature sets. This article will cover the Feature sets of ERP and Microsoft Offerings of ERP.

1        What is Enterprise

Enterprise software is an over-arching term for any software used in large organizations (whether business or government). Enterprise software, also known as enterprise application software (EAS), is computer software used to satisfy the needs of an organization rather than individual users. Such organizations would include businesses, schools, interest-based user groups, clubs, charities, or governments. Enterprise software is an integral part of a (computer-based) information system.

ERP is usually referred to as a category of business-management software — typically a suite of integrated applications—that an organization can use to collect, store, manage and interpret data from these many business activities.

2        Services Provided by Enterprise Software

The Services provided by the Enterprise Software varies from business to business but if we go through the features provided by some of the great ERP Product planners, following are some of them:

  • Interactive product catalogue: Management of All the products related activities, like its stock, barcode scanning, product features and attributes.
  • Enterprise content management: Enterprise content management (ECM) is a formalized means of organizing and storing an organization’s documents, and other content, that relate to the organization’s processes.
  • Customer relationship management: Customer relationship management (CRM) is an approach to managing a company’s interaction with current and potential customers. It uses data analysis about customers’ history with a company and to improve business relationships with customers, specifically focusing on customer retention and ultimately driving sales growth.
  • Enterprise resource planning: Enterprise resource planning (ERP) is the integrated management of core business processes, often in real-time and mediated by software and technology.
  • Business intelligence: Business Intelligence (BI) comprises the strategies and technologies used by enterprises for the data analysis of business information. BI technologies provide historical, current and predictive views of business operations
  • Project management: Project management is the discipline of initiating, planning, executing, controlling, and closing the work of a team to achieve specific goals and meet specific success criteria at the specified time.
  • Human resource management: Human resource management (HRM or HR) is the management of human resources. Commonly referred to as the HR Department [by whom?], it is designed to maximize employee performance in service of an employer’s strategic objectives.
  • Online shopping and online payment processing (Retail) : This feature of ERP is responsible to manage all the activities related to Retail, Which includes the product management, product stocks in ware house, payment processing, Online Portal or Mobile Apps for Online Shopping.
  • Enterprise application integration and Enterprise Form Automation: The Enterprise application must be Integra table with the third party tools and must allow the Configuration or customization for form automation.

These are some set of features that makes the ERP system to produce better results for the company.

2.1       Characteristics of an Enterprise Software:

In order to understand ERP beyond the services, it important to know, how the ERP will be performing when deployed in premises or used over the cloud. ERP systems typically include the following characteristics:

  • An integrated system
  • Operates in (or near) real time
  • A common database that supports all the applications
  • A consistent look and feel across modules
  • Installation of the system with elaborate application/data integration by the Information Technology (IT) department, provided the implementation is not done in small steps

2.2       Functional & Technical Areas of Enterprise Software:

As I have mentioned before, ERP itself .An ERP system covers the following common functional areas. In many ERP systems these are called and grouped together as ERP modules:

  • Finance & Accounting: General Ledger, Fixed Assets, payables including vouchering, matching and payment, receivables Cash Management and collections, cash management, Financial Consolidation
  • Management Accounting: Budgeting, Costing, cost management, activity based costing
  • Human resources: Recruiting, training, rostering, payroll, benefits, retirement and pension plans, diversity management, retirement, separation
  • Manufacturing: Engineering, bill of materials, work orders, scheduling, capacity, workflow management, quality control, manufacturing process, manufacturing projects, manufacturing flow, product life cycle management
  • Order Processing: Order to cash, order entry, credit checking, pricing, available to promise, inventory, shipping, sales analysis and reporting, sales commissioning.
  • Supply chain management: Supply chain planning, supplier scheduling, product configurator, order to cash, purchasing, inventory, claim processing, and warehousing (receiving, put away, picking and packing).
  • Project management: Project planning, resource planning, project costing, work breakdown structure, billing, time and expense, performance units, activity management
  • Customer relationship management: Sales and marketing, commissions, service, customer contact, call center support — CRM systems are not always considered part of ERP systems but rather Business Support systems (BSS).
  • Data services : Various “self–service” interfaces for customers, suppliers and/or employees

3        How Enterprise Evolved

The history of ERP’s are not too old, The Gartner Group first used the acronym ERP in the 1990s, where it was seen to extend the capabilities of material requirements planning (MRP), and the later manufacturing resource planning (MRP II), as well as computer-integrated manufacturing.[citation needed] Without replacing these terms, ERP came to represent a larger whole that reflected the evolution of application integration beyond manufacturing.

3.1       Traditional ERP

ERP systems experienced rapid growth in the 1990s. Because of the year 2000 problem and the introduction of the euro that disrupted legacy systems, many companies took the opportunity to replace their old systems with ERP.

ERP systems initially focused on automating back office functions that did not directly affect customers and the public. Front office functions, such as customer relationship management (CRM), dealt directly with customers, or e-business systems such as e-commerce, e-government, e-telecom, and e-finance—or supplier relationship management (SRM) became integrated later, when the Internet simplified communicating with external parties.

3.2       Modern ERP

Developers now make more effort to integrate mobile devices with the ERP system. ERP vendors are extending ERP to these devices, along with other business applications. Technical stakes of modern ERP concern integration—hardware, applications, networking, supply chains. ERP now covers more functions and roles—including decision making, stakeholders’ relationships, standardization, transparency, globalization, etc.

4        Reasons you need Enterprise

Following are the reasons that you need an enterprise

  • ERP can improve quality and efficiency of the business. By keeping a company’s internal business processes running smoothly, ERP can lead to better outputs that may benefit the company, such as in customer service and manufacturing.
  • ERP supports upper level management by providing information for decision making.
  • ERP creates a more agile company that adapts better to change. It also makes a company more flexible and less rigidly structured so organization components operate more cohesively, enhancing the business—internally and externally.
  • ERP can improve data security. A common control system, such as the kind offered by ERP systems, allows organizations the ability to more easily ensure key company data is not compromised.
  • ERP provides increased opportunities for collaboration=. Documents, files, forms, audio and video, emails. Often, each data medium has its own mechanism for allowing collaboration.=

5        Microsoft Enterprise Stack

Now by knowing the insights of the ERP, I think we are able to judge the Microsoft Offerings of ERP .In computing, Microsoft Dynamics is a line of enterprise resource planning (ERP) and customer relationship management (CRM) software applications. Microsoft Dynamics forms part of “Microsoft Business Solutions” Dynamics can be used with other Microsoft programs and services, such as SharePoint, Yammer, Office 365, Azure and Outlook. The Microsoft Dynamics focus-industries are retail, services, manufacturing, financial services, and the public sector. Microsoft Dynamics offers services for small, medium, and large businesses

Microsoft Dynamics ERP includes the following primary products:

5.1       Microsoft Dynamics 365 for Finance and Operations (formerly Dynamics AX)

Microsoft Dynamics 365 for Finance and Operations (formerly Dynamics AX) – multi-language, multi-currency enterprise resource planning (ERP) business software with global business management features for financial, human resources, and operations management as well as additional industry capabilities for retailers, professional service industries, financial service businesses, manufacturers, and public-sector organizations.

5.2       Microsoft Dynamics GP (formerly Great Plains Software)

Microsoft Dynamics GP (formerly Great Plains Software) – ERP software for small and midsize businesses: helps manage financials, supply chain, and employees.

5.3       Microsoft Dynamics NAV (formerly Navision)

Microsoft Dynamics NAV (formerly Navision) – business management solution that helps small and mid-sized businesses manage their financials, supply chain, and people. It features multiple languages and multiple currencies.

5.4       Microsoft Dynamics SL

Microsoft Dynamics SL (formerly Solomon IV) – designed for project-driven organizations in North America. Business management software that supports future business growth.

5.5       Microsoft Dynamics CRM

Microsoft Dynamics CRM is a customer relationship management application from Microsoft that provides sales, service, and marketing capabilities. Microsoft sells Microsoft Dynamics CRM separately from the ERP products. CRM is available either as on-premises software or as a software-as-a-service offering called “Microsoft Dynamics CRM Online”.

The Following charts Explains the Evolution of Microsoft ERP Stack

Top 10 Microsoft Dynamics CRM Integration

Proposing Dynamics CRM to The Small and large Scale Business Organization has been much easy because the system is capable of integrating with different Microsoft Products and 3rd Party Applications.

1

The integration Is easy and doesn’t require many configurations in the case of Microsoft Products. This article will discuss side by side the Integration capabilities of Dynamic CRM online And Dynamics CRM 2016.

1.1       Microsoft SharePoint

After using the Dynamics CRM the first thought comes into your mind that although you are storing in the information and the activities related to customer interaction or you are giving services to your client after the successful opportunity. But now you are willing to store the Documents Related to leads, opportunity or services may be.

Although this can be achieved through storing the Attachments in the ‘Notes’ Entity of the Dynamics CRM. So this full fills the solution of attachments. But now when I need to search for my document in the CRM, I have to go through all my notes section to get the information out.  Similarly, the storage issue is the bigger when you use the Dynamics CRM Online, the storage is filled in instantly when you use to CRM to store the attachments.

This is where SharePoint comes into play, Dynamics CRM Allows integration with SharePoint in two ways i.e. Server Based Integration and Client Based integration. Client based integration uses a sandbox solution will be obsolete in the future. Whereas server based solution is supported on both On-Premises and Online Integration. The Diagram shows the Two Way Path of integration between SharePoint and Dynamics CRM. Dynamics CRM Support the Following Server Based Integration:

  • SharePoint on – Premises to Dynamics CRM On-Premises
  • SharePoint online to Dynamics CRM On-Premises
  • SharePoint online to Dynamics CRM Online
  • SharePoint on – Premises to Dynamics CRM Online

2

1.2       Microsoft Outlook

I remember my client complaining about how hard is for him to track the email activities with his client in Dynamics CRM. He wasn’t at all comfortable with sending or receiving the emails through Dynamics CRM Web interface.  Moreover, most of the business user aren’t comfortable of logging into the CRM Web Interface and manage their email activities.

Dynamics CRM offers an outlook add-on which can heal the pain area of tracking the email activities or creating the leads directly from outlook. Following are the benefits integrating outlook with Dynamics CRM

  • Automatically link Outlook emails to associated CRM records including contacts and opportunities
  • Create personalized CRM views in Outlook
  • Access all CRM end-user functions in the Outlook interface
  • Open CRM records from any linked Outlook email
  • Rely on the familiarity of Outlook to reduce training costs & gain rapid user acceptance

The Above add-on can be used with both Dynamics CRM On-Premises and Dynamics CRM online.

4

1.3       Microsoft Exchange

In order to Outlook work with dynamics CRM, we need to integrate Dynamics CRM with Exchange. Dynamics CRM can be integrated with Exchange and Exchange Online using server-based integration as shown in the diagram.

With the Exchange Integration, the user will be able to sync all the contacts, appointments and tasks at a single place in CRM. And Similarly, the Automated Emails can only be generated from CRM if the integration is done with Exchange.

3

1.4       Yammer

I am a kind of a person who usually works with different sales team on an opportunity, I like communicating with my colleagues on lead, opportunities or even on services. All these communications are on mail on Phone calls, all though we can track the phone calls and emails in the dynamics CRM. But what about my users who are not a part of Dynamics CRM.

Using Activity feeds of Dynamics CRM just allow to be social with the dynamics CRM users, but not other users. So Dynamics CRM allows integration with Yammer so you can collaborate with the users inside the CRM and or users who aren’t the part of CRM. As getting social is equivalent to bring in success as a team.

Dynamics CRM Online and Dynamics CRM On-Premise allows integration with Yammer. But for that, you need to purchase Yammer Enterprise Subscription per user.

5

1.5       One Note

Getting notes while working on the Tasks, is a day to day routine for us. Getting Notes really helps us when we get back to the task. One of my clients had complained that it’s hard managing multiple leads because he needs something that reminds him that what was the last working he has done on the lead, opportunity, quotes, orders, Cases etc.

Dynamics CRM Online allows integrating One Note, and this requires the Subscription of Office 365. Integration with One Note:

  • You can easily take notes against each Opportunity, Leads, or any other entity
  • No more hustles when coming back to the pending Leads
  • Easy Interactive, capturing of notes.

6

1.6       Power BI

It’s a world of big Data, and the next big thing in the future is to analyze the data to extract the patterns and the main goal is to increase the revenue. Dynamics CRM offers rich Dashboards and charts but they have limitations. With the Help of Power BI, this limitation can be broken and the rich analysis can be done to get higher revenues. Reports on Power BI can be generated using Dynamics CRM OData Layer.

Dynamics CRM exposes its data using the DATA Web service Layer, Power BI can extract the data and based on it create the reports and rich Dashboards for executives and employees.

7

1.7       Office 365

Managing Hardware has been problematic for the corporates, as they have to hire IT, team, to manage the resources, which in turn bring cost Software, Hardware, and Resources to manage them. Office 365 being a cloud Solution offers Dynamics CRM online to easily integrate with the following:

  • SharePoint Online: Integrate for Document Management
  • Exchange Online: integrate to Generate emails from CRM to customers.
  • Skype For business: Communicate within a team and Contact the clients directly using Skype for business, by getting rid of traditional calling methodologies
  • One Note: track the notes against the leads, opportunities.
  • Yammer: Collaborate and work
  • Power BI: Rich Dashboards and Reports
  • Outlook App: Use outlook with Dynamics CRM Online, for creating the leads directly from email and much more.

1.8       ERP Integration (Dynamics AX, Dynamics GP, Dynamics NAV)

Microsoft has released a data integration tool for linking Microsoft Dynamics NAV/AX and Microsoft Dynamics CRM – creatively called the Microsoft Dynamics Connector.

The connector allows for out of the box bi-directional integration between the ERP entities and the CRM entities such as Customer, Invoices, Sales Orders, and Items. The connector works with both on-premise and online and uses web services for the data integration. The integration will look at the following entities in the Microsoft Dynamics ERP and Dynamics CRM:

8

1.9       Integration with ESB

Dynamics CRM exposes the SOAP based Interface through which the external Entities can connect and communicate with Dynamics CRM. Moreover following are the Areas in which integrations can be done:

  • Custom Workflow activities
  • Plug-ins
  • Discovery Service of Dynamics CRM

However, in order to integrate with the ESB, Following are the products that can be used to perform the operations in the Corporate Environment:

  • Azure Bus
  • BizTalk
  • Mule

9

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
**/