castinvalid

Hi,

am querying data and storing the value in local variable and am using it to save to nexasignee value 

when i include cast it will give error 

when i don't include cast here it will give castinvalid error how can i fix it 

what am doing here is am fetching the data from db so whenever i click on particular button then addedby_txt value need to saved in ri!nextassigne and updating the table values

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    If the value of your queried local variable is of the type "list of dictionary", you'll probably want to change it (preferably at the local variable definition itself) to be single type.  The easiest way to do this (presuming you're setting it up in such a way that you're always guaranteed to get a [single] result from your query) is to add "[1]" after the ".data" part at your query result - perhaps even inside the expression rule, if it's designed to query a single result anywhere it's used.

    The difference here is that "updateDictionary" is a little picky about data types, as you've found.  Less actually about the type than whether it's an array or not.  I don't think you should need to use "cast()" here, though, as long as the data you're feeding in initially is correct.

    Also, make sure your "get approver role" rule is returning non-list data.  Though in this case maybe just wrapping the rule call in "toString()" would be sufficient - if it's returning a list, that could also be messing up your updateDictionary functionality.

Reply
  • 0
    Certified Lead Developer

    If the value of your queried local variable is of the type "list of dictionary", you'll probably want to change it (preferably at the local variable definition itself) to be single type.  The easiest way to do this (presuming you're setting it up in such a way that you're always guaranteed to get a [single] result from your query) is to add "[1]" after the ".data" part at your query result - perhaps even inside the expression rule, if it's designed to query a single result anywhere it's used.

    The difference here is that "updateDictionary" is a little picky about data types, as you've found.  Less actually about the type than whether it's an array or not.  I don't think you should need to use "cast()" here, though, as long as the data you're feeding in initially is correct.

    Also, make sure your "get approver role" rule is returning non-list data.  Though in this case maybe just wrapping the rule call in "toString()" would be sufficient - if it's returning a list, that could also be messing up your updateDictionary functionality.

Children
No Data