Empty Record giving display Errors

Hi All,

I have a page in my site pointing to a record. When I don't specify any default filters, I am able to fetch all the rows from the database table and display in the record. But when I am giving a filter on the user who inserted the record into the table, it is giving me error.

When the query "user_txt" is null, I am getting the error

"The Requested Record Type is Not Available: Cannot apply operator [EQUALS] to field [user_txt] when comparing to value [TypedValue[it=11, v={abanda}]].{APNX-1-4203-015}"

I was not able to find a solution in the forum except removing the UI on a whole with a showonly condition in case of a null set.

Please assist if anyone has worked on a fix on this.

 

Thanks,

Adi

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Thank you Josh. I have put a tostring before the first line of my rule to cast the result as a string whatever the result is. It is working fine now.

    My rule is a composition of if and else condition with multiple if classes. The weird thing (and why I think it was working fine for a particular user group) is, if the first if condition is true, the rule is returning a Text object, if it is false, for any subsequent if condition becoming true, the rule is returning a type 103.

    My rule:

    if(ismemberof(loggedInUser(), "Group 1"),
    tostring(tointeger(groupname("Group 1"))),
    {
    if(ismemberof(loggedInUser(), "Group 2"),
    tostring(tointeger(groupname("Group 2"))),
    {
    if(ismemberof(loggedInUser(), "Group 3"),
    tostring(tointeger(groupname("Group 3"))),
    },
    loggedInUser()
    },loggedInUser()
    )

    If the logged in user is from Group 1, I am getting the correct value as a Text type. But if the user belongs to any other group (2 or 3 or 4 and so on), I am getting a List of Text (type 103). I tried to fix it but couldn't do anything. So I have changed my rule slightly to return string value for whatever the outcome of the if condition is. And it is working fine.

    The rule, I have written from my memory so is absolutely wrong. I just wanted to show the representation of the rule.

    tostring(
    if(ismemberof(loggedInUser(), "Group 1"),
    tostring(tointeger(groupname("Group 1"))),
    {
    if(ismemberof(loggedInUser(), "Group 2"),
    tostring(tointeger(groupname("Group 2"))),
    {
    if(ismemberof(loggedInUser(), "Group 3"),
    tostring(tointeger(groupname("Group 3"))),
    },
    loggedInUser()
    },loggedInUser()
    )
    )

    Thanks,
    Adi
  • 0
    Certified Lead Developer
    in reply to AdirajuB
    Try updating the rule to be

    if(ismemberof(loggedInUser(), "Group 1"),
    tostring(tointeger(groupname("Group 1"))),
    if(ismemberof(loggedInUser(), "Group 2"),
    tostring(tointeger(groupname("Group 2"))),
    if(ismemberof(loggedInUser(), "Group 3"),
    tostring(tointeger(groupname("Group 3"))),
    loggedInUser()
    )
    )
    )