You need to sign in to do that
Don't have an account?
Ramesh Somalagari
Validation rule on Account Object
I have a validation rule on the Account Object as below:
AND(
NOT ISBLANK( Name),
ISPICKVAL (Account_Level__c, "Company" ),
ISBLANK( Address__c ),
NOT $User.Status__c
)
The above rule working when the Account is Created/Updated.Now I am create a Trigger on the Custom Object(Company):Trigger name is CompanySurvey. In CompanySurvey Trigger I Update the one field in Account Object.At the time does't showing the ERROR in standard-lone.But Account is not Updated because is validation rule executes.I debug the CompanySurvey Trigger in ERROR logs it show the error message but not showing the standard-lone.
Company lookup with Account Object.
Best Regards,
Ramesh
AND(
NOT ISBLANK( Name),
ISPICKVAL (Account_Level__c, "Company" ),
ISBLANK( Address__c ),
NOT $User.Status__c
)
The above rule working when the Account is Created/Updated.Now I am create a Trigger on the Custom Object(Company):Trigger name is CompanySurvey. In CompanySurvey Trigger I Update the one field in Account Object.At the time does't showing the ERROR in standard-lone.But Account is not Updated because is validation rule executes.I debug the CompanySurvey Trigger in ERROR logs it show the error message but not showing the standard-lone.
Company lookup with Account Object.
Best Regards,
Ramesh
All Answers
Can you post your trigger code
Trigger SurveySurvery on Company__c (AFTER INSERT)
{
TRY
{
FOR(Company__c sur : TRIGGER.NEW)
{
Account acc = NEW Account();
acc.Id = sur.Account_Name__c;
acc.Last_Survey__c = Date.valueOf(sur.CreatedDate);
UPDATE acc;
}
}
CATCH(EXCEPTION E)
{
SYSTEM.DEBUG('MAIN ERROR : COMPANYSURVEY'+E);
}
}