How to get the current date into a field value?
- Create a field of a Date type in the Document Definition:
- Switch to the Rules tab and add a new script rule.
- In the rule settings add the newly created field and make sure the Read Only option is disabled for the field.
- Use the following sample script as a reference:
DateTime currentDate = DateTime.Now;
Context.Field("Field").Value = currentDate.ToString();
- Save and publish the Document Definition.