record status based on events and dates (1 Viewer)

Leo_Polla_Psemata

Registered User.
Local time
Today, 07:31
Joined
Mar 24, 2014
Messages
364



Hi

The above is a draft of my table.
There are records and dates that the event happen for each record.
If one record has been sitting idle in one event for too many days, this needs extra attention because it must be some business errors or bad service.


In the last field "status", I need to set a status for each record.
If last event is event1 (date is the date this record arrived at event 1) then status is A
If last event is "event 2" at this date, then status is B
If last event is "event 2" but for some reason date on "event 1" is missing, this is error.
And so on.


The code must check which is the last date and update the correct "status" of each record.



If i use the code based on "if , case is " , it will take too long and too many lines to complete the code.


Is there any other method I could make it easier?
 

lpapad

Registered User.
Local time
Today, 16:31
Joined
Jul 7, 2018
Messages
47
Try calculated fields that follow business logic, use them as flags based upon which, you then apply actions.
 

Cronk

Registered User.
Local time
Tomorrow, 00:31
Joined
Jul 4, 2013
Messages
2,771
@ Leo
You wrote
If i use the code based on "if , case is " , it will take too long and too many lines to complete the code
Post the code that is taking "too long". Maybe it could be made more efficient.
BTW, how many records do you have to process?
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:31
Joined
Jan 23, 2006
Messages
15,379
Can you tell us a little more about your set up in simple terms?

What is event1? How does it get started? What possible status can it have?
What makes it completed? Then what? How do you know what to do if you have "bad/incomplete..." status?

Is this a single process in which all events occur (sequentially?)??

How is "too long" determined?
 

Users who are viewing this thread

Top Bottom