cancel
Showing results for 
Search instead for 
Did you mean: 

Form AutoManage

0 Kudos

I implement simple form binding on usertable and i activate the automanage property.

It's ok.

If I scroll to a record and after click the find menu the form change the mode in FIND but the item stay full with data.

Same when I add a record.

What is the optimal method for reset all item?

I must cycling on the form.items object and set them value to empty string?

Ciao

Angelo

Accepted Solutions (1)

Accepted Solutions (1)

barend_morkel2
Active Contributor
0 Kudos

Unfortunately there is no "auto" clean facility using the UI. Just as you set values on the form items - you have to clean them as well. Thus you have to cycle through the form.items object and set the values to empty strings (or what ever the case may be).

Answers (1)

Answers (1)

former_member185703
Active Contributor
0 Kudos

Hi Angelo,

You should - whenever possible use datasources - instead of accessing items directly.

If you have bound the items to datasources, you just need to update the datasources + refresh the UI:

For DBDataSource use the Query method where you can specify a condition (technically it is a conditions collection - see the UI helpfile).

For UserDataSource (what is more like a variable), you must set the new values (datasource by datasource) etc.

However, if you want to empty the items, you could (at least this was possible with 2004) specifiy an invalid criterion in the conditions. When updateing the form - i.e. the items, the content was cleared.

However, in the UserDataSources you must set the value to empty string (unless it is a date; I suppose that you must use the current date - or in this case really set the item's Specific's String.)

HTH,

Frank

PS: I hope I didn't overlook sth... and of course I could not retest what I remembered

0 Kudos

Tank's.

I write a simple function that reset all field in DBDataSources. It work fine for me.

Private Sub RTS_Reset()

Dim oField As SAPbouiCOM.Field

For Each oField In i_RTS_DBDataSources.Fields

i_RTS_DBDataSources.SetValue(oField.Name, 0, "")

Next

i_RTS_Form.Update()

End Sub

Ciao

Angelo