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
testuser 34379testuser 34379 

Salesforce needs a Rollup summary of a Formula Field

I have three objects. Pilots. Pilot_cert_Links. Certifications. Pilots and Certifications both have rollup fields linked to Pilot_cert_link since this table has two Master Detail relationships each to Pilot and Certifications. Pilot rollup counts the number of certification that they have. Certification rollup counts the number of pilots who have that certification. That works fine.

However, I run into an issue while trying to make a rollup SUM on Pilot Object of Pilot_cert_linking Formula Field that links to the Certification Object and pulls the cost of each certification. I can only do ROll-up Summary of Number fields.
User-added imageUser-added imageUser-added image
testuser 34379testuser 34379
User-added image
testuser 34379testuser 34379
this is particularly annoying because if the rollup summary doesn't work, then I would need to manually type the number on Pilot_cert_link instead of it being based on Certification via the formula. It clogs the data in a bottleneck and requires extra care. annoying
testuser 34379testuser 34379
still wondering 8 hours laterr.....
testuser 34379testuser 34379
i guess I can just setup a process builder to fill the number field based on the formula field and hide the number field since it's extra on the custom list views for when either the action is created for either of the two objects. that works but still dumb rollup on formula would be easier
testuser 34379testuser 34379
User-added image

User-added image



User-added image
testuser 34379testuser 34379
i basically update the number field on Pilot Certification Link to be the formula value (which pulls the cost of the certification from the certification via a formula so that I don't have to type it) and then the Rollup SUM on Pilot table works.

other unrelated problem regarding lookup/autonumber as an extra field...maybe I can use Process Builder to fill the value of the primary index....but how would i verify that it's unique? I guess I can have a unique field that fills based on a formula that throws an error. SO ANNOYING i should be able to create a Primary first column index based on field names in the object
Nice now all i have to worry about is not uploading an index main field that is a duplicate and not being told and thinking it uploaded when it actually didn't --> MOSTLY BECAUSE OTHERWISE ADDING A LOOKUP/MASTER-DETAIL to THAT VALUE WHEN IT'S AN AUTONUMBER IS USELESS BECAUSE YOU HAVE TO LOOKUP BASED ON A RANDOM AUTONUMBER LIKE WHATTTTTT
Andrew GAndrew G
As noted in my other post, check out Duplicate Rules to see if they will help your uniqueness need.   

Note, you can also have a field and mark it as Unique in the setup.  
User-added image

Issue would be populating it with a value before it is saved.  So therefore a Before Trigger or a Before Flow.

So you could create the field, mark in "Unique" in the settings, and populate it with a Before Flow/Trigger.

regards

Andrew