Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have custom object lets call it as items.

  1. Items may or maynot have cases associated with it. There can be more than one case associated to an item.
  2. All cases may or maynot have items associated with it.

I need to show on the cases object related lists to show all items related to that case and in the items object show all cases associated to this item.

How would i have to set the relationship between these objects

Thanks

share|improve this question

2 Answers 2

up vote 0 down vote accepted

You have to create one look-up of case on your item object and one look-up of item on Case object. By doing this , you can associate one or more cases to a single item and one or more items to a single case.

It will automatically show related cases/items in related lists.

share|improve this answer
    
But this would associate only 1 case with 1 item right. There can be multiple cases associated with an item. For example i create a new case and select itemA . What this would do is have related list on itemA with the new case now created. In the items's related list i dont have itemA listed. I need it to show on case object to also display the itemA in the related list. Not sure if this is possible –  Prady Jan 18 '13 at 6:46
    
To associate more than one case to a single item , you have to add that item on all the related cases . Similarly , to associate more than one item to a single case , you have to add that case to all related items. For eg. Suppose there is a case C1 and you want to associate this case to items IT1 and IT2 , then you have to add this case to these items only. –  S.Sharma Jan 18 '13 at 6:53
    
got it:) .. Need a big mug of coffee.. –  Prady Jan 18 '13 at 6:58

Contrary to Sharma's answer I would really suggest you to use a relationship object for this. Create a new custom object (ie. CaseItem) with a lookup field to Case and a lookup field to Item. That way you can really have a many-to-many relationship. Shankar's solution could work in your case but you will run into problems, for instance if you want three different cases to have a relation to the same two or three items.

For the related lists; in the Item and Case objects you can add a related list with ItemCases. In the Case object only show the Item column of the ItemCase in that related list an in the Item object only show the Case column.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.