Hello,
I have to assign the date to the end of the current year for the Confiforms Field Definition.
I'm using ConfiForms Rules for Field Definition and 'Set value if empty'.
condition: (empty)
Values to set:
EmployeeContractEnd = [entry._now.formatDate("yyyy-12-31")]
How the condition should looks like? What's wrong here?
EmployeeContractEnd=[entry._now.formatDate(yyyy)]-12-31
Well yes.., it should be parseable from the format you have in the field, which is MMM dd, yyyy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm trying to place the date like this, is it correct approach (just to check if it's working, but not)?
EmployeeContractEnd=[entry._now.formatDate(MMM dd, yyyy)]
And also maybe there is problem with ConfiForms Rules for this field? Or it shouldn't be affected?
condition:
!EmployeeContractEnd:[empty] AND EmployeeContractEnd:<=[entry.EmployeeContractStart]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is how you can set the date
(I have put "set parameters" values on the page, so you can see what I have)
Complete storage format
<ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="f0d53540-a2ea-49d8-8b0f-0a2b151e8069"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="e70c2cc5-72d6-4b55-bdfc-d30423f6b5c3"><ac:parameter ac:name="type">Embedded</ac:parameter><ac:rich-text-body><p><br /></p></ac:rich-text-body></ac:structured-macro><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="625711c7-44f4-4c05-ba81-af0ad3eeba1e"><ac:parameter ac:name="fieldName">EmployeeContractEnd</ac:parameter><ac:parameter ac:name="fieldLabel">EmployeeContractEnd</ac:parameter><ac:parameter ac:name="type">date</ac:parameter></ac:structured-macro></p><p>EmployeeContractEnd=Jan 31, [entry._now.formatDate(yyyy)]</p><p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="bfcaf9da-036f-4807-bda1-f18d26d732af"><ac:parameter ac:name="condition">id:[empty]</ac:parameter><ac:parameter ac:name="values">EmployeeContractEnd=Jan 31, [entry._now.formatDate(yyyy)]</ac:parameter><ac:parameter ac:name="action">Set value if empty</ac:parameter></ac:structured-macro></p><p><br /></p><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="94744241-f65c-4572-914c-2302312b2cd5"><ac:parameter ac:name="fieldName">EmployeeContractEnd2</ac:parameter><ac:parameter ac:name="fieldLabel">EmployeeContractEnd2</ac:parameter><ac:parameter ac:name="type">date</ac:parameter></ac:structured-macro></p><p>EmployeeContractEnd2=[entry._now.formatDate(yyyy).prepend(31-01-).parseDate(dd-MM-yyyy)]</p><p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="197a3735-dfd8-4751-808e-f7f24a29e629"><ac:parameter ac:name="condition">id:[empty]</ac:parameter><ac:parameter ac:name="values">EmployeeContractEnd2=[entry._now.formatDate(yyyy).prepend(31-01-).parseDate(dd-MM-yyyy)]</ac:parameter><ac:parameter ac:name="action">Set value if empty</ac:parameter></ac:structured-macro></p><p><br /></p></ac:rich-text-body></ac:structured-macro><p><br /></p>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.