Post

2 followers Follow
0
Avatar

Automatically update a list using a workflow rule

Hi, 

I'm trying to implement a workflow rule on the expense sheets that would update a custom field (also created in the expense sheet section).

The reason I'm trying to do this is because we have certain constraints in our company regarding expense sheets: users can only submit one per month. Since there is no "related expense sheets" field (kind of like the "related time sheets"), there is no way for us to check if a user has already submitted an expense sheet in the current month.

The solution we came up with is to basically update a reference to Object field called "RefFeuillesDeDepenses" and to "feed" it with the description of every expense sheets after they've been created. A validation rule would then compare the newly created expense sheet's description with all the descriptions in the field: if it already exists, the validation rule would keep the expense sheet from being created. 

Each expense sheet has a unique description: the user's internal ID, the year and the month of the creation (for example: AHM-201412 is an expense sheet created by the internal ID AHM for December of this year). 

Is it possible to feed the reference to Object field "RefFeuilleDeDepense" with this description automatically ? 

 

Looking forward to reading from you, 

 

Best regards, 

 

Amir

Amir Hamza Answered

Please sign in to leave a comment.

2 comments

0
Avatar

Hi Amir!

 

The solution for something like that is to a combination of a: Custom Field, 2xWorkFlow Rule Scheduled Work Flow Rule and a Validation Rule

  1. Step 1 - Custom Field: Create a custom field on the User Object and call it Number of Monthly expenses. ($C_NumberOfMonthlyExpenses).

  2. Step 2 - Create a WR that will add +1 to that user CF ($Owner.C_NumberOfMonthlyExpenses) every time a user create a new expense.

  3. Step 3 - Create another WR the will subtract that counter upon deletion.

  4. Step 4 - SWR: Create a SWR on the User object that zeros the the field on a monthly basis.

  5. Step 5 - Have a validation rule upon creation of a new expense that will check whether $Owner.NumberOfMonthlyExpenses>1

 

The above are the guidelines to handle this use case. Please feel free to hop to our one of our Advanced Q&A webinars for further assistance.

 

Regards,

Tamir

 

Tamir Avital 0 votes
Comment actions Permalink
0
Avatar

Hi Tamir, 

Sorry for the late reply, I only just now found out that you had replied to me ! 

I will try your solution.

Thank you very much, 

Regards, 

 

Amir

 

 

HAMZA Amir 0 votes
Comment actions Permalink