locked
Cannot make a SQL View's field REQUIRED on Server or HTML Client RRS feed

  • Question

  • The "Required" property is disabled in both the Entity Editor (Server view) and the HTMLClient view.

    Although there is an ID field that is correctly recognized as the PK, the "Business Key" is one of the View's other columns.

    How does one get around this limitation, please?  I'd like this "Property" to be global, not "by screen", if possible.

    Thanks.

    Friday, June 6, 2014 11:41 PM

Answers

  • A basic Data Modeling technique that LS/EF forces upon us as a requirement for an ID column in EVERY table, and, as it happens, View, isn't "normal" in all Database Design.

    The ID is actually a Surrogate Key, with the "Business Identifier" being something else.  In my case, the "Location" is actually the subject of the Issue, and is, therefore, my Business Identifier.  Also, one of the rules of Data Modeling is that the Business Identifier be inviolate - if it is not, then use a Surrogate Key.  My "Location" is inviolate, it is the REQUIRED Business Identifier, thus I should, under normal Data Model to Physical Model transformation principles, be able to designate it NOT NULL in the database and therefore "Required" in LS/EF is automatic.

    However, View definition without a tweak of an outermost ISNULL() for the Location column, means that EF and ORM's assume NULLable for every column.

    I believe that having found this workaround Make a View filed REQUIRED, my problem may be solved.

    Hope this helps.

    UPDATE: The ISNULL() technique works PERFECTLY - I now have my "Required" checkmark after a Datasource Refresh.


    • Edited by SAinCA Monday, June 16, 2014 7:04 PM
    • Marked as answer by SAinCA Monday, June 16, 2014 7:04 PM
    Monday, June 16, 2014 6:57 PM

All replies

  •  I'd like this "Property" to be global, not "by screen", if possible.

    Why do you want to do this?
    Monday, June 16, 2014 6:43 AM
  • A basic Data Modeling technique that LS/EF forces upon us as a requirement for an ID column in EVERY table, and, as it happens, View, isn't "normal" in all Database Design.

    The ID is actually a Surrogate Key, with the "Business Identifier" being something else.  In my case, the "Location" is actually the subject of the Issue, and is, therefore, my Business Identifier.  Also, one of the rules of Data Modeling is that the Business Identifier be inviolate - if it is not, then use a Surrogate Key.  My "Location" is inviolate, it is the REQUIRED Business Identifier, thus I should, under normal Data Model to Physical Model transformation principles, be able to designate it NOT NULL in the database and therefore "Required" in LS/EF is automatic.

    However, View definition without a tweak of an outermost ISNULL() for the Location column, means that EF and ORM's assume NULLable for every column.

    I believe that having found this workaround Make a View filed REQUIRED, my problem may be solved.

    Hope this helps.

    UPDATE: The ISNULL() technique works PERFECTLY - I now have my "Required" checkmark after a Datasource Refresh.


    • Edited by SAinCA Monday, June 16, 2014 7:04 PM
    • Marked as answer by SAinCA Monday, June 16, 2014 7:04 PM
    Monday, June 16, 2014 6:57 PM