on 03-12-2015 4:03 PM
Hi,
I have one requirement that i have to create two advanced list pane in one Tab as shown package and opportunities:
I have to perform some calculation on opportunities and populate the result in the package Advanced list pane.
Can you please suggest something why the data is not coming although data is flowing. i have checked using debugger data is coming but visible.
Can you please suggest whether i have to create any event handler for the same?
Thanks,
Malkit Singh
Hi Horst/Alessandro,
Binding are same as it is done for Opportunity. when i create initially the values are visible in the Package advanced list but once i will come out of that screen without saving the value disappear and not visible although its working fine in the back end.
and if i same the values, it appear but not able to see any modification even if i will update any value.
Below is the complete flow:
Opportunity:
Opportunity design:
Package:
Data Model and Event for Opportunities:
Package Data Model:
Coding to populate Package List:
// Genrating formulas
var val2;
var collection:collectionof Project.package.OpportunityNode.package;
var pc1 = this.ToRoot.package.OpportunityNode;
var dataOpportunity : elementsof Project.package.OpportunityNode;
foreach(var i in pc1)
{
var pc2 = i.package.content;
//dataOpportunity.package = this.package.Opportunity.GetFirst().package;
dataOpportunity.package.content = pc2;
collection.Add(dataOpportunity.package);
}
var result;
result = collection.DistinctBy(n=>n.content);
this.PackageSumAmmount.content = 0;
this.PackageSumPercent = 0;
foreach( var i1 in result)
{
var temp = 0;
var temp1 = 0;
foreach ( var i2 in pc1)
{
if( i1.content == i2.package.content)
{
//adjusted probability
temp1 = temp1 + i2.AdjustedProbability;
var val1;
var val;
if(!i2.OpportunityID.IsInitial())
{
var prob = Opportunity.Retrieve(i2.OpportunityID);
if(prob.IsSet())
{
val = prob.SalesForecast.ProbabilityPercent;
val1 = prob.SalesForecast.ExpectedRevenueAmount.content;
val2 = prob.SalesForecast.ExpectedRevenueAmount.currencyCode;
}
}
// val = i2.Probability;
// val1 = i2.Value.content;
temp = temp + (val1 * val );
}
}
//package value
var package_value;
if(temp != 0 && temp1 != 0)
{
package_value = temp/temp1;
}
var Oppdata1:elementsof Project.package.ResultPublish;
var struc = this.ToParent.ResultPublish;
if( struc.Count() > 0)
{
var PBOoppCol = struc.Where(n => n.packageName.content == i1.content);
var Oppcount;
if(PBOoppCol.Count() > 0)
{
Oppcount = PBOoppCol.GetFirst();
Oppcount.ExpectedValue.content = package_value;
Oppcount.ExpectedValue.currencyCode = val2;
Oppcount.AdjustedProbability1 = temp1;
var pack = this.ToRoot.package;
var PBpack = pack.Where(n=>n.packageName == i1.content);
Oppcount.EPC = PBpack.GetFirst().EPC1;
}
else
{
Oppdata1.ExpectedValue.content = package_value;
Oppdata1.ExpectedValue.currencyCode = val2;
Oppdata1.packageName.content = i1.content;
Oppdata1.AdjustedProbability1 = temp1;
var pack = this.ToRoot.package;
var PBpack = pack.Where(n=>n.packageName == i1.content);
Oppdata1.EPC = PBpack.GetFirst().EPC1;
this.ToParent.ResultPublish.Create(Oppdata1);
}
}
else
{
Oppdata1.ExpectedValue.content = package_value;
Oppdata1.ExpectedValue.currencyCode = val2;
Oppdata1.packageName.content = i1.content;
Oppdata1.AdjustedProbability1 = temp1;
var pack = this.ToRoot.package;
var PBpack = pack.Where(n=>n.packageName == i1.content);
Oppdata1.EPC = PBpack.GetFirst().EPC1;
this.ToParent.ResultPublish.Create(Oppdata1);
}
if(!this.PackageSumAmmount.IsInitial())
{
this.PackageSumAmmount.content = this.PackageSumAmmount.content + package_value;
this.PackageSumAmmount.currencyCode = val2;
this.ToRoot.Total.content = this.PackageSumAmmount.content;
this.ToRoot.Total.currencyCode = this.PackageSumAmmount.currencyCode;
//this.PackageSumAmmount.currencyCode = "USD";
}
else if(this.PackageSumAmmount.IsInitial())
{
this.PackageSumAmmount.content = package_value;
this.PackageSumAmmount.currencyCode = val2;
this.ToRoot.Total.content = this.PackageSumAmmount.content;
this.ToRoot.Total.currencyCode = this.PackageSumAmmount.currencyCode;
//this.PackageSumAmmount.currencyCode = "USD";
}
var total_probability = package_value * temp1;
//total probability
this.PackageSumPercent = this.PackageSumPercent + (total_probability /this.PackageSumAmmount.content);
}
//insert Row
var row:elementsof Project.package.ResultPublish;
var scan = this.ToParent.ResultPublish;
var flag = 0;
if( scan.Count()> 0)
{
foreach (var i in scan)
{
if( i.packageName.content == "Project Total")
{
i.ExpectedValue.content = this.PackageSumAmmount.content;
i.ExpectedValue.currencyCode = this.PackageSumAmmount.currencyCode;
i.AdjustedProbability1 = this.PackageSumPercent;
flag = 1;
}
}
}
else {
row.packageName.content = "Project Total";
row.AdjustedProbability1 = this.PackageSumPercent.RoundToString(0,true);
row.ExpectedValue.currencyCode =this.PackageSumAmmount.currencyCode;
row.ExpectedValue.content = this.PackageSumAmmount.content.RoundToString(2,true);
this.ToParent.ResultPublish.Create(row);
}
if(flag == 0)
{
row.packageName.content = "Project Total";
row.AdjustedProbability1 = this.PackageSumPercent.RoundToString(0,true);
row.ExpectedValue.currencyCode =this.PackageSumAmmount.currencyCode;
row.ExpectedValue.content = this.PackageSumAmmount.content.RoundToString(2,true);
this.ToParent.ResultPublish.Create(row);
}
Thanks & Regards,
Malkit Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Can you please reply to the above query.
Regards,
Malkit Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Malkit,
Sorry, I am not an administrator.
Space editors are
Please get into contact with them.
Sorry,
Horst
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.