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
PhryPhry 

Can a Workflow Rule be used to auto fill a text field?

Hello, I'm trying to determine if a Workflow rule can be setup along with a field update to auto fill a simple text template into the Internal Comments text field when a user opens a new Case. For example some generic text such as First Name:, Last Name, Phone Number, etc to go into every new case Internal Comments field. This will be used as a template by the user to fill the proper info into this field.  If this is possible to do with a Workflow for the Internal Comments field I would be most appreciative for any info on how write the formula to do so. I'm new to working with Workflow Rules.   Thanks Mike

 

Here's an example of the formatting for the text template needed to be in the Internal comments field;

Name:

Address:

Primary Contact#:

Secondary Contact#:

Availability:

 

 

chris.noechris.noe

Mike, typically this could be done with a workflow field update.  However, it does not appear that the Internal Comments field from the Case object is available as a field which can be updated using the standard workflow field update functionality.

PhryPhry

I did notice listed under Cases Fields section the Internal Comments field name is listed as Comments. Would i be able to use Comments for the field update to get the text to fill into Internal Comments? IF so what would i use for a formula?  Thanks again

chris.noechris.noe

Mike,

Within your field update, select "Use a formula to set the new value" and then enter the following in the formula editor:

 

"Name:" & BR() & "Address:" & BR() & "Primary Contact#:" & BR() & "Secondary Contact#:" & BR() & "Availability:"

 

This will create a list of the text you specified in your original post with a line break at the end of each line.

PhryPhry

OK i have done this, i assume there needs to be a rule created to trigger this now to have the text fill in the field when the new case is opened? Sorry i'm a bit out of my know how on the Workflow rule creation as well if you can provide any insights on how to make one to do this i would greatly appreciate it. Thanks again for the help Chris.

chris.noechris.noe

Mike,

Now that you have the workflow action (field update) setup on the Case object, you can create a new Case workflow rule under Setup->Create->Workflows & Approvals->Workflow Rules.  For your Evaluation Criteria on the workflow rule, select "Only when a record is created" so that it only populates the Comments field with your predefined text when the Case is first created.  Set your rule criteria and then on the following screen under "Immediate Workflow Actions", choose "Select Existing" and pick your field update that you created previously.  Save and Activate the rule and you should be good to go.

PhryPhry

Chris, 

 

         I setup the work rule as instructed. I assigned the field update to the rule as instructed. I used criteria "case status" equals "unassigned" value as this is the default value whenver a new case is created. I activated the rule and made sure it was set for Only when a record is created. I activated the rule. However when i create a case the internal comments field remains blank. Any ideas?   Thanks Mike

chris.noechris.noe

Is it the "Comments" field or "Internal Comments" field?  I don't see "Internal Comments" as a field that can be updated with workflow when I look at it in my developer org.  Do you have a custom field on the Case object called "Comments"?  That might be the field that is getting updated so you might want to check that and make sure the field is on your Case page layout.

PhryPhry

Chris, thanks again for all the help on this.

 

I went ahead and recreated the field update and workflow rule to fill into the Description field of the Case instead of the Internal Comments field on the case but it still is not working. I also tried selecting every possible case status for the criteria to trigger the rule, no go. Any possible Ideas as why this doesn't seem to work.  Thanks Mike

chris.noechris.noe

The only thing I can think of is that the workflow rule is not activated.  Check to make sure it is active.

 

Also, try changing your Rule Criteria to what I have below as this is working fine for me:

 

Field: Case: Case Number

Operator: not equal to

Value: leave this blank

 

This should force the rule to trigger every time a new case is created as all cases get a Case Number assigned.

PhryPhry

Chris,

 

                      I was able to get this rule to work using the Description field. However it does not file in the text into the Description field until the case is actually saved. How would i force the field to be filled before i save the case, this would be when i open a new case and have it is on the case edit layout?   Thanks yet again for all the help,  Mike

chris.noechris.noe

Mike,

Workflow only triggers when a record is saved so that isn't going to work for you.  If you want to default some text in the field when you open the case, you will need to create a custom field on the Case object of type Text Area or Long Text Area and then set the default value of the field to the same formula value you used in the workflow field update.