+ Start a Discussion
Wayne_ClarkWayne_Clark 

Roll-up Summary SUM issue

Hi,

 

I'm trying to create a Rollup SUM on a master object to total a number formula field on the child records, but it's not letting me select the field to SUM.

 

The formula field on the child record references a related object. Is this the reason it will not let me select that field to SUM? 

Bhawani SharmaBhawani Sharma

Can you please check the field you want to use for sum is of Number Type.

Wayne_ClarkWayne_Clark

Yes, it is, below is the formula that produces the number.  I'm trying sum all these numbers and it's not allowing me to choose this field as an option:

 

IF(School_Calendar__r.Job_Order__r.Job_Start_Date__c < Start_Date__c,

CASE(MOD( Start_Date__c - DATE(1985,6,24),7),
0 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD( End_Date__c - Start_Date__c ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+
(FLOOR(( End_Date__c - Start_Date__c )/7)*5)


, 0)

Wayne_ClarkWayne_Clark

After some more research, I found I can't do a roll-up summary on cross-obect formula fields.

 

Long text area, multi-select picklist, Description, system fields like Last Activity, cross-object formula fields, and lookup fields (such as the Product Code field) cannot be used in the field column of roll-up summary filters.

 

Thanks for all your help Tech Force, I'll find another way.

Andy.xuAndy.xu

:smileyhappy:    Hi ,i meet  this question as with  you.

 

how  to  resolve ?and  another way is ?

 

Thanks!

Wayne_ClarkWayne_Clark

I ended up resolving this using a combination of workflow rules and triggers.  Basically, when the auto-sum field calculated, a workflow took the calculation of each record and updated a seperate field on the record, which I was then able to auto-sum that field.  I also had to use a trigger to fire onto the field so that it would perform the calculation though. 

Andy.xuAndy.xu

yeh,i implement only with using trigger,not include workflow ,

maybe you can say that why use workflow?or which object work on?

study each other ,thanks!