Skip to Content

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

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 ="";



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);


{ 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..



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers