Tip #1013: Include attributes that are not there

New Developer Guide, as it turned out, contains a lot of useful nuggets, little enhancements that make developer’s life much easier.

How many times did you need some field values for the use in javascript but didn’t really want to include the fields on the form? Something like lattitude and longitude, for example. Would it mean much to a user if I showed values -33.868820 and 151.209296? But I could definitely use those values to display a map with a pin indicating my current location.

The workaround used to be to add fields to the form but then set them to be invisible. Starting from version 9.0 you no longer need to add attribute to the form, you can instead set the attribute as a dependency for the JavaScript web resource:

  • Attribute will be available within the client API attributes collection.
  • The controls collection of the attribute will be empty.

 

Share on FacebookTweet about this on TwitterShare on Google+

One thought on “Tip #1013: Include attributes that are not there

  1. I often make a whole tab invisible for this very purpose AND to support business rules which would fail if any of the referenced fields are not on the form.

Leave a Reply

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