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
admin awadmin aw 

Validation rule for two different objects

 

I am not sure how to proceed here.

I have standard object Opportunity and custom object Competitors.

I need to create a validation rule for:

When Competitor field on the Opportunity object is not NULL ,then Comments field in the Competitor object must be updated.

The problem is here- Comments field is a large text field,where comments are left. One competitor maybe associated with multiple opportunities. For example : for  Opportunity 1 Competitor is ABC Company, for opportunity 2 competitor is ABC Company as well.  Comment field will serve as a knowledge library, where sales reps will add their comments about competitors  they learnt during closing their opps. All comments will be stored in that comment section and if somebody already added comments for opportunity 1 for this competitor, then  when the opportunity 2 comes along, comments field is not blank,I need to force sales reps to update the field each time Opportunity is closed won or closed lost and competitor is known( competitor field on the opportunity layout is not blank). NO ISNULL function won't work starting with opportunity 2, given than somebody already added comments when doing opportunity 1. '

I hope I didn't confuse anyone with my long explanation. I’ll be happy to clarify.

Thanks for helping me out.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

You could create a custom field to store the comments/text on the junction/connector object and use the VR I posted to make the field required when a new connection between a Competitor and an Opportunity is established.

All Answers

Steve :-/Steve :-/

Do you have a lot of Opportunity/Competitor data (records) already on your SFDC Org? 

I've built a custom Opportunity Competitor tracking capability on my SFDC Org  that might work a little better for you.  

admin awadmin aw

Stevemo, we have lots of opportunity data. There is a small list of competitors I'll have to add in the newly created object Competitor. We don't need any info about them except for the  "learnt facts" from the sales force. Is it something your process can help with? I appreciate your help.

Steve :-/Steve :-/

Are you on the Dreamforce Portal?  I have a document posted there that outlines what I built and how it works you can look at to see if it might be a good fit for your SFDC Org

admin awadmin aw

What is Dreamforce portal?

Steve :-/Steve :-/

Are you going to the Salesforce Dreamforce Conference at the end of the month?  If you are they have a portal set up for all attendees, and I have a bunch of documents posted there with Code, Apps, etc that I've built,  that I could send you link to.  But you can only access them if you have access to the DF Portal https://dreamevent.my.salesforce.com

Steve :-/Steve :-/

Let me post them to GoogleDocs and send you a link.

admin awadmin aw

I am still not sure if I am going to the conference. Thanks for doing google docs for me.

Steve :-/Steve :-/

Here you go, give it a look and let me knw what you think or if you have any questions.  Like I said it might not be a fit for your SFDC Org or your Sales Process.  

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B5Hq93KjQcpcZWFjOTkxZmYtYzM5NS00YWZlLWI0NGEtN2M2MTY5NjgwMDI0&hl=en_US

admin awadmin aw

It helps "to connect" competitor object and opportunity object. But it's a part of my problem. I need to make sure sales reps actually update comment field. And I can't find answer for this part in the document.

Forgot to mention, that I  used "Know your Enemy" app from the app exchange.

Steve :-/Steve :-/

Can you post a screenshot of one of your Competitor objects?

Steve :-/Steve :-/

Skype???  I don't think my Skype info is public?!?  Can you post it to GoogleDocs, Flickr, Picasa, etc. and post a link like I did?

admin awadmin aw

Here is the link:





https://docs.google.com/document/pub?id=1B7vCWn5Y1RQ73Ugq4ycnB9MSQWYQytUSubePXTxt6Hk

 

There are three more fields like that ( like Lessons Learnt).

Steve :-/Steve :-/

Why don't you just put a VR on the Competitor Object that says:

ISBLANK(Lessons_Learnt__c)

 

admin awadmin aw

It means that the page can't be blank, right?

But once first rep updates it, then  it won't be blank anymore. Will this function force second rep( and third, etc) to update ( add their comments) the field that has some information added by the first rep?

Steve :-/Steve :-/

Sorry I'm getting a little confused.  From your screenshot it looks like the Competitor is a child of the Opportunity (each Opportunity can have many Competitors) and each Competitor record is a distinct record, not 1 Competitor record with 1 Lessons Learnt field that encompasses every time that Competitor has vied for a peice of business.  

 

 

admin awadmin aw

Right.Each opportunity may have multiple competitors. Let's say opp 1 has competitor A and B. Once opp 1 is closed one Lessons Learnt field on the competitor A and B are updated with information learnt during the sales process.Then opp 2 is created with the same competitors A and B.When the opp 2 is closed won/lost the same field Lessons Learnt for Competitor A and B needs to be updated, adding information learnt from opp 2 to the information added after opp 1 has been closed won. Does it make sense?

Steve :-/Steve :-/

But in that scenario the Competitors are unique records.  The screenshot you posted only showed 1 Lookup(Opportunity) field on the Competitor object.  So when a Competitor is associated to an Opportunity it remains connected to that Opportunity.  If another Opportunity is created and the Competitor is identified on that deal, then a new and unique Competitor record is associated to that (new a blank Lessons Learnt field).  There is not 1 Competitor record with 1 Lessons Learnt field  that is attached to 1 Opportunity and then de-coupled and re-parented to another Opportunity.

admin awadmin aw

Now I am confused. I  don't need to create a unique record for each Opp-Competitor relationship.

Ultimate goal is to build a knowwledge library based on the reps comments. But comments for all opps should be accumulated in the field Lessons Learnt on the Competitor record. One Competitor account with lots of comments from lots of opps associated with this competitor. How do I do that?

Steve :-/Steve :-/

But the screeshot of the Competitor object you posted only has 1 Lookup(Opportunity) field on it, how does it get associated to another Opportunity?  

 

Have you ever worked with a Relational Database before?

admin awadmin aw

I did work with relationship databases before. It's possible to get one to many relationship.That's what I want.

I don't understand why you are saying there is only one to one relationship based on my screen. Can you please explain? Thanks.

Steve :-/Steve :-/

I'm not saying that there is a 1-to-1 relationship, what I'm saying is that each Competitor record can only be associated to 1 Opportunity record.  1 Opportunity and have MANY Competitor records associated to it.  But each Competitor record is distinct, there is not 1 Competitor record for ALL Opportunities that has 1 Text Area field that will contain ALL of the Lessons Learnt.   There will be MANY Competitor records with MANY Text fields that will represent ALL of the Lessons Learnt

Steve :-/Steve :-/

Okay, I think I know what the problem is.  The Competitor object is also a Master/Parent and it is associated to the Opportunity via a junction/connector object (you did not post a screenshot of that).  Anyway, what you want to do might still be possible if the Competitor object and the connector/junction object have a Master-Detail relationship.  If they don't then things get a lot trickier.

admin awadmin aw

You are right.

What if I go with the solution you've sugested( the document you sent yeaterday). How I can make updats a required action?

Steve :-/Steve :-/

You could create a custom field to store the comments/text on the junction/connector object and use the VR I posted to make the field required when a new connection between a Competitor and an Opportunity is established.

This was selected as the best answer
admin awadmin aw

That will work! Thanks!!!

Steve :-/Steve :-/

No problem.  

 

PS.  You owe me a beer!

admin awadmin aw

I owe u a case of beer:) Will buy you one if I attend the conference.:)

Steve :-/Steve :-/

No problem

 

btw - I like to drink these -> http://beeradvocate.com/beer/profile/863/7971