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
RAMACHANDRA REDDY DONDETIRAMACHANDRA REDDY DONDETI 

When a new contact is inserted with out account then throw error msg

CharuDuttCharuDutt
Hii RAMACHANDRA
You Can Try Below Validation  Or Trigger
Validation Rule
AND( ISNEW() , ISBLANK( AccountId ) )
-------------------------------------------------------------------------------------------------------------------
Trigger
trigger ContactAccountID on Contact (before insert) {
    For(Contact Con :Trigger.new){
        If(Con.AccountId == null){
            Con.AddError('Account Require Q!!!!');
        }
    }
}
Please Mark It As Best Answer If It Helps
Thank You!

 
 
RAMACHANDRA REDDY DONDETIRAMACHANDRA REDDY DONDETI
Thanks for your information sir It's correct
Suraj Tripathi 47Suraj Tripathi 47

Hi,

trigger ContactData on Contact (before insert) {
    For(Contact con :Trigger.new){
        If(Con.AccountId == null){
            con.addError('you need to insert account');
        }
    }
}
Thanks
RAMACHANDRA REDDY DONDETIRAMACHANDRA REDDY DONDETI
Thank you for your response.