Customizing the SData Model for Entities in Infor CRM Mobile in Version 3.4 and Above

As of mobile 3.4, each entity has a model which describes the data to retrieve for it’s different views (detail, edit, list). The models can be customized in the same way as you register customizations for a view. In mobile versions previous to 3.4, you would use methods, such as querySelect to add a new property to the SData query for a view. This method will still work, just like before, for backwards compatibility. However, modifying the model is the preferred way to do this in 3.4 and higher.

To add to the model, such as the contact model for the details view, you would add the following:

Both of the code samples above accomplish the same, to include the contact property SomeContactProperty to the SData query for the Contact detail view. Also note, BOTH of those will still work in current mobile, although the first is the preferred method in 3.4 and later, adding to the querySelect is only there for backwards compatibility.

Also note, if you need to add an entity to the “include” part of the query, to include related entities in the query, you can register those in the model like this:

Obviously, for all of that, you can change the ‘models/detail/querySelect’ to ‘models/edit/querySelect’ or ‘models/list/querySelect’ to add properties to the query for the edit or list views as well.

One last thing, it is worth noting, for all of the above – adding fields to the querySelect, adding include entities, adding queryOrderBy fields to sort by, the value part can be arrays as well. There is no need to add one of the above sections for each and every field you’re adding. For example, in the first sample where we added SomeContactProperty to the querySelect for the contact model, if we wanted to also add AnotherProperty and OneMore to the model, we could do it all at once as an array:

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. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.