Help with using UD child tables

So I have a basic idea of what I want to do, but I have some technical areas that I haven’t explored yet, so I think I need some help getting this set up.

What I have been tasked with creating is a call-in/late tracker for employees. We want a way to track how many times an employee wasn’t here or was late, and what the reason was.

At first I am only going to attack late, because there is at least a labor header with a clock in time to compare to a shift start time. That’s an easy enough BAQ to make to get a list of occurrences that need reasons.

The next part is where I get a little fuzzy on the technical details.

For the reason codes, I would probably use a UDtable so that I can make a reason code entry screen and not need to maintain the list in code. (although it seems like a waste of a UD table, but that’s another topic) then I can use a BAQ drop down to set that. Not a big deal there.

For the table of reason records per employee and date, I keep going back and forth on whether I should use a parent/child UD table or just a regular UD table. The entry screen for the UD100/UD100A screen would be nice for reviewing an individual employee and for adding records in where there was no labor header (for a no show all day, or for when you know ahead of time that there is vacation scheduled for some examples). But, since the parent table is so simple, the only key would be company and employee ID, it’s not really doing anything???, and I could have just one UD table, but controlling entry might be more work on the development side??

The second level to this is ease of entry. I want to make an updateable dashboard that looks for rows that need a reason assigned. For that, I would do a left join on my “late” rows with reason codes where the employee ID and date match. If there isn’t one, (blank) that show the row. The ultimate goal would be to customize the dashboard so that you could do a mass update with buttons for highlighted rows. The part I haven’t done before is create new rows like that. Since the “update” is actually creating the rows that need to be created in UD100A (or just the UD table…). To do that, do I need to make a pre-processing BPM on the update that checks for the row on the UD table, and if it doesn’t exist call the BO to create the row? Or is there a better way to do that?

Lastly, I need to create a way to look for “absent” employee days based on shift and shop calendar. I haven’t really tried attacking that much, because I get stuck pretty quickly on how the shop calendars work and how to check a date against a shop calendar and essentially return a true or false.

So, any opinions on whether to use parent/child UD table or just a regular UD table? Also any tips on creating rows with a UBAQ/Udashboard would be helpful.

Any other thoughts/suggestions on the general concept? Better/easier/more elegant ways to do this?

First thought.

Reason codes use the Usercodes it is there for that…no need of another UD table.

I would just use one table to keep your data. Each occurence of an event will add a row… should be sufficient for your need.
For absent, well hopefully the employee calls in, so user interaction (supervisor) can create the row with absent reason code… no need to figure out a complex query… :wink:

That was my 2 cents!

Pierre

Thank you! I figured there may be something like that, I just couldn’t find it. That will work great.

I wish it were that way… No show, No call is one of the problems that we have that we really want to track.

Can you use those reason codes easily in a customization (like you can in baq/dashboard)? Or do I have to make a BAQ to pull those into a drop down? I can bind the drop down in the field I want, but don’t see how to get the drop down to display user codes.

They come in automatically using the EpiCombo. So yes

I must be missing something in the setup to make it automatically happen, because I get this error. I see the fields in the help, but they aren’t very descriptive so I’m struggling.

Brandon, try setting the EpiDataSetMode property to RowsDataSet.

1 Like

So then I get this error.

image

If I remove the binding it gets me the list in the drop down, but I don’t know how it would know which user code type to grab , there must be a filter somewhere?

But if I can’t bind it, how do I use it?

:confused::confounded:

here is a snapshot of one of mine

You can filter it by setting the SearchFilter property.
Example: SearchFilter : CodeTypeID= ‘YourCodeTypeID’

So I can get the field to map and grab the user codes (I had to delete the control and re-add it)

But for the life of me, I cannot get the filter to work. I’ve tried a bunch of different things. What am I doing wrong?

This is error I get.

This is my setup

So if I use

UDCodeType.CodeTypeID= “CodeTypeID”

or

CodeTypeID= “CodeTypeID”

I don’t get an error. But it returns all rows. For some reason the filter is looking for a Column name, when I need to filter by a column value…

Edit:

so this ended up working:

UDCodeType.CodeTypeID= ‘CallIn’

as well as

CodeTypeID= ‘CallIn’

And I swear I thought I tried the single quotes and it didn’t work before. But it’s working now, so thanks for your guys help!!

Ok new “something to learn” (AKA problem)

Since the keys for UD tables are character fields, and I need a date in there, I need a way to convert back and forth from date to character, and unfortunately, it seems like C# and SQL don’t have equivalent formats.

The C# code. ToString() with a date field returns this.

7/3/2018 12:00:00 AM

And the SQL convert(date, ‘UD100A.Key1’, 101) Returns

07/03/2018

I want to be able to use a date picker in my dashboards and I need to be able to combine fields from the LaborHed.ClockInDate with my UD100A.Key1 field using:

case when LateClockIns.LaborHed_ClockInDate is null then convert(date, UD100A.Key1, 101) else LateClockIns.LaborHed_ClockInDate end

The problem is that the C# ToString() conversion doesn’t match any of the SQL formats (101,100 etc.) and the C# editor for mapping the fields with not take the formatting arguments. (this is set up for creating the rows). This will also be in the BPM with creating rows with the UD100 screen.

So because I can’t format the C# mapping, I can’t convert from a string back to a date when I need to in my BAQ.

Can someone show me what I am doing wrong?

I needed .Value.ToString(“M/d/yyy”).