Finally, long awaited Form methods.

Todd Hardin posted a reminder in the SalesLogix BP news groups of some long awaited new Form methods with ActiveForms introduced in v6.1. I got so used to doing things the old way I forgot all about them. They will definatly save some time, and make code easier to read. Thanks Todd.

I’ve only seen one prior post on this in a thread between Ryan Farley, myself, and an SLX Dev Team member about the v6.1 Beta release – so thought I would throw this out here as a reminder to everyone as these new methods and props proved useful to me recently.

.Post (method)
The form object now has a .Post method to force data saves – I used this for modal forms where I needed the data to be saved because I was loading another (dependant) modal for on top of the first.

.Refresh (method)
Retrieves the data and re-binds to form controls.

.ActiveControl (property)
This is used to tell the form where to put focus when the form is displayed. This can be handy when used in the AXFormCreate() or AXFormOpen() events. As several of us found out previously, you can’t use MyControl.Focus to place focus where you want it, because during form Create and for Open events, the controls are not yet available. Set the .ActiveControl property to accomplish this instead.

.ModalResult (property)
If you want to programatically close a form, rather than using a .Close method (method does not exist). Use the ModalResult method and set the value to mrOk or mrCancel. The form will close and will return your modal result retcode to the caller.
ex.  MyForm.ModalResult = mrOk
This is much better than using the legacy function –
application.BasicFunction.CloseCurrentView True|False.

ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!