Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Need an Idea for workflow to check if record exists, if not create a record, if yes - update record

$
0
0

I have a tricky question: I have several users that work on incidents, I would like to log the time each user spends on a form. For instance, here is the pseudo code:

1. Check if Time Log for current user exists.
2. If no Time Log exists - Create a new Time Log.
3. If Time Log exists for current user - Update new time.

This is what I would like:

--------------------------------------------------------------------
Name| Time
--------------------------------------------------------------------
Bryan40 Minute
Andrew18 Minute
Summit1 Minute
--------------------------------------------------------------------

I created a new entity called Time Log, created the relevant fields and the time calculation scripts - however I am unsure how to implement the feature so that the same record is updated rather than a new record being created. What I have done so far is to create a new Workflow that adds the new time. But the record gets fired all the time and new records get created:

--------------------------------------------------------------------
Name| Time
--------------------------------------------------------------------
Bryan40 Minutes
Andrew18 Minutes
Summit10  Minute
Summit30  Minute
Bryan19 Minutes
Andrew4   Minutes

--------------------------------------------------------------------

Does anyone know what I should be doing?





Viewing all articles
Browse latest Browse all 8223


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>