function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SamarSSamarS 

How can I show a roll up summary field created on Master object in VF page - showing the total working hours in a week. I added it in VF page but it is not displaying anything. However, on backend value is getting saved correctly. thanks


How can I show a roll up summary field created on Master object in VF page; example - showing the total working hours in a week. I added it in VF page but it is not displaying anything. However, on backend value is getting saved correctly.

thanks.
Best Answer chosen by SamarS
SamarSSamarS
Pcon,

It didnt worked in this manner as you mentioned - 

<apex:outputField value="{!Object__c.RollupField__c}" />

So, what I did is-on save button click, I queried the value from rollup summary field and displayed it on vf page with binding variable.

It is working fine in this manner.

All Answers

pconpcon
How are you displaying this in your Visualforce page?
SamarSSamarS
Pcon,

It didnt worked in this manner as you mentioned - 

<apex:outputField value="{!Object__c.RollupField__c}" />

So, what I did is-on save button click, I queried the value from rollup summary field and displayed it on vf page with binding variable.

It is working fine in this manner.
This was selected as the best answer
pconpcon
Yes, the value in the rollup summary will not exist until the record is saved and then you will have to requery the field to get it's value.  I was under the impression that this was a view Visualforce page for an already saved recrod.