cancel
Showing results for 
Search instead for 
Did you mean: 

Problem getting Service Call UDF Form

costas_ioannou2
Active Participant
0 Kudos

Hi all,

I'm having trouble getting the service call udf form as soon as the form opens. Here is my code:

if (((pVal.FormType == -60110 & pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) & (pVal.Before_Action == true)))

                {

                    // get the event sending form

                    oServiceCallFormUDF = globals.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

                }

I have used the "-" sign, but it only works when I click on the UDF form. Can anyone help?

Thanks,

Costas

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor
0 Kudos

Hi Costas,

Can you try

if (((pVal.FormTypeEx == "60110" & pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) & (pVal.Before_Action == true)))

                {

                    // get the event sending form

                    oServiceCallFormUDF = globals.SBO_Application.Forms.GetFormByTypeAndCount("-" + pVal.FormTypeEx, pVal.FormTypeCount);

                }

Regards
Edy

costas_ioannou2
Active Participant
0 Kudos

Thanks for the reply.

I tried it. I had to modify it a little as it asks for an int, but it fails:

            if (((pVal.FormTypeEx == "60110" & pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) & (pVal.Before_Action == true)))

            {

                string formTypeExUDF = "-" + pVal.FormTypeEx;

                int formTypeExUDF1 = int.Parse(formTypeExUDF);

                // get the event sending form

                oServiceCallFormUDF = globals.SBO_Application.Forms.GetFormByTypeAndCount(formTypeExUDF1, pVal.FormTypeCount);

            }

I get an error shown below:

edy_simon
Active Contributor
0 Kudos

Hi Costas,

I nearly forgot.

If your version support,

Get the main form.

There is a property called

oForm.UDFFormuid or something like it.

Get the udf form by sbo_application.forms.item (oForm.UDFFormuid)

Note that the udf form has to be  visible on screen in order to woek.

Regards

Edy

costas_ioannou2
Active Participant
0 Kudos

Thanks Edy that works perfectly

Answers (0)