cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic change Form ID

Former Member
0 Kudos

Hi,

  This is rahul.I have an issue.When I am open user defined form via Workflow.Getting me form id changed in form load event.If Form Id ABC Then Getting me ABC0,ABC1,ABC3....

Please tell me about this issue... i am Stuck...?????

Thanks & Regards

Rahul

Accepted Solutions (0)

Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

It's possible to have multiple instances of the same form open. Such as when you open twice the Invoice form.

You can capture the ID using the arguments passed on the FormLoadEvent (usually pVal.FormUID).

To have only one instance you can change the XML of your form to a fixed value.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi Pedro,

i am already the arguments passed on the FormLoadEvent (usually pVal.FormUID).

Here My Code...

Public Sub ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean)

        Select Case pVal.EventType

            Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD And pVal.FormTypeEx = "UDO_FT_B1ODTO" And pVal.Before_Action = False

                objform = objMain.objApplication.Forms.Item(FormUID)

MessageBox.Show(objform.UniqueID)

End Select

    End Sub

Get form id UDO_FT_B1ODTO0,UDO_FT_B1ODTO1,UDO_FT_B1ODTO2

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

How are you creating your form? Code or XML?


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi Pedro,

  Creating Form Via XML.

Regards

Rahul

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

In the form XML there is an attribute (usually uid in the form tag) that you can set. If you set it it will always have that Id. This means you cannot open a new instance of the form if you have one already opened.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Sorry.First Create Table Via Code And Then Register Udo Manually Then Using B1 Studio Open UDO Form And Change Some design And Save into Database And Use This Form In WorkFlow But When Open this Form i want Some Functions on this form but  only on form load event get form id changed

AdKerremans
Active Contributor
0 Kudos

Hi Rahul,

When you catch the form_load vent you always get the current FormUID and with

objform = objMain.objApplication.Forms.Item(FormUID)


you have the current form.


Regards


Ad

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

Check if in B1 Studio when you select the form, in the properties, you have an FormID or FormUID?

If so change it there. Should have the same effect (however I'm not sure). Let me know if that works for you.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi Pedro,

  In B1 Studio When I am select form then in properties window i have uniqueid property.and i am set this property .

Thanks

Rahul

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

Then that is the behavior. Since you are using the default UDO form, and the setting in the UniqueID gets "ignored", the only way I see it is to create an addon and do the loading of the form via the LoadBatchActions.

Anyway why do you need to have only one form id?


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

I want On Form Load Event Any functionality on this form.Disable some items.Visible ,Invisible

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

You don't need to have only one id for that. The code you showed above will still work for all the instances of the form that you open.

In example:

If you open your form and disable an item. Then you open a second instance of the form the item will also be disabled.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

no way they give me error

when command on item.this item not found

Former Member
0 Kudos

In System Information They Show Proper id

AdKerremans
Active Contributor
0 Kudos

Hi Rahul,

That sometimes happens with system forms. the form is loaded, but not all items are on the form yet.

I always use the Form Activate event and set a flag to see if it is the first time the form is activated.

Regards

Ad

pedro_magueija
Active Contributor
0 Kudos

Hi Rahul,

Like pointed out, the issue you are seeing is not related to the id. It's related to items sometimes not being available after the form loads.

Try as suggested first, and let us know how it goes.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn