Upload error

  

I'm getting this error while uploading the picture.


[MJUTDB042].DBO.[OSUSR_LPL_STAFFPICTURE] with key 1 was not updated


Refer the oml.

Hi Sathish.

Can you describe the steps to reproduce the error.

One thing I noticed on a quick view is that in the action SignUp of the screen Registrations, you're using the wrong Upload widget on the validation prior to the creation of the entity StaffPicture, where you should use the Upload2.Filename instead of Upload1.Filename:



I got it. 

While editing the picture, in the action Update you're trying to update an entity that doesn't exists and where you're assign the primary key.

You should instead use a CreateOrUpdateStaffPicture because you didn't created well the picture when you created the New Staff Registration.

If you do both corrections (in the SignUp and Update actions), your code should work. 

Just also be aware (beside the optimisations you should do in the code) that the validation you're doing in the Update action (to see if you'll update the picture or not), is not taking into account the case where you don't have an image yet.

Hope this can help you. 


Gonçalo Martins wrote:

I got it. 

While editing the picture, in the action Update you're trying to update an entity that doesn't exists and where you're assign the primary key.

You should instead use a CreateOrUpdateStaffPicture because you didn't created well the picture when you created the New Staff Registration.

If you do both corrections (in the SignUp and Update actions), your code should work. 

Just also be aware (beside the optimisations you should do in the code) that the validation you're doing in the Update action (to see if you'll update the picture or not), is not taking into account the case where you don't have an image yet.

Hope this can help you. 



Got it. Thank you Martins :) .