cancel
Showing results for 
Search instead for 
Did you mean: 

UDO / Date Type field ..

Former Member
0 Kudos

Having problems with UDO and a screen I've designed .. I have two dates in my UDO which i have bound to the display .. I attempt to prefill the dates with the following code ..



form.DataSources.DBDatasources.Item("@MyTest").SetValue("U_StartDate",0, GenApp.DefaultStartDate.ToString());

form.DataSources.DBDataSources.Item("@MyTest").SetValue("U_EndDate",0,
GenApp.DefaultEndDate.ToString());

....

form.Update();

My GenApp is a static class contains the methods DefaultStartDate, DefaultEndDate which returns

DateTime values ..

The dates don't display in the screen , though the static class does return values .. Any one have any suggestions ?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Nussi
Active Contributor
0 Kudos

Hi Rob,

iam not 100% sure, but i think the date should be have the format YYYYMMDD

regards

David

Former Member
0 Kudos

I'll try ..

Former Member
0 Kudos

Sorry David ..

Did you mean ..


form.DataSources.DBDatasources.Item("@MyTest").SetValue("U_StartDate",0, GenApp.DefaultStartDate.ToString("YYYYMDD"));

If so , it just throws "Not a legal OleAut date" ..

Nussi
Active Contributor
0 Kudos

in C# its:

string.Format("yyyyMMdd","TEXT")

regards

David

Former Member
0 Kudos

Thanks .. works fine .. but format is actually ..



string.Format("{0:yyyyMMdd}", AppDefault.DefaultEntryDate);

Thanks for your help ..

Nussi
Active Contributor
0 Kudos

you are right - i forgot the two brackets - sorry

i was in hurry to a vienna soccer match when i posted this solution....

anyway a bit "helpful" no ?

forget this joke - i noticed you generaly give no points

David

Former Member
0 Kudos

Extremely !! Thank you .. And some points .