cancel
Showing results for 
Search instead for 
Did you mean: 

How to do sum of expected value of all opportunities regarding a customer's account

former_member189296
Active Participant
0 Kudos

Hi Friends,

I have been trying to add up all the expected value of all opportunities having close date year is current year. And want to store the value of that sum to a field in customer header.

For this I have been writing this code:

Event- AfterModify

import ABSL;

import AP.FO.BusinessPartner.Global;

import AP.FO.BusinessPartnerRelationship.Global;

import AP.CRM.Global;

import AP.FO.Activity.Global;

var Amount=0;

var Currency ="";

if(this.IsSet())

{

var OppQuery=Opportunity.QueryByElements;

var OppParams = OppQuery.CreateSelectionParams();

OppParams.Add(OppQuery.Status.LifeCycleStatusCode,"I", "EQ","Won");

OppParams.Add(OppQuery.,"I", "EQ",""); // What should I mention here for closing date?

var OppRes= OppQuery.Execute(OppParams);

if(OppRes.Count()>0)

{ foreach(var OppIns in OppRes)

{

var Total= OppIns.

OppParams.Add(OppQuery.,"I", "EQ","");

Please help me with below queries:-

1) Trying to add parameter "Close date" & "start date" of opportunity but I'm not able to find the path to "close date" & "start date" fields in opportunity BO. How can I do this?

2) So that the result can be filtered when close date year is equal to the current year. How can I do this entire thing?

Please help..

Regards,

Saurabh

Accepted Solutions (0)

Answers (1)

Answers (1)

tushargoel519
Participant
0 Kudos

Hi Saurabh,

Pls Correct the logic part of the highlighted in the given screenshot.

total = total + Oppolns.

Thanks,

Tushar Goel.