on 12-07-2010 3:51 PM
Hi,
I'm trying to update a UDF that's type: date/time and structure: time.
I've tried this:
Invoice.UserFields.Fields.Item("U_hrInEnt").Value = "2122"
Invoice.UserFields.Fields.Item("U_hrInEnt").Value = "21:22"
Invoice.UserFields.Fields.Item("U_hrInEnt").Value = "212200"
Invoice.UserFields.Fields.Item("U_hrInEnt").Value = "21:22:00"
They all return error -1013 - "Invalid valid value '' in Enum 'BoYesNoEnum', the valid values are 'N', 'Y'"
Any ideas how this works?
Regards,
Ana Silva
Hi Ana,
That's a very strange error message to get if the UDF is a time format!
The time format UDF actually needs a full datetime value. The DI API will remove the date part and just save the time in the database.
Example to store 1:25pm
// Get today's date (the actual date doesn't matter as it won't be saved)
DateTime myTime = DateTime.Today.Date;
// Add the hours and minutes to the date
myTime = myTime.AddHours(13);
myTime = myTime.AddMinutes(25);
Invoice.UserFields.Fields.Item("U_hrInEnt").Value = myTime;
Kind Regards,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.