cancel
Showing results for 
Search instead for 
Did you mean: 

User Field as date

Former Member
0 Kudos

Hi all,

i try to get in system form with formtype=133 a system field docdate as frm.items.item("10").specific.string

i have a user table

vData = CDate(CStr(frm.Items.Item("10").Specific.String)

Set xTable = oCompany.UserTables.Item(CStr("TABLE"))

xTable.Code = "Pippo"

xTable.Name = "Pippo"

xTable.UserFields("U_data").Value = vData

xTable.Add

but is not correctly!

Any idea for to format the string into data format???

Best regards

Serema

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Serema,

I use the following method to get a date:

// if passing in a string from an edit box, ensure it is the editbox.string

// NOT the editbox.value which is passed!!!

public static DateTime ConvertToDateFromSAPString(string value)

{

try

{

SBObob Bob = (SBObob)BaseUI.oCompany.GetBusinessObject(BoObjectTypes.BoBridge);

Recordset RecSet = Bob.Format_StringToDate(value);

return Convert.ToDateTime(RecSet.Fields.Item(0).Value);

}

catch

{

return DateTime.Today;

}

}

Regards, Lita

Answers (0)