Best practices: setting a controller data value

Just taking some time to read through the new 3.5 Help Screens today (thanks - good job!) and was wondering on this command new in 3.5:

forms.company.controller.setDataProviderValue(‘company_name’,‘mycompany’);

When would one use this method in preference of:

forms.company.company_name = ‘mycompany’;

Michael

Late reply Michael but anyways :)

Not new, has been around from (I think almost) the beginning.

The first one is what you could use when you are working with a generic method to do some dynamic stuff directly on an element.

The second is obvious. It is the more direct way to get/set dataprovider values.

I use the first to set properties of elements on different forms where elements have the same name. Instead of writing/copying 3 methods I wrote one global method and use that to set the elements.

Hope this helps

Thanks. Marcel - that helps! Trust your summer is going well.

Best, Michael