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
soasoa 

Problem in applying validation rule.

Hi,

 

I have a problem in creating a validation rule.

 

I have a object called 'Defect'. Defect object has a field called Defect Status.

I want to apply a validation rule stating that whenever I enter a new defect(ie i press the save button) this Defect Status field should be auto generated and the value should be 'New'.

 

After this whenver I edit this Defect page. I shall get a drop down having the values - 'Closed, Fixed, Assigned'.

the drop down has a default value as New and has a drop with the above three values.

 

Please tell me how shall I accomplish this.

 

Regards

Diti

werewolfwerewolf
Sorry, your question is unclear in a number of ways.  You're saying you have a Defect Status picklist field, and whenever a new Defect is created, that Defect Status field should be defaulted to New.  Then what now?  You want to disallow the user from keeping the Defect in New status the next time he edits it?
soasoa

Hi werewolf,

Thank you for your prompt response.

 

Yes you are right..Whenever a new defect is created , the defect Ststus should be defaulted to New.

 

And next time whenever the user logs in , to edit the Defect form, he should get a picklist having 'Assigned, Verified and Closed' as values .... New being the default value there..

 

Please suggest how to accomplish this....

I am stuck..

 

Thanks & Regards

Diti

NikiVNikiV

You can use a validation rule like:  !ISNEW() && TEXT(picklist_field_name__c) = "New"

 

This will fail if the record is modified and the status field is left as New and you can put some error message below the status field to explain.

soasoa

hi,

 

Thank u for your prompt reply.

 

I dont need my validation rule to fail.... I want that whenever a user wants to edit the Defect page he should get a Picklist field with 3 options...

 

And as soon as he saves a new defect a status filed should be added in the defect page with a value as new...

 

 

Please tell me how to accomplish this.

 

Thanks & Regards

 

Diti

werewolfwerewolf
You can use record types to make new fields appear on the page after save.  Make a second record type of your object and assign a page layout to it that contains your Status field or whatever.  Then make a workflow that changes the record type to your new record type after a new defect is saved.