Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 9244

OnSave Issue CRM 2011

$
0
0

Dear Gent,

I am using CRM 2011 and I am using the bellow code for Projects status and to follow it up.

Actually, the issue I am facing is that when I create new Project and check all the options for Project status to get a percentage of Project completion and save then it will save normally BUT the Problem is that when I want to change or edit a current Project the issue persist.

The issue is the result updated but the percentage remaining at the first value when we save for the first time.

Please Help on this.

Here is the code.

function Form_onsave()
{
 Xrm.Page.getAttribute("new_process").setSubmitMode("always");
}

function UpdateProcess(number) {
 var newValue = Xrm.Page.getAttribute("new_process").getValue() + number;
 Xrm.Page.getAttribute("new_process").setValue(newValue);
}

function new_pofsignoff_onchange()
{
 if (Xrm.Page.getAttribute("new_pofsignoff").getValue() == 1) { UpdateProcess(5); } else { UpdateProcess(-5); }
}

function new_infraassesment_onchange()
{
 if (Xrm.Page.getAttribute("new_infraassesment").getValue() == 1) { UpdateProcess(5); } else { UpdateProcess(-5); }
}

function new_projectplan_onchange()
{
 if (Xrm.Page.getAttribute("new_projectplan").getValue() == 1) { UpdateProcess(5); } else { UpdateProcess(-5); }
}

function new_sitereadinessconfirmation_onchange()
{
 if (Xrm.Page.getAttribute("new_sitereadinessconfirmation").getValue() == 1) { UpdateProcess(5); } else { UpdateProcess(-5); }
}

function new_implementation_onchange()
{
 if (Xrm.Page.getAttribute("new_implementation").getValue() == 1) { UpdateProcess(40); } else { UpdateProcess(-40); }
}

function new_acceptancetest_onchange()
{
 if (Xrm.Page.getAttribute("new_acceptancetest").getValue() == 1) { UpdateProcess(10); } else { UpdateProcess(-10); }
}

function new_documentationtraining_onchange()
{
 if (Xrm.Page.getAttribute("new_documentationtraining").getValue() == 1) { UpdateProcess(00); } else { UpdateProcess(-20); }
}

function new_handoversignoff_onchange()
{
 if (Xrm.Page.getAttribute("new_handoversignoff").getValue() == 1) { UpdateProcess(10); } else { UpdateProcess(-10); }
}


Viewing all articles
Browse latest Browse all 9244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>