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

  • 0
    Certified Lead Developer

    I am not quit understand your question. But this is what I am expecting, you are trying to save List of Variant or DataSubset data to your text filed. 

    Can you update your code with this logic where ever you have local!crModulesStatusHistoryfirLastCC_cdt.addedBy_txt

    tostring(index(local!crModulesStatusHistoryfirLastCC_cdt, "addedBy_txt", ""))
    
    incase if the above logic won't work try this one as well
    
    tostring(index(local!crModulesStatusHistoryfirLastCC_cdt.data, "addedBy_txt", ""))

    If you still see an issue please provide us what error message that you are getting

  • 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.