Hi everyone,
I want to select a value from a choosefromlist and put it back to a EditText "TXT_TEMPLATE". This EditText is bounded to a field in the table ODLN. I created a property in the form where the EditText is, and set the public property to the value chosen from the cfl.
Code:
public SAPbouiCOM.Form m_oForm = this.SBO_Application.Forms.Item(FormUID);
//bound the EditText to a table field
SAPbouiCOM.Item oItem = m_oForm.Items.Add(TXT_TEMPLATE, SAPbouiCOM.BoFormItemTypes.it_EDIT);
oItem.Specific.DataBind.SetBound(true, "ODLN", USERFIELD_TEMP);
//Set the value to the EditText
private string templateID=string.Empty;
public string TemplateID
{
set
{
templateID = value;
m_oForm.Items.Item(TXT_TEMPLATE).Specific.Value = templateID;
}
}
When it gets to the property TemplateID, it can get the correct value. But it returns an error "From - Bad Value" when it gets to the line:
m_oForm.Items.Item(TXT_TEMPLATE).Specific.Value = templateID;
I can successfully set a string to the EditText when initialize it.
m_oForm.Items.Item(TXT_TEMPLATE).Specific.Value = result[0]["U_TemplateID"].ToString();
I don't know what is wrong. Can anyone help on this problem?
Thanks