CS0103 error

I’m puzzled by a CS0103 error in custom code. Why can I set a widget variable to dsCustomerCustomerFSPriceListRow.ListCode

and then use the variable in custom code, but if I try to use dsCustomerCustomerFSPriceListRow.ListCode directly in the custom code, I get a CS0103 error?
image

Thanks!