You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Customization of Expiration date field in Redwood

Summary:

want to hide the continue button, want to make it a hard block. Tried to add a fire notification on National identifier if it starts from 9 but its not working as it comes for a short duration and goes away, need to make expiration date mandatory if the National identifier starts from 9 or hide the continue button

Content (please ensure you mask any confidential information):

define([], (ActionChain, Actions, ActionUtils) => {

/**
*

  • @param {object} context
  • @return {boolean}
    */
    function runCondition(context) {
    const { $fields, $messages, $value } = context;
const expirationDate =  $fields.personNationalIdentifiers?.ExpirationDate?.$value();const nationalId =  $fields.personNationalIdentifiers?.NationalIdentifierNumber?.$value();const isValidNationalId =  typeof nationalId === 'string' && /^9\d{8}$/.test(nationalId);const isExpirationDateEmpty =  expirationDate === null ||  expirationDate === undefined ||  expirationDate === '';if (isValidNationalId) {  if (isExpirationDateEmpty) {    $messages?.addError?.(      'Error Message: Expiration Date is allowed only when National ID starts with 9.'    );    return false;  }  return true;}if (!isExpirationDateEmpty) {  $messages?.addError?.(    'Error Message: Expiration Date is allowed only when National ID starts with 9.'  );  return

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!