Recalculate and SubmitCrmForm JavaScript function in CRM


I was trying to figure out what the recalcuate button does in case of Order and Quote form. Got to know that it calculates the total based on the Products added to that record. Behind the scene this is the html code for the recalculate button

<li tabIndex=”-1″ title=”Recalculate” id=”_MBcrmFormSubmitCrmForm1truetruefalse”
action=”crmForm.SubmitCrmForm(1, true, true, false);”>

So basically it calls SubmitCrmForm function.

SubmitCrmForm triggers the save event even if there are no modifications made on the form.

SubmitCRMForm( Mode, Validate, ForceSubmit, closeWindow)        // we could use this function but it is unsupported

Different Mode could be -1,2,7,58,59

or alternatively we could use the below function

Code: 1
Function: crmForm.Save();

Code: 2
Function: crmForm.SaveAndClose();

Code: 7
Function: send();

Code: 58
Function: SaveAsCompleted();

Code: 59
Function: crmForm.SubmitCrmForm(59, true, true, false);


Finding the id of the element using IE Developer tool.

With IE Developer Tool, to find the id, we need to do the following

Select developer tools and


then “select element by click” in find menu of dev tool.


And then select the element whose id we want


The id would be within the Li element within the attributes tab, select it



That’s  it ..

This message has not yet been submitted for delivery (email activity status pending send)


I was writing a custom code to send email using templates in CRM 4.0.

The code was working properly but the mails weren’t getting sent.

Checking at activities in CRM i found out the email activities have got created but were showing the status as “job pending”.

While searching for the same i found out that making modification to this file

C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.xml

would solve this problem.

Especially these tags !!



Check this link for detailed information

Email router configuration XML file explained

and this post as well


CRM Customization Import failed Error: Invalid name prefix


While importing customization from development to staging server we were receiving the error.

It was giving the error on a particular relationship “opportunity_new_dataaudit”.

What we did was to comment the entire EntityRelationShip tag for that particular relationship along with it’s corresponding EntityMap entry in the customization.xml


<EntityRelationship Name=”Opportunity_New_DataAudit“>
<Description description=”Unique identifier for Opportunity associated with Data Audit.” languagecode=”1033″ />
<field name=”new_opportunityid” requiredlevel=”none” imemode=”auto” lookupstyle=”single” lookupbrowse=”0″>
<displayname description=”Opportunity” languagecode=”1033″ />


<AttributeMaps />

And than we tried importing it and it worked for us.

And there was another way we were able to resolve this error, quite interestingly when we changed the name of EntityRelationship from



<EntityRelationship Name=”new_Opportunity_New_DataAudit“>

i.e simply appending new_ to relationship name in the customization.xml it imported successfully !


Passing Exam MB2-631 Microsoft Dynamics CRM 4.0 Customization and Configuration


Last week I took this exam and passed with a score of 98. For preparation I used the following training material.

Course 8912: Customization and Configuration in Microsoft Dynamics CRM 4.0 and Working with Microsoft Dynamics CRM 4.0 (Microsoft Press).

I felt the course 8912 training material is more than enough for passing the exam.

(Chapter 11: Introduction to Advanced Customizations :- There weren’t any questions from this chapter it’s just there for our own understanding).


Customization Import failed. Error: OrganizationUI With Id =…… Does Not Exist or Failure: new_…: The requested record was not found or you do not have sufficient permissions to view it.

I was getting this error when i was trying to import customization for one of our custom entity from our development server to test server.

The way i resolved was

1) Opened the customization.xml file i was trying to import.

2) Search for the organization id which was mentioned in the event log as one not existing. (OrganizationUI With Id = 42467170-73ec-4b39-8eca-309ab0daece9 Does Not Exist)

3) I found the id in the  <FormXml id=”{42467170-73ec-4b39-8eca-309ab0daece9}”> tag.

4) I exported the customization for the same entity from my test server.

5) In the customization file(test server) i found out it had different id for FormXml.

6) Replace the id value for FormXml in the development server’s customization with id i found at the test server for the same entity.

7) Than i tried importing this newly modified file and it imported without giving any error.


%d bloggers like this: