cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding agreements with a perpetual term from scripts

Former Member
0 Kudos

We have a script that automatically calculates the expiration date. However, we now have a business need to set the perpetual flag. This is causing the script to error out. Please see the script attached. Any suggestions of how to check for and exclude if the perpetual flag is set would be welcome. Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Christopher,

Can you share the error message which you got.

And also, in the script you mentioned as "fieldMetaData2 = doc.getFieldMetadata("P_CAN_PENALTY");".Is P_CAN_PENALTY the internal name of the Perpetual flag?

Regards,

Vignesh

Former Member
0 Kudos

Hi Vignesh

P_CAN_PENALTY is a custom field unrelated to the perpetual flag. There is a system standard check box that indicates whether an agreement is perpetual or whether it has an expiration date. I just do not know how to bring check and validate whether the perpetual flag is set.

The error message is a fairly generic message "You cannot set an expiration date for a perpetual contract. If you want the contract to expire on a specific date, deselect Perpetual Terms and enter the expiration date." and it occurs because the script is attempting to default an expiration date based on the effective date of the agreement.

Thank you

Christopher