Jump to content
  • 0

“Incompatible data in one or more fields. Values cannot be changed due to a data restriction.”


JohnM
 Share

Question

A field in a table is calculated. The formula is fine. In Datasheet view, I can make changes to fields and see the calculated one change as it should.

A tabular DataPage that allows inline editing and that displays various fields from this table works fine . . .

. . . unless I include the calculated field in the results table.

The calculated values appear in the table as expected, but when inline-editing any field in a record, I get this error message

  • “Incompatible data in one or more fields. Values cannot be changed due to a data restriction.”

after clicking UPDATE for the record.

What?!

Why would just displaying a field in a result set create a problem?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

The formula calculates an ISO 8601 date from year, month, and day fields. I have tried other formulas, some very simple. The results are inconsistent. At times the problem seems to go away but then it reappears. I don’t think this is exactly the problem, but it feels like a race condition, where the calculation has not finished before the results are needed.

CASE 
     WHEN [@field:Year] <> '' THEN CAST([@field:Year] AS VARCHAR(4)) 
     WHEN [@field:Month] <> '' OR [@field:Day_of_Month] <> '' THEN '-' 
     ELSE ''
END

+

CASE 
    WHEN [@field:Month] <> '' 
        THEN '-' + RIGHT ('00' + CAST([@field:Month] AS VARCHAR(2)),2)
    WHEN [@field:Day_of_Month] <> '' 
        THEN '-'
    ELSE ''
END

+

CASE 
     WHEN [@field:Day_of_Month] <> '' 
           THEN '-' + RIGHT ('00' + CAST([@field:Day_of_Month] AS VARCHAR(2)),2)
     ELSE ''
END

 

Link to comment
Share on other sites

  • 0

@JohnM,

As I understand, these 3 fields have Integer data type: Day_of_Month, Month, Year.

I can reproduce this issue in my account. 

I was able to fix this error when I use 'IS NOT NULL' instead of <> ''

CASE 
     WHEN [@field:Year] IS NOT NULL THEN CAST([@field:Year] AS VARCHAR(4)) 
     WHEN [@field:Month] IS NOT NULL OR [@field:Day_of_Month] IS NOT NULL THEN '-' 
     ELSE ''
END

+

CASE 
    WHEN [@field:Month] IS NOT NULL 
        THEN '-' + RIGHT ('00' + CAST([@field:Month] AS VARCHAR(2)),2)
    WHEN [@field:Day_of_Month] IS NOT NULL
        THEN '-'
    ELSE ''
END

+

CASE 
     WHEN [@field:Day_of_Month] IS NOT NULL
           THEN '-' + RIGHT ('00' + CAST([@field:Day_of_Month] AS VARCHAR(2)),2)
     ELSE ''
END

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...