You need to sign in to do that
Don't have an account?
chessbase
Custom object reference field
Hi All,
How can I make the custom object reference field REQUIRED just like I can do it for others field? I looked in to all possible areas but couldn't find anything to make the field required. Is it possible BTW?
Hope this helps.
- Rick Greenwald
Developer Evangelist
I tried following and it didn't work. Can u point out what is wrong with following code? how do i cancel the insert if account id is null?
Code:
trigger checkAccount on Project__tenrox__c bulk (before insert)
{
for (Project__tenrox__c opp : Trigger.new)
{
Id OppId;
OppId = opp.Id;
Project__tenrox__c[] ThisOppPartner = [select Account__c From Project__tenrox__c WHERE Id=:OppId];
for(Project__tenrox__c o: ThisoppPartner)
{
if (o.Project__Account__c=='')
return;
}
}
}