RE: Validation

if(
  ri!valueType_txt = "Ratio",
  if(
    and(
      like(ri!inputValue_txt, "*:*"),
      isnull(
        stripwith(ri!inputValue_txt, "1234567890:.")
      ),
      not(
        isnull(stripwith(ri!inputValue_txt, ":."))
      ),
      left(ri!inputValue_txt) <> ":",
      right(ri!inputValue_txt) <> ":"
    ),
    "",
    cons!CR_APP_COV_THRESHOLD_VALIDATION_MSG[1]
  ),
  if(
    ri!valueType_txt = "Ratio:1",
    if(
      and(
        like(ri!inputValue_txt, "*:1"),
        isnull(
          stripwith(ri!inputValue_txt, "1234567890:.")
        ),
        not(
          isnull(stripwith(ri!inputValue_txt, ":."))
        ),
        left(ri!inputValue_txt) <> ":",
        right(ri!inputValue_txt) <> ":"
      ),
      "",
      "Value is not in the format of m:1."
    ),
    if(
      ri!valueType_txt = cons!CR_APP_FIN_COV_VALUE_TYPES[3],
      if(
        and(
          len(
            stripwith(ri!inputValue_txt, "0123456789.")
          ) = 0,
          len(cleanwith(ri!inputValue_txt, ".")) < 2
        ),
        if(
          and(
            len(
              cleanwith(ri!inputValue_txt, "0123456789")
            ) < 15
          ),
          "",
          cons!CR_APP_COV_THRESHOLD_VALIDATION_MSG[3]
        ),
        cons!CR_APP_COV_THRESHOLD_VALIDATION_MSG[4]
      ),
      if(
        ri!valueType_txt = cons!CR_APP_FIN_COV_VALUE_TYPES[4],
        if(
          and(
            len(
              stripwith(ri!inputValue_txt, "0123456789.%")
            ) = 0,
            len(cleanwith(ri!inputValue_txt, ".")) < 2
          ),
          "",
          cons!CR_APP_COV_THRESHOLD_VALIDATION_MSG[4]
        ),
        ""
      )
    )
  )
)

Hi Everyone, I am looking for a solution related to when valueType= "Ratio:1", then the upto 3 decimals on left side:1 ,need to restrict values which are entered more than 4 decimals in left only, How Can I do that,Can anyone help to do that?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi JS,

    Over all as far i understand , after the ratio in the provided text by user, you should allow only three characters after ratio, if its more than three you should show an message right?

    see if the below logic works

    a!localVariables(
    
    local!splitValues:split("ABC:12323",":"),
    
    
    
    if(len(index(local!splitValues,2,""))>3,"Greater than three","Good")
    
    )

    if this is not what you are expecting, can you help with user input and what validation you are trying to perform.

Reply
  • 0
    Certified Senior Developer

    Hi JS,

    Over all as far i understand , after the ratio in the provided text by user, you should allow only three characters after ratio, if its more than three you should show an message right?

    see if the below logic works

    a!localVariables(
    
    local!splitValues:split("ABC:12323",":"),
    
    
    
    if(len(index(local!splitValues,2,""))>3,"Greater than three","Good")
    
    )

    if this is not what you are expecting, can you help with user input and what validation you are trying to perform.

Children