Recalculate and SubmitCrmForm JavaScript function in CRM

Hi,

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”
onclick=”window.execScript(action)”
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

Save
Code: 1
Function: crmForm.Save();

SaveAndClose
Code: 2
Function: crmForm.SaveAndClose();

Send
Code: 7
Function: send();

SaveAsCompleted
Code: 58
Function: SaveAsCompleted();

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

Bye…


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “Recalculate and SubmitCrmForm JavaScript function in CRM”

  1. Do you know of any way we can suppres the save event – specific example is when creating a new quote – a save event takes place behind the scenes. This is breaking my quote code as I am doing a count on the number of quotes per opportunity… People are creating quotes in error .. not clicking save – but the record is being saved nevertheless… Any ideas?

    Like

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s