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!
Solved! Go to Solution.
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
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
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.
Thanks Jeff Potts, Your tutorial is great. I will study it carefully.
Thanks Cesar Capillas. I will use your code as a reference.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.