This is a migrated thread and some comments may be shown as answers.

Readonly triggered field configuration

5 Answers 96 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stefano
Top achievements
Rank 1
Stefano asked on 26 Jan 2015, 06:42 PM
Hi,
I have a problem with the data access designer configuration for a readonly triggered column.
I tried to set column property "kind" like "Calculated" but when I tried to save a record of this table, the value changed anyway.
After that, I tried to change, in Model Operation settings, the value of "IsBackendCalculated" to true but, again, when I saved the value changed anyway.
After, I tried to set column property "kind" like "PersistentReadOnly" but when I tried to save I have this exception:
"An exception of type 'Telerik.OpenAccess.Exceptions.InvalidOperationException' occurred in Telerik.OpenAccess.Runtime.dll but was not handled in user code
Additional information: The update of field 'CentralScada.DAL.OpenAccess.DomainModels.Equipment._isMonitored' is not allowed."

Have you got some advices for me? I use the database first approach.

Thank you.

5 Answers, 1 is accepted

Sort by
0
Boris Georgiev
Telerik team
answered on 28 Jan 2015, 03:20 PM
Hello Stefano,

If you want to specify a column as ReadOnly you should only change the value of the "kind" property to persistent read-only. The "IsBackendCalculated" property is to specify if the column is Primary Key and it is Auto Incremental. 

Could you revert all the changes you apply on the property and only set the "kind" property value to true. This should fix the issue.

I hope that helps.

Regards,
Boris Georgiev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Stefano
Top achievements
Rank 1
answered on 28 Jan 2015, 03:51 PM
Hello Boris,
thanks for your reply but I've just tried this solution (revert all changes and set "kind" property to "PersistentReadOnly") and I have the error that I've copied in the first post.
Before, I forgot to write that I'm creating a web application(MVC) and the problem occurs when I try to attach the class.

Thanks again,
Stef.
0
Boyan
Telerik team
answered on 02 Feb 2015, 09:58 AM
Hi Stefano,

From the provided information it appears that in your controller method you attach an entity in order to update it. Unfortunately the issue that you are experiencing is caused by a known bug on our side that concerns attaching entities for update that have contain PersistentReadOnly properties.

For the time being, you could manually update entities which contain PersistentReadOnly properties. You could do that by getting the object that needs updating from the database by its primary key available in the DTO and then manually synchronize the properties of this entity.

If you need any further assistance, please let us know.

Regards,
Boyan
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
George
Top achievements
Rank 1
answered on 21 Mar 2016, 06:18 PM
Was this ever corrected in a Release for Data Access?
0
Doroteya
Telerik team
answered on 25 Mar 2016, 07:43 AM
Hi George,

Let me confirm that the latest release of Data Access - the Q1 2016 version, does not contain a fix for this issue. I'll make sure to update this thread ones the problem is resolved.

Thank you for your patience and understanding.

Regards,
Doroteya
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Design Time (Visual Designer & Tools)
Asked by
Stefano
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Stefano
Top achievements
Rank 1
Boyan
Telerik team
George
Top achievements
Rank 1
Doroteya
Telerik team
Share this question
or