Skip to Content
0

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

May 10, 2017 at 05:07 PM

262

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers