Readonly triggered field configuration

6 posts, 0 answers
  1. Stefano
    Stefano avatar
    2 posts
    Member since:
    Jan 2015

    Posted 26 Jan 2015 Link to this post

    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.

  2. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 28 Jan 2015 Link to this post

    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.
     
  3. DevCraft banner
  4. Stefano
    Stefano avatar
    2 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 in reply to Boris Georgiev Link to this post

    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.
  5. Boyan
    Admin
    Boyan avatar
    100 posts

    Posted 02 Feb 2015 Link to this post

    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.
     
  6. George
    George avatar
    1 posts
    Member since:
    Jan 2014

    Posted 21 Mar in reply to Boyan Link to this post

    Was this ever corrected in a Release for Data Access?
  7. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 25 Mar Link to this post

    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.
Back to Top
DevCraft banner