cancel
Showing results for 
Search instead for 
Did you mean: 

User Defined Folder on System Form changing form mode

Former Member
0 Kudos

I've added an extra folder (tab) to the Item Master Data system screen. Every time the user clicks it the form mode changes from "OK" to "Update", and if they try to move to a different record they get the message "Changes will cause the data to be deleted", even though they haven't changed anything.

The folder is added through code and AffectsFormMode is set to false.

The only code actions I carry out when the folder is clicked is to set the forms panelevel, but even if I comment this code out then I still get the problem. If I set BubbleEvent to false then the form mode doesn't change, but the folder doesn't appear "selected" either.

Any suggestions on where I'm going wrong?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jon,

I use to have the same problem. It use to happen becouse of this:

Inside the folder there were some other controls, where I write values when the folder was clicked (they were only for reading, but need to initialize them "on the fly"). This controls AffectsFormMode was set to true.

Changing this property for the controls inside the folder fixed the problem.

Is this your case too?

Regards,

Ibai Peñ

Answers (2)

Answers (2)

rasmuswulff_jensen
Active Contributor
0 Kudos

The following test-code does not change the formmode... Are you sure its not some other item that does it?


//In itemEvent
if(pVal.FormTypeEx=="150") {
  if(pVal.EventType == BoEventTypes.et_FORM_LOAD && pVal.BeforeAction) {
    EventForm.Folders.Add("testUID","testCaption","9"); //9 beeing the item details tab UID
  }

  if(pVal.ItemUID=="testUID" && pVal.EventType ==   BoEventTypes.et_ITEM_PRESSED) {
    EventForm.PaneLevel = 42;
  }
}

Former Member
0 Kudos

Hi,

Just check this

when you are adding new folder on existing form then set the value to false at that point

Thanks

Former Member
0 Kudos

What type of object is "EventForm"? Using SBO 2004 the SAPbouiCOM.Form item doesn't have a Folders.Add() method?

Former Member
0 Kudos

Found the problem. The folder contained a matrix that displayed information about the item. Setting the AffectsFormMode to false for the matrix fixed the problem.

What I don't understand is why this was a problem, as the matrix was populated when the record changed, not when the tab was clicked (so why didn't the form mode change when the matrix was populated, rather than when it was displayed?)

Thanks to everyone for their help!

Former Member
0 Kudos

Hi Jon,

I have had this problem in SBO if you have a formatted search where the Automatically refresh settings are set to "Refresh Regularly". Sometimes it happens that it automatically refreshes a value when you scroll to the record and thinks the form should be updated.

I don't know if this is your problem, but hope it helps a bit at least.

Regards,

Adele