cancel
Showing results for 
Search instead for 
Did you mean: 

How to make UDF-Form mandatory?

Former Member
0 Kudos

Hi

Please have a look at the following situation:

In new orders i keep track of the Weight - Column. I sum it up and save the result in a UDF. Since this has to work when entering each orderline (new ones that aren't saved too) SQL - Queries are a no go.

So i defined a UDF and use appropriate events of the orderform to update the UDF on the UDF-Form.

This works BUT:

- I don't know how to make the User Field Form (The one that gets added when activating View/User defined Fields)

mandatory. I always can be opened/closed by the mentioned menu option.

I tried to ".enabled=false" the menu in the form_activate event but it shows strange behaviour and generates exceptions from time to time.

At least i managed to disable the close-Button (cross) on the UDF-Form so it can't get closed from there.

Does somebody know hot to make this UDF-Form Mandatory?

TIA

Phil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can do this using the SDK by following this process:

After the order form has activated, check the forms collection to see if there is a form with a type value of 'order form type * -1'. If such a form is there, then your user defined field form is there.

If there is no form of such type, then there is no UDF form displayed. You can display the UDF form by forcing a menu click using the ID that the UI executes when the 'Display User Defined Fields' menu item is clicked.

Note that the UDF form detection logic described above only works 100% reliably when there is only one order form displayed. Depending on your needs, you may need to account for this.

I use this process in my projects to ensure that the UDF form is loaded when the form loads. I also use it when saving, if I need to validate the state of a user field before saving.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Demetree

Thats quite similar like i implemented it. (I use a try catch block instead checking the collection for the existence of the *-1 form)

I would like an more reliable solution from SBO itself.

Thanks

Phil

Former Member
0 Kudos

Hi,

SBO doesn´t give any standar way to make a UDF mandatory. The property "mandatory" that is set when a UDF is created can´t be used if non default value is set.

I have spoken to Avi Lupu from SAP in a training and said they wild keep this issue in mind. I hope he will read this post, and see that are more people interested on this.

Untill it, we will had to work with the kind of solution you both talk about.

Regards,

Ibai Peñ