on 08-03-2009 7:04 AM
Dear Support,
I have designed a form in screen painter and also added controls, even for Code and Name. Then I binded all the contols to table fields via sdk.I have registered usertable as UDO of Type Master.Then in the fordataevent BusinessObjectInfo.BeforeAction = True, I have created an object of the usertable and set values for Code and Name.but application generating an error 'Invalid Code (173-36).I was not able to insert any record to usertable. But on checking the form.BusinessObject.key in the formdata event, it returs an empty string.Since its an userdefined table How we can set Object key for the Table?.Does Object Key means code field. Can any one help me Please.
Thanks in advance.
Edited by: Nirmala Thomas on Aug 3, 2009 1:56 PM
Hi Nirmala,
You cannot add data to a UDO-type user-defined table in this way. The UserTable object in the DI API is used to manipulate data in non-UDO tables and won't work for UDOs.
Typically with a UDO all you need to do is set the ObjectType property of the form to the name of your UDO and then bind the controls to the fields of the table. SBO will then automatically provide the functionality to add and edit data. Alternatively, don't register your table as a UDO and then you can read and write data to it using the UserTable object
Since patch 47 of SBO 2007A there has been a new object in the DI API to manipulate UDO data directly through the DI API.
Kind Regards,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Firos,
I have generated code by an autoincrementing function. but initially I binded textfield control to code field and assigned value to textfield. But here you assigned value first and then only you binded that control to code field.Which is the right way of assigning value? Even if I tried all these methods invalid error code is still coming..Please suggest me a solution.
Thanks in advance.
Nirmala Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Support,
Thanks for the reply.I have already added ObjectType property of the form to the name of the UDO and then binded the controls to the fields of the table.Since its a master type UDO I have binded controls for code and Name also.But Invalid Error Code is coming when inserting data.No data get inserted into the table. I am trying for a first time Insert into the table.Can you suggest me any proper event to assign values to code and name field. I have already tried formdata event and item event.Now I made it as an entry field.No way Its not working.Any suggestions Please..
Regards,
Nirmala Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
Generate Code serial by coding..You can try this alternative
rs.Doquery("Select Max(Code) from [@tablename]")
Dim S As string = rs.Field.item(0).value
if S = string.empty or something Then
oEditText =1 'If no data exist in database
Else
oEdittext = S+ 1
End if
Then bind oEdittext text to Code field.
By
Firos.C
Hello,
Ur Code(primary key) of table Type master not getting incremented. U have to increment code each record like series of numbers 1,2,3...
I think while inserting record into database ur same code is inserting. Go and check in database. i think one record u r inserted with Code value as 0
Hope help u..
[R u a Mallu(Kerala)..like me.]
By
Firos.C
Edited by: firoz101 on Aug 4, 2009 5:40 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.