+ Start a Discussion

How to get current record id?

Hi All,


I have one object called 'Site' and other object 'Payment' which is related list to the object 'Site'. On 'payment' related list i created one button 'Sum', up on clicking the 'sum' button i need to calculate sum of all payments where siteid=current site id. Here how should i get current siteid? My custom button(sum) is on 'payment' object. Please any one help me..





Another idea, if there's a Master-detail between Site and Payment, where Site is the Master, you can use a Roll-up Summary field to calculate this data. Create it on the Site object and it will calculate the desired Payment field.


Hope that helps,





Thanks for ur reply.


There is no master-details relation ship between site & payment. Only look up relation is available.


Any other idea plz......

If you're on the Payment page and you want to get the value of the site lookup, use a merge field.  It will probably look something like {!Payment__c.Site__c}, but use the button builder to help you insert the field to ensure that it's correct.