I am designing a contract form. It works well if I enter all the information manually. What I want to do is automate some fields.
I have a date field named "Expiration_Date."
Under the Expiration date field I have a Repeating Section (called Extension) with two other Date fields: "Former_Expiration_Date", and "New_Expiration_Date."
The purpose of this repeating section is to have the user insert the section if an extension is needed. There can be multiple extensions, hence the use of a repeating section.
When the first extension is inserted I want the "Former Expiration Date" field's value to be set to match the value of the "Expiration Date" field. Now if I add a second extension I want the second occurance of the Repeating Section's "Former Expiration Date" to be set from the value of the first occurance's "New_Expiration_Date" instead of the original "Expiration_Date", and the third occurance to be populated from the second and so on...
I have tried to accomplish this using rules, but it doesn't seem to work.
I created a rule in the "Extension" repeating section. The condition is: "if the expression, count(.) = 0" then the action to set a field's value would be "Former_Extension_Date = Extension_Date"
The second rule: The condition is: "if the expression, count(.) >= 1" then the action to set a field's value would be "Former_Extension_Date = preceding sybling:New_Extention_Date"
This does NOT work.
If this makes sense to anyone, can this be accomplished with rules? or do i have to write some code? If code, then can someone give me some help with the code. I am familiar with VB.