Email Description Field / Body field and JavaScript in CRM


Hi,

To set description field in email with formatting instead of DataValue we need to use

document.all[‘descriptionIFrame’].contentWindow.document.body.innerHTML="One <br/> Two";

as it is rendered as IFrame.

And in form’s onload to set it we need to use script like this

document.all[‘descriptionIFrame’].attachEvent( "onreadystatechange", stateChanged)
return;
function stateChanged()
{
     if (document.all[‘descriptionIFrame’].readyState==4 ||document.all[‘descriptionIFrame’].readyState=="complete")
          {
     document.all[‘descriptionIFrame’].contentWindow.document.body.innerHTML='<span style="color: #6600cc">this </span>is a <span style="font-weight: bold; font-style: italic">test</span>’;
     }
}

Check the entire thread here !!

http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/e349b7fc-f42a-4fa5-aaa4-ba01673a73ed

 

Bye..

Code to retrieve status value based on status label in CRM 3


This code is for retrieving status value based on status text for salesorder entity.

 

public int RetrieveStatusValue(EntityName Entity, string StatusValue)
   {

       int intStatus = 0;

       MetadataService MetaService = new MetadataService();
       MetaService.Credentials = System.Net.CredentialCache.DefaultCredentials;

       AttributeMetadata am = MetaService.RetrieveAttributeMetadata(Entity.ToString(), "statuscode");
       StatusAttributeMetadata sm = (StatusAttributeMetadata)am;

       foreach (StatusOption so in sm.Options)
       {
           if (so.State == 0)
           {
               if (so.Description.Trim().ToLower() == StatusValue.ToLower())
               {
                   intStatus = so.OptionValue;
                   break;
               }
           }
       }

       am = null;
       sm = null;

       MetaService.Dispose();

       return intStatus;
   }

 

To call the function

RetrieveStatusValue(EntityName.salesorder, "Draft");

 

Bye.

Calling CrmService from Java


While searching for the same I found these article !!

http://rabout.com/?q=ms_dynamics_crm_3_api_axis2

http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/caf5fa3f-c5f0-43a9-8cfc-4fdb88bb6248

http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/94524d3c-cf66-4766-8c0c-1a22d9669c24

Bye..

System.Net.WebException: The request failed with HTTP status 404: Not Found Error While Using CrmService Retrieve in callout.


Hi,

I was getting this error on all my callouts, initially they all were running fine. Recently we had tried upgrading CRM 3.0 to CRM 4.0 and had failed in that, so we had CRM 3.0 reinstalled on that machine.

This time the port was different i.e. 100 instead of 5555. And we were using our own config files for callout where we were setting crm’s Url. I modified the url there, followed by an IISRESET but still same error.

Finally i updated my web references( in visual studio)  for my callout to point to the new url with the new port, rebuild it and deployed this callout. This resolved the issue.

Bye..

Upgrading CRM 3 to CRM 4


I was assigned the task of Upgrading CRM 3.0 to CRM 4.0 !!

Following are the very useful articles on the same !!

http://blogs.msdn.com/crm/archive/2008/05/01/upgrading-to-crm-4-0.aspx

http://bradmarsh.net/index.php/2008/03/14/upgrading-crm-30-to-40/

https://nishantrana.me/wp-content/uploads/2009/08/steps-to-upgrade-to-crm-4.doc

http://dynamics-crm.megasolutions.net/How_To_Move_Microsoft_Dynamics_Crm_3.0_SQL_Databases.aspx

These are certain issues that we faced !!

http://mscrmsupport.wordpress.com/2008/05/14/crm-30-upgrade-issue-there-is-already-an-object-named-attributetypes-in-the-database/

http://support.microsoft.com/kb/927226

http://support.microsoft.com/kb/917948

http://support.microsoft.com/kb/910044/

 

 

Refer this as well

http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Q_23386129.html

CRM4.0 Upgrade Path

1.      Create Database backup files for both Organization_Name_METABASE & Organization_Name_MSCRM
2.      Delete MSCRM_Config database from SQL (if it exists)
3.      Uninstall Microsoft CRM-Exchange E-Mail Router
4.      Uninstall Microsoft CRM 3.0.
5.      Reboot the server.
6.      Restore the 3.0 METABASE and MSCRM databases.
7.      Install Redeployment Wizard from the CRM 3.0 media.
8.      Create a new AD OU to use for the Security Groups that are created during redeployment. This is only to make sure there is no confusion between the old and new groups.

Steps 9 & 10 were only necessary because I was getting a “duplicate SQL server SPN” error in the EDW (Environmental Diagnostics Wizard). Ignore these if it is not a problem.

9.      Load SupportTools from CD2 of SBS Setup Disc.
10.      Delete the duplicate SPN from the SQL Server and Administrator Account using the ADSIEDIT.msc tool. (Delete MSSQLSvc/SQLServerName.DomainName.local:UnusedPortNumber)

11.      Launch the Redeployment Wizard.
12.      Choose the SQL server and select the restored 3.0 database. Should be named Org_Name_MSCRM and click Next.
13.      The Organization name should be populated, click Next.
14.      Browse out to the Organization Unit that was created in step 8 and click Next.
15.      Select Automap users and map by Active Directory account name. Choose Next.
16.      Users should all be mapped correctly. Click Next.
17.      This will give a quick overview of the choices made previously. Click Start.
18.      Start the CRM 3.0 Installation and enter license key. Click Next.
19.      Accept Terms and click Next.
20.      Choose Custom Setup.
21.      Enter Organization Name as shown in Step 7. Click Next
22.      Click Next on Customer experience.
23.      Click Next on installation directory.
24.      Select the Create new Web Site and click Next.
25.      Select SQL Server, Choose Connect to existing databases and the DB’s should auto populate. Click Next.
26.      Type in the Report Server URL and click Next.
27.      Leave Security account as Network Service and click Next.
28.      Choose Exchange Server and click Next.
29.      If you do not have any errors at the EDW (ignore database version mismatches) click Next.
30.      This will give the summary page. Click on Install.
31.      Once the installation completes reboot and cancel out of the initial setup.
32.      Launch the webclient and take the Administrator account out of Restricted Access Mode.
33.      Run ” SP_fulltext_database enable ” against the MSCRM database to enable full-text indexing.
34.      Create the full text index on the documentindex table.
a. Open the SQL Server Management Studio and expand Organization_Name_MSCRM database. Expand the view and click on tables.
b. Right-click on the DocumentIndex table, point to Full Text Index Table and point to Define Full-Text Indexing on a Table. This will open the Full Text Indexing Wizard. On the welcome page, select Next.
c. Select the Unique Index of PK_DocumentIndex. Click Next.
d. Select the Title, KeyWords, and Search Text columns and then click Next.
e. Track Changed Automatically and click Next
f. Type ftcat_documentindex for the Full-text catalog and Select Next.
g. You do not need to select or create a population schedule. Select Next to bypass this window.
h. Click Finish to complete the creation of the Full-Text Index.
35.      Remove old CRM4.0 setup logs
36.      Verify (or start) the SQL Reporting services is started
37.      Begin upgrade
38.      Reboot
39.      Test the installation
40.      Examine Setup Logs for errors

Success!

Bye…

Sample code for ISV.CONFIG form button to pass the object id of record.


Just thought of putting this code over here, as i need it frequently 🙂

This one is for case entity.

 

<Entity name="incident">
          <ToolBar ValidForCreate="0" ValidForUpdate="1">
            <Button Icon="/_imgs/ico/16_convert.gif" Url="http://www.google.co.in" PassParams="1" WinParams="" WinMode="0" Client="Web">
              <Titles>
                <Title LCID="1033" Text="Url Button" />
              </Titles>
            </Button>
            <Button Icon="/_imgs/ico/16_convert.gif" JavaScript="window.open(‘http://www.google.co.in?oId=’+crmForm.ObjectId ,”,”);" PassParams="1" WinParams="" WinMode="0" Client="Web">
              <Titles>
                <Title LCID="1033" Text="JavaScript Button" />
              </Titles>
            </Button>
          </ToolBar>
        </Entity>

 

Bye..