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
jimguilesjimguiles 

Cross Object Formulas

I need to creates some cross object formulas that pull information from a task over to the opportunity.  From what I have read that should be possible, however, I am struggling with the syntax.  If anyone could provide some general examples of the formulas that would be a big help. 
 
Thanks
JG


Message Edited by jimguiles on 10-31-2008 06:21 AM
anup_aanup_a
Not sure if you can create a cross object formula that will pull over information from a related Task on to an Opportunity. While creating a formula field on Opportunity, you can only pull objects that have a lookup on the Opportunity e.g. Accounts, User, Contact (Primary Contact) etc. Task is an entity related to Opportunity, so you cannot pull values from the Task and use them in a cross object formula field.
However, you may want to try using an s-control or a custom trigger to pick values from Tasks and update some fields on the opportunity.
jimguilesjimguiles
Thank you for your reply! 
 
I suppose I could look into using S controls, but not being able to report on the fields drives me crazy.  (not to mention my limited knowledge of them)  I have no problem creating an S control, but I do have questions about how to apply them properly.  All that I know of SF I have taught myself over the last month.  Can I embed an S control into a field?  Or is the S control itself the field and I just add it to the page layout (what I have done, and didnt like)  I will take a look at the triggers also and see how that might function for me.
 
I saw this on the web a few days ago which is what prompted me to look into this.
 
To automatically update a field you will need to create a formula field, however you can no create formulas within objects with the current version. I work for salesforce support and a new release is coming up next week. This release will allow you to have cross object relationships. With this you will be able to create a formula that can update a field on your donation object when a task is set to completed.
 
 
Thanks for everyones help.  I am steadily learning alot and improving all of our functions. 
 
JG
anup_aanup_a
S-controls will be invoked using a custom button/link/tab and not as a field. If I understand correctly, what you are looking for is the ability to copy some values from the Task (related to an Oppy) onto the Oppy record, as and when a Task is created. Please correct me if misunderstood something here.
In such a scenario, a custom trigger would be suitable, since it will update the opportunity record as soon as a new task is created and saved, linked to the opportunity record.
I am pretty sure that cross object formula field will not work in this case!
jimguilesjimguiles
"If I understand correctly, what you are looking for is the ability to copy some values from the Task (related to an Oppy) onto the Oppy record, as and when a Task is created. Please correct me if misunderstood something here"
 
You are right on track with me,  I am hoping to find a way to place the status (or a date of completion) of a particular task in a field on the Oppy record.  (Reporting on the field is a bonus but not entirely necessary since I can pull the information on a report from the activity itself.)
 
We have several tasks related to sending out marketing materials.  These tasks are set up to queue delivery of the materials.  We have many people (sales staff) that at a glance need to be able to see that it is "completed" or "in process"  So if I can take the status of a specific task and place it on the oppy page I will be very happy. 
 
Thanks again.
 
JG
werewolfwerewolf
The proper way to do what you're looking to do would be an Apex trigger on insert of Activity.  Here, you could detect when a Task (which is a type of Activity) meeting certain critieria is added to an Opportunity and update the field accordingly.  I believe you'll find some relevant sample code for this in the Force.com Cookbook.
jimguilesjimguiles

Thank you.  I am loading the "cookbook" now and will keep you all posted on my progress.

This seems like a very helpful community, I really appreciate that. 

 

JG