cancel
Showing results for 
Search instead for 
Did you mean: 

Data is not populated in Advanced List based on ABSL query

former_member253394
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member253394
Participant
0 Kudos

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

Former Member
0 Kudos

I think, first of all make the code simpler, just add the minimum things that you need as a skeleton for your requirement.

Then if all is working add features one by one, because also with your details the objective is still not clear and the code is too complex to analyze.

former_member253394
Participant
0 Kudos

Hi all,

Can you please reply to the above query.

Regards,

Malkit Singh

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Malkit,

What's the difference in the binding of the list for "Packages" and "Opportunites"?

Which is the very first event handler and how is it triggered?

What does it trigger by itself?

Bye,

   Horst

Former Member
0 Kudos

Yes malkit, please provide more details. Maybe the binding of the package advanced list is wrong. Are the opportunities visible?

former_member253394
Participant
0 Kudos

Hi Horst,

Can you please delete this post ASAP.

Thanks,

Malkit Singh

former_member253394
Participant
0 Kudos

Hi Horst,

Can you please delete this post ASAP.

Thanks,

Malkit Singh

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Malkit,

Sorry, I am not an administrator.

Space editors are

Please get into contact with them.

Sorry,

   Horst

former_member253394
Participant
0 Kudos

hi,

Can you tell me how to connect with them

Thanks,

Malkit Singh

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Malkit,

It is a well known secret that <forename>.<surname>at<company name>.com is good chance of beeing the e-mail address of the resp. person.

HTH,

   Horst