Skip to Content
author's profile photo Former Member
Former Member

User Field as date

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2004 at 08:46 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.