WebMasterSam

.Net, SEO, Dynamics CRM, AdSense/AdWords, Dating sites, Silverlight, Web hosting and more

About me

I'm an IT consultant working primarily with the .Net Framework as a developper and architect. I also work on my own on my personnal dating websites. I've been developping websites since 2000.

If you like what I do, feel free to support me

PayPal - The safer, easier way to pay online!

Bookmark

Bookmark and Share

Last comments

None

Microsoft Dynamics CRM 4.0 EntityName list with codes

Like many people who work with CRM, you may need sometime or another the complete list of CRM entities with name and code. I've been searching the internet many times but today I decided to create this blog post to have it somewhere.

So, here it is !

Entity name Description Value
Unknown Unknown 0
Account Account 1
AccountLeads Account lead link 16
ActivityMimeAttachment E-mail Attachment 1001
ActivityParty Person assoc. to activity 135
ActivityPartyRollupByAccount ? 4603
ActivityPartyRollupByContact ? 4604
ActivityPointer Activity 4200
Annotation Note 5
AnnualFiscalCalendar Annual fiscal calendar 2000
Appointment Appointment 4201
AttributeMap Attribute map 4601
BulkImport Bulk import job 4407
BulkOperation Bulk operation job 4406
BulkOperationLog Bulk operation job log 4405
BusinessUnit Business unit 10
BusinessUnitMap Business unit map 6
BusinessUnitNewsArticle Article 132
Calendar Calendar 4003
CalendarRule Calendar rule 4004
Campaign Campaign 4400
CampaignActivity Campaign activity 4402
CampaignActivityItem Campaign activity item 4404
CampaignItem Campaign item 4403
CampaignResponse Response 4401
Commitment Commitment 4215
Competitor Competitor 123
CompetitorAddress Competitor address 1004
CompetitorProduct Competitor Product 1006
CompetitorSalesLiterature Competitor Sales Literature 26
ConstraintBasedGroup   4007
Contact Contact 2
ContactInvoices Contact invoice link 17
ContactLeads Contact lead link 22
ContactOrders Contact order link 19
ContactQuotes Contact quote link 18
Contract Contract 1010
ContractDetail Contract detail 1011
ContractTemplate Contract template 2011
CustomerAddress Customer address 1071
CustomerOpportunityRole Customer opportunity role 4503
CustomerRelationship Customer relationship 4502
Discount Discount 1013
DiscountType Discount type 1080
DocumentIndex Document 126
Email Email 4202
EntityMap Entity map 4600
Equipment Equipment 4000
Fax Fax 4204
FilterTemplate Filter template 30
FixedMonthlyFiscalCalendar Fixed monthly fiscal calendar 2004
ImportConfig Importation configuration 4408
Incident Case 112
IncidentResolution Case resolution 4206
IntegrationStatus Integration status 3000
InternalAddress Address 1003
Invoice Invoice 1090
InvoiceDetail Invoice detail 1091
KbArticle Kknoledge base article 127
KbArticleComment Kknoledge base article comment 1082
KbArticleTemplate Kknoledge base article template 1016
Lead Lead 4
LeadAddress Lead address link 1017
LeadCompetitors Lead competitor link 24
LeadProduct Lead product link 27
Letter Letter 4207
License License 2027
List List 4300
ListMember List member link 4301
MonthlyFiscalCalendar Monthly fiscal calendar 2003
Opportunity Opportunity 3
OpportunityClose Opportunity close 4208
OpportunityCompetitors Opportunity competitor link 25
OpportunityProduct Opportunity product link 1083
OrderClose Order close 4209
Organization Organization 1019
OrganizationMap Organization map 7
OrganizationUI Organization UI 1021
PhoneCall Phone call 4210
PluginType Plugin type 4602
PriceLevel Price level 1022
PrincipalObjectAccess Principal object access 11
Privilege Privilege 1023
PrivilegeObjectTypeCodes Privilege object type codes 31
Product Product 1024
ProductAssociation Product association 1025
ProductPriceLevel Product price level 1026
ProductSalesLiterature Product sales literature 21
ProductSubstitute Product substitute 1028
QuarterlyFiscalCalendar Quarterly fiscal calendar 2002
Queue Queue 2020
QueueItem Queue item 2029
Quote Quote 1084
QuoteClose Quote close 4211
QuoteDetail Quote detail 1085
RelationshipRole Relationship role 4500
RelationshipRoleMap Relationship role map 4501
Resource Resource 4002
ResourceGroup Resource group 4005
ResourceSpec Resource specification 4006
Role Role 1036
RolePrivileges Role privilege link 12
RoleTemplate Role template 1037
RoleTemplatePrivileges Role template privilege link 28
SalesLiterature Sales literature 1038
SalesLiteratureItem Sales literature item 1070
SalesOrder Order 1088
SalesOrderDetail Order detail 1089
SavedQuery Saved advanced query 1039
SemiAnnualFiscalCalendar Semi annual fiscal calendar 2001
Service Service 4001
ServiceAppointment Service appointment link 4214
ServiceContractContacts Service contract contact link 20
Site Site 4009
StatusMap Status map 1075
StringMap String map 1043
Subject Subject 129
Subscription Subscription 29
SystemUser User 8
SystemUserLicenses User license link 13
SystemUserPrincipals User principal link 14
SystemUserRoles User role link 15
Task Task 4212
Team Team 9
TeamMembership Team membership 23
Template Template 2010
Territory Territory 2013
UnresolvedAddress Unresolved address 2012
UoM Unit of measure 1055
UoMSchedule Unit group 1056
UserFiscalCalendar User fiscal calendar 1086
UserQuery Query 4230
UserSettings User settings 150
WFAction Workflow action 1061
WFActionLog Workflow action log 1062
WFCondition Workflow condition 1064
WFEventLog Workflow event log 1065
WFEventQueue Workflow event queue 1092
WFParameter Workflow parameter 1066
WFProcess Workflow process 121
WFProcessInstance Workflow process instance 122
WFRule Workflow rule 1067
WFRuleLog Workflow rule log 1068
WFStep Workflow step 1069
User Defined UserDefined 10000+
Posted: Mar 09 2011, 07:33 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Changing Microsoft CRM Dynamics 4.0 Encoding

Recently I worked on a project involving Microsoft CRM Dynamics 4.0 and because the application was in french we decided to change the encoding from UTF-8 to ISO-8859-1 which is quite simple to do but we ended up with a lot of problems...

If you change the encoding of the CRM in the web.config (globalization tag), CRM will then start to show you weird things (horrible characters) instead of accents. The reason is simple, if you convert a text (containing accents) from an encoding like ISO-8859-1 (or Windows-1252) to URF-8 all the accents will be replaced with fucked up characters, leaving normal non-accentuated characters intact.

I discovered that CRM seems to have parts that are always running under UTF-8 instead of following the encoding in the web.config file, so this cause a constant-encoding-converting-glitch. I did not found a solution to solve those CRM glitches so I decided to come back to default CRM encoding: UTF-8.

Beeing in UTF-8 causes convertion problems to the files I add to the CRM (.js - JavaScript). Because my files I create are in Windows-1252 (default), when CRM flush them to the client, they get "converted" and so the accents are beeing mashed up, this causing IE to not load those .js files. The only solution for this is to manualy change the encoding of the .js files to UTF-8 so that they don't get converted automatically.

Conclusion

Never change the CRM encoding; let it to UTF-8 and adapt your stuff.

Microsoft Dynamics CRM 4.0 tabSet list

As I explained in another article, when you want to retrieve to name of the entity displayed in a CRM page it's easy to check for the etc parameter and then translate the number to a name by calling the MetaData service. But, as I also said, when you check for the page "areas.aspx", you don't have the entity number of the related entity... instead you get a tabSet parameter. The tabSet contains either the relationship name or a tabSet name...

Because the same related entity can have multiple tabSet names, I decided to list everything I found to simplify the job for you (I all got those using Fiddler and clicking on every link of related entities in CRM...).

Area name Related entity name
areaActivities ActivityPointer
areaActivityHistory ActivityPointer
areaAsyncOperations WFProcess
areaRelationships CustomerRelationship
areaRelationship CustomerRelationship
areaContacts Contact
areaSubConts Contact
areaSubAccts Account
areaAddresses CustomerAddress
areaOpps Opportunity
areaOpportunities Opportunity
areaQuotes Quote
areaOrders SalesOrder
areaInvoices Invoice
areaService Incident
areaCases Incident
areaContract Contract
areaListsInSFA List
areaCampaignsInSFA Campaign
areaProducts Product
areaSubs Product
areaComp Competitor
areaComps Competitor
areaSalesLit SalesLiterature
areaItems ProductPriceLevel
areaContractLines ContractDetail
areaRoles Role
areaTeams Team
areaServices Service
areaResourceGroup ResourceGroup
areaResourceGroups ResourceGroup
areaUsers SystemUser
areaBiz BusinessUnit
areaResource Resource
areaUnits UoM
areaPrices ProductPriceLevel
areaMembers SystemUser
areaExistingProducts QuoteDetail
SalesOrder
Invoice
areaWriteInProducts QuoteDetail
SalesOrder
Invoice

All this may save you some hours of clicking !

Posted: Apr 27 2009, 13:46 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net | CRM 4.0 | Programming
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Retrieving the entity name or number from a CRM page URL

Recently I had to create an HttpModule that catch every call to a CRM page and inject some JavaScript code in it. The first the HttpModule does is to retrieve to entity name (or number) and instanciates a class that contains some information about the page (organization, page url, entity name, entity number, etc...). Normally it is easy, you can get the etc querystring parameter to get the number and then call the MetaData service to get the entity name. Sometimes the querystring parameter gets another name... it's not always etc: it can be "etc", "oType" or "iObjType".

Life will be too easy if everytime when want to get the entity number we just have to check for the querystring parameter... so Microsoft though about a more challenging way to get the entity number. You will face that if you catch the "areas.aspx" page. This page is the one that is called when you click a left navigation bar item (in an entity record).

Let's check some different URLs you can get in CRM :

For the entity form...

...of CRM entities

 - http://crmserver/org/sfa/accts/edit.aspx (Account)
 - http://crmserver/org/sfa/conts/edit.aspx (Contact)
 - http://crmserver/org/activities/email/edit.aspx (Email activity)

...of user-defined entities

 - http://crmserver/org/userdefined/edit.aspx?etc=#entity_number#

These looks very easy to understand and it's easy to retrieve the entity numer or name. You will have to hard-code the entity number or name in your code when you get CRM entities because the URL (page) tells which entity it is. For the user-defined, you simply get the "etc" parameter in the QueryString.

For the entity record list...

...of the activites, campains and cases

 - http://crmserver/org/workplace/home_activities.aspx
 - http://crmserver/org/ma/home_camps.aspx
 - http://crmserver/org/cs/home_cases.aspx

...of anything else

 - http://crmserver/org/_root/homepage.aspx?etc=#entity_number#

These looks also very easy to understand but you will notice that barely everything (including user-defined entities) are shown in the same page (homepage.aspx) so you will not have to hard-code a lot of thing. And now, for the entity relationship view (the one you get on the right side of the CRM entity form when you click on a left navigation bar item of the entity form)...

...of CRM entities

 - http://crmserver/org/sfa/accts/areas.aspx?oId=[GUID]&oType=1&security=[number]&tabSet=areaContacts (Account showing related contacts)

...of user-defined entities (one-to-many relationship)

 - http://crmserver/org/sfa/accts/areas.aspx?oId=[GUID]&oType=1&security=[number]&tabSet=account_new_myentityname (Account showing related new_myentityname)

...of user-defined entities (many-to-many relationship)

 - http://crmserver/org/sfa/accts/areas.aspx?oId=[GUID]&oType=1&security=[number]&tabSet=areaaccount_new_myentityname (Account showing related new_myentityname)

This not sound very cool... the same querystring parameter (tabSet) can contains 3 different types of value... depending on whether the related entity is custom or built-in and if it is a one-to-many or many-to-many relationship... !

More horrible than this, for the same related entity (shown in different parent entity), the tabSet parameter will not be named the same way (but sometimes it is...). For example, if the related entity is a contact, the tabSet can be named "areaContacts" or "areaSubConts". Wow ! I don't have to tell you it has to be a lot hard-coded !

For the user-defined entities it is a lot more simple than this; the value in the tabSet is the relationship name. This is cool because you can query the CRM MetaData service and get both entities of the relationship. There's only a little twist with this... when you have a many-to-many relationship, the tabSet starts with "area"... I don't know why but MS decided to do it this way so we have to deal with it.

Because the tabSet parameter is a pain, I decided to write an article listing all the different tabSet values I've found in hour of clicking in CRM (because I didn't find it on the web).

Posted: Apr 27 2009, 12:55 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net | CRM 4.0 | Programming
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

JavaScript AJAX wrapper for CRM 4.0

If you already worked with Microsoft Dyamics CRM 4.0, you know that almost everything you do with JavaScript is considered a "hack" because you manipulate the DOM of the pages by yourself. Because of this I decided to give you some help with differents helper methods I developped at my day job.

I'm currently working on a big development project involving CRM.

This class is a clean wrapper for all your AJAX calls.

JavaScript AJAX wrapper for CRM 4.0


function AjaxWrapper()
{
    var object = this;

    object.Request = NewRequest();
    object.Request.onreadystatechange = CompleteRequest;

    this.Sync = true;
    this.Method = "GET";
    this.URL = "";
    this.WebServiceMethod = "";
    this.Parameters = new ParameterCollection();

    this.Execute = ExecuteRequest;
    this.AsyncCallbackMethod = null;

    this.ResultXML = null;
    this.ResultText = null;

    function NewRequest()
    {
        if (window.XMLHttpRequest)
            return new XMLHttpRequest();
        else
            return new ActiveXObject("Microsoft.XMLHTTP");
    }

    function ExecuteRequest()
    {
        var parameters = object.Parameters.toString();        

        ResetRequest();        

        if (this.Method.toUpperCase() == "POST")
        {
            if (object.WebServiceMethod.length > 0)
                object.Request.open(object.Method, object.URL + "/" + object.WebServiceMethod, !object.Sync);
            else
                object.Request.open(object.Method, object.URL, !object.Sync);            

            object.Request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            object.Request.send(object.Parameters);
        }
        else if (this.Method.toUpperCase() == "GET")
        {
            if (object.WebServiceMethod.length > 0 && parameters.length > 0)
                object.Request.open(object.Method, object.URL + "/" + object.WebServiceMethod + "?" + parameters, !object.Sync);
            else if (object.WebServiceMethod.length > 0)
                object.Request.open(object.Method, object.URL + "/" + object.WebServiceMethod, !object.Sync);
            else if (parametres.length > 0)
                object.Request.open(object.Method, object.URL + "?" + parameters, !object.Sync);
            else
                object.Request.open(object.Method, object.URL, !object.Sync);            

            object.Request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            object.Request.send();
        }
        else
        {
            throw "The method '" + this.Method.toUpperCase() + "' is not supported !";
        }        

        if (object.Sync)
            FinishRequest(object.Request.responseText);
    }

    function CompleteRequest()
    {
        if (object.Request.readyState == 4)
        {
            if (object.Request.status == 200)
            {
                FinishRequest(object.Request.responseText);                

                if (object.AsyncCallbackMethod != null)
                    object.AsyncCallbackMethod();
            }
        }
    }

    function ResetRequest()
    {
        object.Request = NewRequest();
        object.Request.onreadystatechange = CompleteRequest;
    }    

    function FinishRequest(retourTexte)
    {
        var xmlDoc = new ActiveXObject("MSXML2.DOMDocument");

        object.ResultText = object.Request.responseText;        

        try
        {
            xmlDoc.loadXML(object.Request.responseText);            

            if (xmlDoc.parsed && xmlDoc.xml.length > 0)
                object.ResultXML = xmlDoc;
            else
                object.ResultXML = null;
        }
        catch (ex)
        {
            object.ResultXML = null;
        }
    }
}

The ParameterCollection to help adding QueryString parameters safely (well-encoded values)


function ParameterCollection()
{
    this._list = new Array();
    
    this.Add = function (name, value)
    {
        this._list[this._list.length] = new Array(name, value);
    }    

    this.toString = function ()
    {
        var queryString = "";        

        for (var i=0; i<this._list.length; i++)
        {
            if (queryString.length > 0)
                queryString = queryString + "&";            

            queryString = queryString + this._list[i][0] + "=" + encodeURIComponent(this._list[i][1]);
        }        

        return queryString;
    }
}

Posted: Apr 13 2009, 17:17 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0 | JavaScript | Programming
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Hide and show items in a picklist in CRM 4.0

If you already worked with Microsoft Dyamics CRM 4.0, you know that almost everything you do with JavaScript is considered a "hack" because you manipulate the DOM of the pages by yourself. Because of this I decided to give you some help with differents helper methods I developped at my day job.

I'm currently working on a big development project involving CRM.

Those methods seems a lot more complicated than they has to be because we can't really hide and show items in picklists (HTML select). In HTML if you want to hide an "option" of a select, you need to remove it ! So when you want to show it back again you need to readd it to the list, and in addition to that, it will be placed at the end, not where he was before... so I created methods to help people to really hide and show CRM picklist items only by their value.

Hide a picklist item in CRM 4.0


function HidePickListItem(listID, value)
{
    var objList = document.getElementById(listID);

    // If the list has never been saved, save it now
    if (objList.SavedList == null)
    {
        var arrListe = new Array();        

        for (var i=0; i<objList.options.length; i++)
        {
             arrListe[i] = new Object();
             arrListe[i].value = objList.options[i].value;
             arrListe[i].Libelle = objList.options[i].text;
             arrListe[i].Visible = true;
        }

        objList.SavedList = arrListe;
    }

    for (var i=0; i<objList.SavedList.length; i++)
        if (objList.SavedList[i].value == value)
            objList.SavedList[i].Visible = false;

    for (var i=objList.options.length - 1; i>=0; i--)
        if (objList.options[i].value == value)
            objList.options.remove(i);
}

Show a picklist item that has been hidden in CRM 4.0


function ShowPickListItem(listID, value)
{
    var objList = document.getElementById(listID);

    if (objList.SavedList != null)
    {
        var selValue = null;
        var indexInsertion = 0;

        for (var i=0; i<objList.SavedList.length; i++)
            if (objList.SavedList[i].value == value)
                objList.SavedList[i].Visible = true;

        // Keep the selected value so we can reselect it after
        if (objList.selectedIndex > -1)
            selValue = objList.options[objList.selectedIndex].value;

        // Remove all the items in the list
        for (var i=objList.options.length - 1; i>=0; i--)
           objList.options.remove(i);

        // Add the items that must be visible
        for (var i=0; i<objList.SavedList.length; i++)
        {
             if (objList.SavedList[i].Visible)
             {
                var oOption = document.createElement('option');         

                oOption.text = objList.SavedList[i].Libelle;
                oOption.value = objList.SavedList[i].value;                

                objList.options.add(oOption);
            }
        }        

        // Reselect the item that was selected
        for (var i=0; i<objList.options.length; i++)
            if (objList.options[i].value == selValue)
                objList.selectedIndex = i;
    }
}

Posted: Apr 13 2009, 16:40 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0 | JavaScript
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Maximize the CRM child windows

 

If you already worked with Microsoft Dyamics CRM 4.0, you know that almost everything you do with JavaScript is considered a "hack" because you manipulate the DOM of the pages by yourself. Because of this I decided to give you some help with differents helper methods I developped at my day job.

I'm currently working on a big development project involving CRM. One of the client need was that all the windows appear fullscreen because their users are not familiar with mutliple levels of pop-up so by maximizing every window, you always have the feeling to be in the same window.

Maximize the window in CRM 4.0


function MaximizeWindow()
{
    window.moveTo(0, 0);
    window.resizeTo(screen.width, screen.height);
}

 

Posted: Apr 13 2009, 16:27 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0 | JavaScript
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

How to get selected items in a CRM grid in CRM 4.0

 

If you already worked with Microsoft Dyamics CRM 4.0, you know that almost everything you do with JavaScript is considered a "hack" because you manipulate the DOM of the pages by yourself. Because of this I decided to give you some help with differents helper methods I developped at my day job.

I'm currently working on a big development project involving CRM.

Get the selected items in a CRM grid in CRM 4.0

With this function you get only the GUIDs of the records selected.


function GetSelectedItemsInGrid()
{
    return getSelected("crmGrid");
}

 

Posted: Apr 13 2009, 16:22 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0 | JavaScript
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

How to hide and show left navigation items in CRM 4.0

If you already worked with Microsoft Dyamics CRM 4.0, you know that almost everything you do with JavaScript is considered a "hack" because you manipulate the DOM of the pages by yourself. Because of this I decided to give you some help with differents helper methods I developped at my day job.

I'm currently working on a big development project involving CRM.

The first you need to do when you want to manipulate the left navigation section is to create a general function to get a reference to a navigation block. The reason is because each time you want to hide or show a block or nav item you need the DOM reference of the navigation block so instead of copying the code every time, you write a function and you call it everywhere.

Get the DOM reference to a left navigation block in CRM 4.0


function GetNavBlock(block)
{
    var objBlockDetails = document.getElementById("_NA_Info");
    var objBlockSales = document.getElementById("_NA_SFA");
    var objBlockService = document.getElementById("_NA_CS");
    var objBlockMarketing = document.getElementById("_NA_MA");
    var objNavBlock = null;    

    if (objBlockDetails.innerText.substr(0, objBlockDetails.innerText.indexOf(":")).toLowerCase() == block.toLowerCase())
        objNavBlock = objBlockDetails;
    else if (objBlockSales.innerText.substr(0, objBlockSales.innerText.indexOf(":")).toLowerCase() == block.toLowerCase())
        objNavBlock = objBlockSales;
    else if (objBlockService.innerText.substr(0, objBlockService.innerText.indexOf(":")).toLowerCase() == block.toLowerCase())
        objNavBlock = objBlockService;
    else if (objBlockMarketing.innerText.substr(0, objBlockMarketing.innerText.indexOf(":")).toLowerCase() == block.toLowerCase())
        objNavBlock = objBlockMarketing;
    else
        throw "The navigation block '" + block + "' doesn't exists.";

    return objNavBlock;
}

Hide a navigation block in CRM 4.0


function HideNavBlock(block)
{
    var objNavBlock = GetNavBlock(block);

    objNavBlock.parentElement.style.display = "none";
}

Show a navigation block in CRM 4.0


function ShowNavBlock(block)
{
    var objNavBlock = GetNavBlock(block);

    objNavBlock.parentElement.style.display = "";
}

Hide a navigation item in a navigation block in CRM 4.0


function HideNavItem(block, item)
{
    var objNavBlock = GetNavBlock(block);

    for (var i=0; i<objNavBlock.nextSibling.childNodes.length; i++)
    {
        var menuItem = objNavBlock.nextSibling.childNodes[i];

        if (menuItem.childNodes[0].childNodes[1].innerText == item)
            menuItem.style.display = "none";
    }
}

Show a navigation item in a navigation block in CRM 4.0


function ShowNavItem(block, item)
{
    var objNavBlock = GetNavBlock(block);

    for (var i=0; i<objNavBlock.nextSibling.childNodes.length; i++)
    {
        var menuItem = objNavBlock.nextSibling.childNodes[i];

        if (menuItem.childNodes[0].childNodes[1].innerText == item)
            menuItem.style.display = "";
    }
}

Posted: Apr 13 2009, 16:04 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0 | JavaScript
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

How to hide, show and select tabs in CRM 4.0

If you already worked with Microsoft Dyamics CRM 4.0, you know that almost everything you do with JavaScript is considered a "hack" because you manipulate the DOM of the pages by yourself. Because of this I decided to give you some help with differents helper methods I developped at my day job.

I'm currently working on a big development project involving CRM.

Hide a tab in CRM 4.0


function HideTab(tabNumber)
{
    var tab = document.getElementById("tab" + (tabNumber - 1).toString() + "Tab");    

    tab.style.display = "none";
}

Show a tab in CRM 4.0


function ShowTab(tabNumber)
{
    var tab = document.getElementById("tab" + (tabNumber - 1).toString() + "Tab");    

    tab.style.display = "";
}

Select a tab in CRM 4.0


function SelectTab(tabNumber)
{
    var tab = document.getElementById("tab" + (tabNumber - 1).toString() + "Tab");

    tab.click();
}

Posted: Apr 13 2009, 16:00 by WebMasterSam | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: CRM 4.0 | JavaScript
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us
LINK BUILDING IS PROHIBITED ON THIS WEBSITE