You need to sign in to do that
Don't have an account?
CFlevaris
Cross-object Reference
Hello!
I cannot find anything in your help pages referring to this so I logged a case. They couldn't answer, they said the question required a hire level of expertise, and suggested I post here.
I would like to know how to reference a field in another object record within the same account.
I have a formula in a custom field that is calculated to give value to one of my fields in the ASSET object. It figures out that if the expiration date for an asset is greater than TODAY() then it is covered under the support agreement, else it's not. This is the formula:
IF( Expiration_Date__c > TODAY() , "Yes", "No")
That's great, but the expiration dates that I want to upload will not be manually entered in the asset.
I would like to know how to reference a field in another object record within the same account.
I have a formula in a custom field that is calculated to give value to one of my fields in the ASSET object. It figures out that if the expiration date for an asset is greater than TODAY() then it is covered under the support agreement, else it's not. This is the formula:
IF( Expiration_Date__c > TODAY() , "Yes", "No")
That's great, but the expiration dates that I want to upload will not be manually entered in the asset.
There will be a field in a contract that defines the expiration date
We have an object called CONTRACT where these details are uploaded. Within the same account (that owns the asset) I want to use the expiration date defined in a field in the contract record.
I want to grab the value of Expiration_Date_c in a CONTRACT record if there is not one in Expiration_Date_c in the ASSET record and execute my IF statement.
In the forumula above, Expiration_Date_c comes from the ASSET object not the CONTRACT object within the same account. I want to connect the two in a new formula.
That formula should read, in pseudo code:
IF ASSET.Expiration_Date_c != <Blank> then
IF( ASSET.Expiration_Date__c > TODAY() then Yes else No)
Else
IF( CONTRACT.Expiration_Date__c > TODAY() then Yes else No)
Else
No
How can I do this?
Thanks,
Constantine
In the forumula above, Expiration_Date_c comes from the ASSET object not the CONTRACT object within the same account. I want to connect the two in a new formula.
That formula should read, in pseudo code:
IF ASSET.Expiration_Date_c != <Blank> then
IF( ASSET.Expiration_Date__c > TODAY() then Yes else No)
Else
IF( CONTRACT.Expiration_Date__c > TODAY() then Yes else No)
Else
No
How can I do this?
Thanks,
Constantine
Excellent question... I understand in SFDC we can have several contracts listed under the accounts object. I only plan on having one. I can take the one field I need from CONTRACT and make it a separate field inside ACCOUNT (it would be the same for every asset I'd add), but each asset will only have contract's terms apply to it. In my case, to make it easier, there will only be one contract per account.
I do not have any look up relationships between Contract, Account, and Asset, only that they are all related to Account.
Does that answer your question? Does that make it easier to suggest something or would I have to do something drastic to implement this?
Thanks,
Constantine
Message Edited by CFlevaris on 06-18-2008 11:46 AM
You can't use Account as an intermediate because Account is many-to-many to both Contract and Asset -- formulas won't work that way. But a straight up lookup from Asset to Contract will do the trick.
That's great! I see it was a matter of discussion before:
http://ideas.salesforce.com/article/show/22283/Lookups_from_standard_objects_to_standard_objects
But I can't find a page that tells me how to do it, nor can I figure out exactly how to do it myself on Setup.
Do you have a document describing it or can you tell me how to get it done?
Perfect! Now when I import asset information, I'll make sure to reference the default contract and make special considerations for the specific accounts with different relationships.
Another question, probably also easy to answer I hope: How do I reference a field in the related contract? It's currently:
IF( Expiration_Date__c > TODAY() , "Yes", "No")
IF( CONTRACT.M_S_Expiration__c > TODAY() , "Yes", "No")
where M_S_Expiration__c is the field in Contract I have to reference? Or is there another reference convention?
Thanks for all your help!!!
Constantine
I got it to work as you said! Only that when I inserted the field it came out:
Contract__r.M_S_Expiration__c
Thanks a lot!
Note that you cannot reference self-relationships (for example, if you create a relationship from Contract to Contract, you will not be able to reference the fields on the parent Contract from the child Contract).