ApexSerialization variable order

  • February 28, 2018 at 22:14 #22843

    Variables serialized by the [ApexSerialization] attribute seem to appear in alphabetical order in the inspector. Is there a way this can be set to appear in the order that the variables are defined? This would help in grouping related variables.

    March 1, 2018 at 10:25 #22847

    There is no way to have them ordered in definition order, however there are two ways to control the order.

    You can add a MemberCategoryAttribute to fields and properties to group them in categories (which will also give them a header). Categories are sorted by sortOrder and name.

    Similarly you can add a FriendlyNameAttribute to fields and properties to give them a name and sort order.

    March 1, 2018 at 14:38 #22849

    Very cool, thank you for your help!

You must be logged in to reply to this topic.