简体   繁体   中英

Salesforce-Cross Object Field

I have two custom objects 'User Name' and 'Salary'. There is a lookup relationship between the two objects. For every User Name, there are many salary records. I want one field,that is, 'Available Salary' to be there which adds the 'Net Salary' records from all the salary records for a particular user. Should I make this field in User Name?? Please tell me the formula for this and in which object should I make this field??

If you were prepared to change the lookup relationship to be master/detail, then you'd be able to create a roll up summary field on the UserName object that calculated the sum of the child records. If it has to be a lookup, then i think you're only choice would be to write a apex trigger to update the userName object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM