You need to sign in to do that
Don't have an account?

Simple Problem, New User
I have a custom object with an Account setup as the detail in a master-detail relationship where the custom object is the master.
All I am trying to do is access the Account from the Custom Object.
How come I cannot just say CustomObject.Account?
Should I be using a query instead?
If I am going to use a query do I need to create a foreign key in the Account to link to the proper CustomObject?
Thanks in advance.
Why are there so many threads with zero replies? I am certain this is a very simple question.
Is there a superior community out there for this?
perhaps because not many people work on sundays ?
Can you expand the context in which you're trying to do this? (apex, web services, etc), also if your custom object is master and account is detail, then there can be multiple accounts for a single custom object, so there can't be a simple account accessor on the custom object to access the account.
Thanks Simon.
I am just writing a trigger in Apex to copy one of the fields from the account to the Custom Object before insertion of a custom object.
So far I have what is below.
trigger TestTrigger on Custom_Object__c (before insert){
for(Custom_Object__c co: Trigger.new){
//This is all I have, but to copy 1 field shouldnt be more than a few more
//lines of code I would imagine.
}
}
Alright, somehow, I think ive figured it out.
I am just trying to copy the various Billing fields in Account to the various Mailing fields in Contact where Account and Contact are both the details in a master-detail relationship with my Custom Object.
This seems to be rather convoluted to me though. If there is a simpler solution, or I am doing something wrong, I would like to know so I can write better Apex code in the future.
Thanks,
Craig