• Borek Straka 1
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

 

On my accounts object, I have a picklist field called Type with two values(Type1, Type2).

i have accounts with Type1 and accounts with Type2.

There is a lookup field called parent account.

Now, from the lookuop field I can select a Type2 account.

So, each Type1 account will have a Type 2 account associated to it.

I will need to count the number of accounts with Type1 under each Type2 account.

 

Any idea how I can do this ?

Note that we are dealing with just one object Account. So, I cannot use roll-up summary fields

 

thanks,

Vineeth.

 

  • March 07, 2012
  • Like
  • 0

Sorry, I'm a bit of a newbie to SFDC development but was wondering if someone has a solution that I can use to roll-up data from a related list without a master-detail relationship between the two objects. I can't seem to find the answer on any existing discussion threads although there are a few people trying to similar things. 

 

The situation:

I have a related list of Contracts (standard object) on a custom object, Instruments. These Contracts have an End Date which I would like to roll-up to the associated Intrument record. Essenially I would like to show the MAX(Contract.End_Date) on the Instrument record for all Contracts assosciated with that Instrument. 

 

Obviously a Roll-up Summary Field won't work here because of the lack of a master-detail relationship, so I was thinking an APEX Trigger is the only option. Does any one have suggestions on how this can be accomplished? Do I need to go the APEX Trigger Route or is there an easier option? And if I have to use an APEX trigger, do you have any code examples I can reuse?


Thanks for your help!
Cam