I'm developing a prototype. I have an eSpace that has an entity, Person, with several attributes and another eSpace with a webscreen that will use it. One of the attributes is LastUpdated, which I want to automatically set to the current date/time any time the record is updated. I also want to do it automatically so that no developer can 'forget' to update this field. Here all all my ideas and what my issue was.
1) Set default value - only works the first time obviously.
2) Modify the CreatePerson action - can't be done since it is grayed out, I assume because it is a system generated action.
3) Created a structure to mirror the entity with appropriate entity attributes - setting each field can be done but seems error prone if there are lots of fields and eventually, there will be.
4) Created a structure to pass a Person record, made the structure public and Person private - fails as it requires that Person also be public.
5) Create a new action, CreatePersonAction that sets the field and then calls CreatePerson - this doesn't prevent someone from calling CreatePerson, which requires it to be public. If the generated CreatePerson action was shown in the Action tab and had its own public attribute, that would solve my problem but it doesn't provide that option.
While I have this issue setting this one field, I'm actually trying to accomplish all of the following.
1) Isolate the data layer so that only one or two developers are authorized to change it but give full access to everyone else to use it, update records, etc.
2) Prevent developers from calling the default generated actions on entities since they will never be used in my application except by my actions that encapsulate them. This is particularly true for the Delete action. For historical purposes, I cannot allow records to be deleted. I will have an action that sets the Status entity attribute to Inactive instead of using the Delete action.
3) Ability to validate or set fields as needed in the encapsulating functions.
Based on what I've done it looks like my best option is number 3 but it's cumbersome and potentially error prone. So, can anyone out there that can tell me where I'm going wrong? Thanks in advance for your help.