Dear all,
I want to count customer total revenue and Categories and also want to show on Account TI Screen.
For this -->
I have created one solution (Revenue Calculation ) under this solution I have created two business objects
- Customer categories.
- Customer Revenue.
1 .Under Customer Categories I have created some element and define some revenue range and categories based on Revenue range.
My elements are-->
[Label("Revenue From")] element fromRevenue:Amount;
[Label("To Revenue")] element ToRevenue:Amount;
[Label("Revenue From")] element fromRevenue1:Amount;
[Label("To Revenue")] element ToRevenue1:Amount;
[Label("Revenue From")] element fromRevenue2:Amount;
[Label("To Revenue")] element ToRevenue2:Amount;
[Label("Customer Categories")] element customercategories:LANGUAGEINDEPENDENT_LONG_Description;
[Label("Customer Categories")] element customercategories1:LANGUAGEINDEPENDENT_LONG_Description;
[Label("Customer Categories")] element customercategories2:LANGUAGEINDEPENDENT_LONG_Description;
(Revenue from) (To Revenue) (Customer category)
0 10000 A
10001 20000 B
20001 30000 C
2.Under Customer revenue–
I have created some element –
element totalRevenueResult:Amount;
element CustomerCTg:LANGUAGEINDEPENDENT_LONG_Description;
association mycustomerinfo to CustomerRevenue;
association myCustomer to Customer;
Now I want to count the customer total revenue based on all opportunity – Product – Negotiated Price -->
For this I have write the code –After modify event -
importABSL;
importAP.FO.BusinessPartner.Global;
importAP.CRM.Global;
varquery;
varsalparams;
varresult;
query = Opportunity.QueryByElements;
salparams = query.CreateSelectionParams();
salparams.Add(query.PartyPartyKey.PartyID.content, "I","EQ",Customer.Retrieve(this.myCustomer.UUID).InternalID);
result = query.Execute(salparams);
vartemprevenuesum = 0;
foreach( varOpportunity_Instanceinresult)
{
if(Opportunity_Instance.SalesForecast.ProbabilityPercent == 100 ){
temprevenuesum = temprevenuesum + Opportunity_Instance.SalesForecast.TotalExpectedNetAmount.content;
}
}
// I have stored it in one field.
this.totalRevenueResult.content = temprevenuesum;
this.totalRevenueResult.currencyCode = ("INR");
Now I want to compare my customer total revenue with my 1st Business object (Customer categories) ->
For this I have write my code in same- After modify event->
if( this.totalRevenueResult.content>= this.mycustomerinfo.fromRevenue.content&& this.totalRevenueResult.content<= this.mycustomerinfo.ToRevenue.content)
{
- this.CustomerCTg = this.mycustomerinfo.customercategories;
}
elseif ( this.totalRevenueResult.content>= this.mycustomerinfo.fromRevenue1.content&& this.totalRevenueResult.content<= this.mycustomerinfo.ToRevenue1.content)
{
- this.CustomerCTg = this.mycustomerinfo.customercategories1;
}
elseif ( this.totalRevenueResult.content>= this.mycustomerinfo.fromRevenue2.content&& this.totalRevenueResult.content<= this.mycustomerinfo.ToRevenue2.content)
{
- this.CustomerCTg = this.mycustomerinfo.customercategories2;
}
elseif ( this.totalRevenueResult.content>= this.mycustomerinfo.fromRevenue3.content&& this.totalRevenueResult.content<= this.mycustomerinfo.ToRevenue3.content)
{
- this.CustomerCTg = this.mycustomerinfo.customercategories3;
}
elseif ( this.totalRevenueResult.content>= this.mycustomerinfo.fromRevenue4.content&& this.totalRevenueResult.content<= this.mycustomerinfo.ToRevenue4.content)
{
- this.CustomerCTg = this.mycustomerinfo.customercategories4;
}
elseif( this.totalRevenueResult.content>= this.mycustomerinfo.fromRevenue5.content&& this.totalRevenueResult.content<= this.mycustomerinfo.ToRevenue5.content)
{
- this.CustomerCTg = this.mycustomerinfo.customercategories5;
}
else {
raiseCustomerMSG.Create("I");
}
After this I have created one EC and take the element –
- Customer total Revenue
- Customer Categories
And bind with Account TI Screen.
But the values are not reflecting on Account Screen.
Please help me .
Thanks,
Manoj Kannaujiya.