UD table write access denied?

Hello,

We have employees who work on and off, summers on, winters off, etc. Their initial start date does not really reflect the duration of their employment since they can be missing for 6 months of the year for example. That is why we started saving the employee work terms in the UD03 table.

Key1 = EmpID
Key2 = Work Term #
Keys 3-5 are blank.
Date01 = Start Date
Date02 = End Date

I created a customization on the Employee Menu Item and I added a table which allows users to add rows, delete rows, and modify existing rows. Here are the steps on how it works:

  • When an emp id is loaded, the employee’s work terms are loaded into the table via BAQ adapter call. Also, I am saving the old table data into a variable so that when the table gets modified, I still have access to the old data.
  • When the form is saved, I am accessing the old data, deleting all records corresponding to the old data in the UD03 table, and then creating the new records in the UD03 table.

This approach is working out fairly well for me and I’m not seeing any issues as a security manager. However, I am having a user who, when hitting the save button and my logic runs, will delete old UD03 records, and then fails at creating the new rows. This means that when the user hits the save button, it just wipes all table rows and corresponding UD03 records.

I checked Field Security Maintenance on UD03 and the User Group this user is part of, but it is set to default access, and default = full access for this table.

Does anyone have a suggestion on how I can allow this user to save records to the UD03 table?

Thank you!

Did it give you an error message?

2 Likes

I can’t reproduce it so I’ll have to get it from the employee. I reached out, but was hoping that maybe someone might know of an easy way to grant access to that table for specific users or groups.

Is it just this one user with a problem, and all the other users are fine, or do all users besides yourself have this issue?

1 Like

My theory was that it was an access issue, but now it seems like it’s an invalid date string. Some users have date strings 01/01/2024, others have 2024-01-01, etc.

Will keep you up to date. I appreciate your comments!

2 Likes

What is the users Local/language settings?

1 Like

Under user account settings it says Invariant culture, but I saw on their screen that it’s in the inferior MM/dd/yyyy format and not in the vastly superior yyyy-MM-dd format.
Is there a chance I can get the current user’s language settings or date format on the fly?

Parsing it seems prone to errors, because you never know what people actually select.
There is dd/MM/yyyy and MM/dd/yyyy and if I’m lucky, I’ll get a date like 02/03/2024 for which I will never be able to detect its format without gambling.

Don’t parse the date. Use a date picker and you won’t have this problem.

2 Likes

So this is the way people pick the dates:
image

Later I grab every row in the table by doing something like:

string dateFromStr = this.table.Rows[i].Cells["From"].Text;
Datetime dateFrom = DateTime.ParseExact(dateFromStr, "yyyy-MM-dd", CultureInfo.InvariantCulture);

So when dateFromStr is in the form of 01/01/2024, this will cause some problems.
Currently, I am checking if dateFromStr contains “/” and then converting it to a datetime that way.

Are you saying I can access the date value without having to grab the string? Alternatively, if there is a way to catch all date formats, I’m all ears!

What control is that? What are you doing this in?

1 Like

What is the date format on the users computers system tray?

This is a customization on the Employee Entry screen in Classic Kinetic 2021.
I added an EpiUltraGrid and am populating it with a BAQ.

I am not sure. Is the Epicor date format tied to the Windows settings? Otherwise, I am wondering if I can check the current user’s date format settings in the db, that would be ideal.

Sorry for the delay @masuphiber

So there appears to be some inconsistancy between the different user interaces

If you are using the rich client then, invariant language in the format culture settings in the users account in Epicor, then it should be getting the date from the PCs language and regional settings. If it is set to any other then it will use that… format. For example on my computer I have region format and country set to Australia, using invariant in the user setup it adopts the dd/mm/yyyy format when I test adding a new order. If I change that to English US in the Format culture in the user account in Epicor the date format changes. Changing the laguage has no impact.

However if you are using the browser changing the language changes the date format… Interesting note the order of the Language and Format Culture between the two fields is different between the two interfaces, just to add to the confusion.

I tested this on 2024.6

Apologies for the late reply @Hally
I appreciate your response!

If the date format can depend on windows settings or user settings, it isn’t a very reliable value to grab. At this point I am just converting MM/dd/yyyy or yyyy-MM-dd and hoping it will stick to these formats. It’s working for now, but I’m not sure if it will always work.

If you come across an easy way to grab date formats at some point in your Epicor run, I would appreciate if you could let me know :smiley:

Thanks for your time and efforts!

1 Like