In the application logic, you will often need to refer to object properties such as column IDs and file names. You can do so by calling the object and the string ID of the property, but this is not best practice. Instead, any property you need to refer to in your code should be defined as a constant in S3. You can define constants in two ways:
- Manual: You can add individual constants manually.
- Query: You can execute a query to add multiple constants at once. Commonly, you will execute a query to return all the items in a code group and create a constant for each one.
When you create or update constants, build them as an assembly so you can use them in your C# code (you can also use constants in your XML rules and testing scenarios). If you call a constant from the assembly in your code and then later change that constant's ID, recompiling will flag all the instances of the assembly's inability to resolve due to the ID change. However, best practice is to avoid updating constants once they are in use.
This post is part of the Rules topic. Click here to open the Rules Overview.