I am probably missing something simple but when I try to access the Layer View of a Feature Layer using view.whenLayerView I am getting the error "No layerview has been found for the layer" .

I am just working on this on my local machine. Can anyone see what I have wrong?