• Anton van Dijk
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
Hi guys,

I have 2 custom objects (ObjectA__c and ObjectB__c)
in ObjectA__c I have created a lookup field for ObjectB__c.

My problem occurs when I want to have a field CountUsed__c in ObjectB__c that counts the number of times the object is used in the lookup field in ObjectA__c.

I've tried creating a formula field, but not it's not clear to me what the formula should be.
I also tried creating an Apex trigger. However, I couldn't get the select statement to work.

I want a field in ObjectB__c that is readonly and counts the number of time the object is used in the lookupfield @ ObjectA__c

Please advice the correct way to approach this :)
Hi guys,

I have 2 custom objects (ObjectA__c and ObjectB__c)
in ObjectA__c I have created a lookup field for ObjectB__c.

My problem occurs when I want to have a field CountUsed__c in ObjectB__c that counts the number of times the object is used in the lookup field in ObjectA__c.

I've tried creating a formula field, but not it's not clear to me what the formula should be.
I also tried creating an Apex trigger. However, I couldn't get the select statement to work.

I want a field in ObjectB__c that is readonly and counts the number of time the object is used in the lookupfield @ ObjectA__c

Please advice the correct way to approach this :)