Skip to main content
October 9, 2024
Solved

Condition not working

  • October 9, 2024
  • 5 replies
  • 0 views

Hi ,

I have a scenario , where if a request is rejected by a user , the same request cannot be delete by the same user who rejected it .

a!buttonWidget(
label: "Delete",
icon: "times",
value: cons!Deleted[2]
saveInto: {ri!buttonAction}
style: "DESTRUCTIVE"

showwhen: and(

ri!readonly = false,

loggedinuser() = ri!maker ---- this is just a rule input with type text

a!isNotnullorempty(ri!rejectedby)

),

disabled: if(

ri!rejectedby = loggedinuser(),

true,

false

),

validate:false

Can anyone please help me with it . Thank you in advance.

    Best answer by somasundaram.d

    What is the type of rejectedby variable?

    Try comparing the variable of same type.

    tostring(ri!rejectedBy) = tostring(loggedinuser)

    5 replies

    somasundaram.d
    October 9, 2024

    What is the issue that you are facing with the code?

    October 9, 2024

    The delete button is not being disabled . 

    venkatrea696188
    October 9, 2024

    Then are you sure that the rejected by and loggedinuser matching?? if the values are same try wrapping loggedinuser in tostring()