JohnM Posted April 17, 2022 Report Share Posted April 17, 2022 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? Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted April 18, 2022 Report Share Posted April 18, 2022 Hello @JohnM, Could you share the formula you are using and the data types of the fields involved? Maybe you added the field names not as parameters, but just the field names? For example Parameters: Field names: Quote Link to comment Share on other sites More sharing options...
0 JohnM Posted April 18, 2022 Author Report Share Posted April 18, 2022 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 Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted April 18, 2022 Report Share Posted April 18, 2022 @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 JohnM 1 Quote Link to comment Share on other sites More sharing options...
Question
JohnM
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
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
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.