11-16-2018 03:28 AM
Hi,
I am defining an aspect model:
<aspect name="mt:myAspect">
<properties>
<property name="mt:effectiveDate">
<type>d:date</type>
<mandatory>true</mandatory>
<default>(I want to use current date here)</default>
</property>
</properties>
</aspect>
Because this property shall be mandatory, the default value cannot be an empty string (the empty string will cause errors). Can you help please?
Thank you!
11-17-2018 12:04 AM
You can write a behavior that sets the property with the current date.
If you are not familiar with behaviors, check out my tuorial on the topic: Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials
11-17-2018 12:04 AM
You can write a behavior that sets the property with the current date.
If you are not familiar with behaviors, check out my tuorial on the topic: Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials
11-17-2018 08:11 PM
Thanks Jeff Potts, Your tutorial is great. I will study it carefully.
11-17-2018 04:32 AM
Hi:
I imagine that from the model point of view you can set an ISO 8601 date by default.
On the other hand, in the Jeff's line, here you have a small customization for doing similar thing with cm:effectivity aspect and cm:to property (in this case the behaviour is for setting one month from the creation date).
Regards.
--C.
11-17-2018 08:12 PM
Thanks Cesar Capillas. I will use your code as a reference.
Explore our Alfresco products with the links below. Use labels to filter content by product module.