Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

I'm a novice trying to DIY... need help with a formcalc scrip

Avatar

Former Community Member

I have a dynamic pdf form, which I edit with Adobe LiveCycle Designer 7.

It has a DROP-DOWN FIELD called "txtPayMode"

I have the following code in it's ENTER event... which CHANGES the value of another DROP-DOWN FIELD called "TariffBracketDropDownList", based on the CURRENT MONTH...

----- form1.Pg1_Subform.Header.txtPayMode::enter - (FormCalc, client) ------------------------------

if ((Num2Date(Date(), "MM") == 09) |

     (Num2Date(Date(), "MM") == 10) |

     (Num2Date(Date(), "MM") == 11) |

     (Num2Date(Date(), "MM") == 12) |

     (Num2Date(Date(), "MM") == 01) |

     (Num2Date(Date(), "MM") == 02) |

     (Num2Date(Date(), "MM") == 03))


   then form1.Pg1_Subform.Header.TariffBracketDropDownList.rawValue = 0;

   else form1.Pg1_Subform.Header.TariffBracketDropDownList.rawValue = 1;

endif

So, when "txtPayMode" is ENTERED, "TariffBracketDropDownList" changes to <value 0> ("Season Rate") - IF the present month is between September through March...

And...................................................... "TariffBracketDropDownList" changes to <value 1> ("Off-Season Rate") - IF the present month is between April through August.

This code and it's function is working correctly.

But now, I want to have a DIFFERENT 'trigger' to affect the SAME change...

I want to use similar/ other code in the EXIT event of a THIRD DROP-DOWN (Date/Time) FIELD, called "dateFrom1", so that when a date is selected in that field, it triggers the SAME change in the "TariffBracketDropDownList" field, based on the MONTH of the date chosen...

That is, if the date chosen in the "dateFrom1" drop-down date/time field falls between September through March, then it's exit event should change

"TariffBracketDropDownList"  to <value 0> ("Season Rate")...

And otherwise, to <value 1> ("Off-Season Rate").

I tried modifying the original code logically, to make the following code - but that does not seem to do the trick!

[The 'modified' code I tried]...

----- form1.Pg1_Subform..Body.dateFrom1::exit - (FormCalc, client) ------------------------------

if ((Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 09) |

     (Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 10) |

     (Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 11) |

     (Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 12) |

     (Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 01) |

     (Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 02) |

     (Num2Date(form1.Pg1_Subform.Body.dateFrom1, "MM") == 03))


then form1.Pg1_Subform.Header.TariffBracketDropDownList.rawValue = 0;

else form1.Pg1_Subform.Header.TariffBracketDropDownList.rawValue = 1;

endif

This modification did not work!

So, ANY suggestion/ help/ substitute solution would be much appreciated!

Thanks in advance...

0 Replies