Skip to content
Snippets Groups Projects
Commit a92d685d authored by Pascal Neub's avatar Pascal Neub Committed by Benjamin Ulrich
Browse files

[Projekt: xRM-Sales][TicketNr.: 1080452][Automatische Wahrscheinlichkeit soll...

[Projekt: xRM-Sales][TicketNr.: 1080452][Automatische Wahrscheinlichkeit soll nicht höhere Werte überschreiben]
parent 12ed106a
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,10 @@
<mandatory v="true" />
<state>EDITABLE</state>
<displayValueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/phase/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Salesproject_entity/entityfields/phase/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>PROJECTCODE</name>
......
import("Sql_lib");
import("system.neon");
import("system.vars");
var currPobab = parseInt(
newSelect("SALESPROJECT.PROBABILITY")
.from("SALESPROJECT")
.where("SALESPROJECT.SALESPROJECTID", vars.get("$field.SALESPROJECTID"))
.cell()
);
var autoProbab = parseInt(
newSelect("SALESPROJECTPHASEDEFINITION.AUTOPROBABILITY")
.from("SALESPROJECTPHASEDEFINITION")
.where("SALESPROJECTPHASEDEFINITION.PHASE", vars.get("$this.value"))
.cell()
);
if(isNaN(autoProbab) || autoProbab < currPobab)
{
neon.setFieldValue("$field.PROBABILITY", currPobab);
}
else
{
neon.setFieldValue("$field.PROBABILITY", autoProbab);
}
......@@ -22,17 +22,6 @@ vars.get("$local.changed").forEach(function(fieldName) {
switch (fieldName) {
case "SALESPROJECT.PHASE":
typeValue = "SalesprojectPhase";
var autoProbab = newSelect("SALESPROJECTPHASEDEFINITION.AUTOPROBABILITY")
.from("SALESPROJECTPHASEDEFINITION")
.where("SALESPROJECTPHASEDEFINITION.PHASE", vars.get("$field.PHASE")).cell();
if(!isNaN(parseInt(autoProbab)))
{
newWhere("SALESPROJECT.SALESPROJECTID", vars.get("$field.SALESPROJECTID"))
.updateFields({
"PROBABILITY": autoProbab
}, "SALESPROJECT");
}
break;
case "SALESPROJECT.STATUS":
// Milestone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment