cancel
Showing results for 
Search instead for 
Did you mean: 

Deactivate system form fields + data browse

Former Member
0 Kudos

Hi,

I've deactivated several fields on a system form, but when I browse the records the fields apear for a few moments and disapear afterwards.

Is it possible to eliminate this delay when browsing the records so that the fields never apear?

For browsing the records I catch the ItemEvent et_ITEM_PRESSED.

I've tried several possibilities but the delay is always there!

I'm using SBO 2005A SP:00 PL:04.

Thankx,

Vítor.

Accepted Solutions (1)

Accepted Solutions (1)

Gianluigi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Vitor yes I think you should pack that on an XML. And attach the load of the XML also at all the UI events that seems to revert back your changes.

Answers (1)

Answers (1)

Gianluigi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Did you use UI API calls ? I mean: did you loop on the items and set the property Visible to false ? if this is the case you maybe could consider packing all these instructions in an XML containing an update action and execute it with LoadBatchActions. B1 SDK documentation contains all the details for this.

A technical note:

When you call UI API you are in reality using COM proxies and then your call is in reality executed in a different address space, the B1 desktop one. That could cause delay due to the load of all the IPC, and then the flickering. With XML this communication is batched and your loop in moved into the B1 desktop address space.

Former Member
0 Kudos

Hi Gianluigi,

Yes, I'm using UI API calls.

Here is my code:


Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

            'Form 134 = BP Master Data

            If pVal.FormType = 134 Then
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD Or pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then
                    
                    oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)

                    'Deactivate fields from form:
                    'IDno. 2
                    oForm.Items.Item("114").Visible() = False
                    oForm.Items.Item("113").Visible() = False
                    'Unified Federal Tax ID
                    oForm.Items.Item("62").Visible() = False
                    oForm.Items.Item("73").Visible() = False
                    'Sales Employee
                    oForm.Items.Item("59").Visible() = False
                    oForm.Items.Item("52").Visible() = False
                    oForm.Items.Item("53").Visible() = False
                    'Agent
                    oForm.Items.Item("226").Visible() = False
                    oForm.Items.Item("228").Visible() = False
                    oForm.Items.Item("227").Visible() = False
                    'BP Channel Code
                    oForm.Items.Item("333").Visible() = False
                    oForm.Items.Item("335").Visible() = False
                    oForm.Items.Item("334").Visible() = False
                    'Technician
                    oForm.Items.Item("336").Visible() = False
                    oForm.Items.Item("337").Visible() = False
                    oForm.Items.Item("338").Visible() = False
                    'Territory
                    oForm.Items.Item("343").Visible() = False
                    oForm.Items.Item("344").Visible() = False
                    oForm.Items.Item("345").Visible() = False
                    'Language
                    oForm.Items.Item("431").Visible() = False
                    oForm.Items.Item("430").Visible() = False
                    oForm.Items.Item("432").Visible() = False


                    'Deactivate UDF if BP cardcode <> ASSO...
                    oUDFForm = SBO_Application.Forms.GetForm("-134", 1)
                    oEdit = oForm.Items.Item("5").Specific
                    vVal = oEdit.Value
                    If Not vVal.StartsWith("ASSO") Then
                        oUDFForm.Visible = False
                    Else
                        oUDFForm.Visible = True
                    End If

                End If
            End If

    End Sub

So, should I pack the instructions in a XML?

I'm also doing a comparison to hide the UDF, but if I move the form, the UDF comes back again!

How can I keep the UDF hidden?

Tkx,

Vítor.

Former Member
0 Kudos

Hi Vitor

If you works with system form you can't deactivate the Item for SDk, you only deactivate for program.

You can deactivate Item if the form is a user form.

Former Member
0 Kudos

Hi Jose,

Can you please be more specific.

I already deactivated the items, but I just can't eliminate the delay!

And about the UDF, can someone give me a hand?

Thankx,

Vítor.

Former Member
0 Kudos

I relalized that the fields with delay are the ones not common both to Customer and Vendor entries.

All other fields set Visible = False never apear again.

SBO activates specific fields acording to the BP type.

Is there any way to avoid this type of event?

Regards,

Vítor.