on 10-23-2007 4:26 PM
On the Service Call form, I would like to fill in the "Subject" edit text box using code.
Here's my code:
Dim objForm1 As SAPbouiCOM.Form
Dim objFormItem1 As SAPbouiCOM.Item
Dim objEditText1 As SAPbouiCOM.EditText
objForm1 = objSboApp.Forms.Item(<FormUID>)
objFormItem1 = objForm1.Items.Item("6")
objEditText1 = objFormItem1.Specific
objEditText1.Value = "Some Text"
Prior to this I am also setting the ActiveItem to the "Mfr Serial No." field.
When this code runs, it sends an error:
-3031
Bad Value
...and it brings up a Customer Equipment Card List window. It also places my string, "Some Text" into the 'Find' field in the Customer Equipment Card List window. The 'Find' field also happens to have a UID of "6".
I get the same error if I try to first set the ActiveItem to "6" (objForm1.ActiveItem = "6") and also the same error on (objEditText1.Active = True)
Any ideas?
Thanks!
Message was edited by:
Paul Madden
Hi,
Is ur EditText bound to UserDataSource or DBDataSource if Yes,then give ur code of binding the datasource.I will try to solve ur problem.
Regards,
Lalit Narayan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To Add Value, from CFL in System Form UDF. Please Check your code
In header table udf is located at left side of system form, user Defined values (Ctrl + Shift + U)
pVal.FormUID carry the System Form only.
oForm.Items.item(pVal.ItemUID).Specific.Value = val
throws error 3031 and 7076 Form-Bad value, Item is not user defined item.
Solution:-
oform = oAPPlication.forms.Item(pVal.FormUID)
Dim oUDFForm As SAPbouicom.Form
oUDFForm = oAPPlication.forms.Item(oform.UDFFormUID)
oUDFForm.Items.Item(pVal.ItemID).Specific.Value = val
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check whether the datatype of the edittext is Alphanumeric or numeric.
regards,
varma
Edited by: varma varma on Dec 28, 2007 8:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Paul,
I am having this same problem, except using a different form (Sales Order form), and am trying to update the cardcode field. How did you manage to get passed this error?
TIA,
Anthony Mann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't remember all the reasoning behind it since it was a couple months ago. But here is what I ended up with:
objForm = objSboApp.Forms.Item(<form_uid>)
objFormItem = objForm.Items.Item(<item_uid>)
objEditText = objFormItem.Specific
If objFormItem.Enabled = False Then
objFormItem.Enabled = True
objEditText.String = "Your Data Here"
objFormItem.Enabled = False
Else
objEditText.String = "Your Data Here"
End If
Don't forget to Dim the Form, FormItem, and EditText if you haven't already. Also, my naming convention is a little different than the SDK samples.
Hi All,
Just a note (according to the SDK Help Files AND my experience)
1. When there is a DataSource - always use the DataSource to get/set values.
2. When assigning values to an item always use .String (.Value works sometimes BUT not all of the time).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
You try like this, Its work here.
oForm.Items.Item("8").Specific.Value = Trim(pono)
Regards,
G.Suresh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you tried this? Also try assigning to data source
objEditText1.String = "Some Text"
Ravi Shankar B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.