You need to sign in to do that
Don't have an account?
bikla78
Account Object Security Based on Task
Does anyone know how I can make an account read only if the a related task is not completed? If it is completed then the user would be able to edit the account again.
ic I'd probably use the ISPICKVAL for the custom field. If it contains value 'x' it locks the record...
but which function is it in the validation rules section to lock the record?
I have created many validation rules but maybe i wasn;t being clear before.
Basically, we are implementing a duplicate record monitoring system. When a user creates a duplicate company record, a task will be created for them. I want to lock the account record when this happens so they are forced to address and complete the task.
I thought u were saying that there is a function in validtion rules that can override the record level security based on a fields'scondition. So the idea is , create a task trigger that updates a custom field in the account. Once the field is updated, it will lock the account based on this val rule that you suggested
When they complete the task, it will udpate the account field again which will then allow the user to edit the record again.
thanks again
When you lock the account record, you want to prevent the user from changing any field in the record, correct?
Create a custom Locked checkbox field in the Account object, then create this Validation Rule:
AND( Locked__c = True, NOT($Profile.Name = "System Administrator") )
and set the rule's error message is "record is locked".
When a standard user edits a locked account and tries to save his changes, the rule fires. The rule can't prevent the user from clicking the Edit button, but it prevents the save.
If you want the user to be able to modify some fields but not others in the record, then this will not work.
oK-
I got the rule to work but the problem is the locked__c will not update from the task trigger now since this rule is in the way. So everytime the task trigger tries to update it, I get this rule. Is there anyway to let the locked__c field to update to yes but it locks the record unless the user changes it to No.
AND( ISPICKVAL(Locked__c, "Yes"), ( $User.Id = OwnerId ) )
Right now, I am just manually testing this validation rule. So I am manually trying to change the locked picklist. However, it won't let me change the value to Yes because this validation rule is in the way. I think an After update trigger will work initially so when the task is created the trigger will fire and update the locked field to yes. Then, when a user tries to edit the record, they will get the validaiton message:
"The record is locked, please complete the task associated with this company"
However, once the user complete the task the trigger, it should update the task field fro Yes to No now but the problem is, how would it update it back if it is locked?