2

I have components written during Winter'18. After the rollout of Spring'18 preview they stopped working. The components fetch fields (either via layoutType=FULL or mentioned by name) that happen to be formula/rollup fields and when the save operation is called an error is returned.

INVALID_FIELD_FOR_INSERT_UPDATE","message":"Unable to create/update fields: X__c, Y__c, Z__c. Please check the security settings of this field and verify that it is read/write for your profile or permission set."

  • Kindly post your component code as well. Secondly, have you checked the field-level security of the aforementioned fields? – Mahmood Jan 8 '18 at 14:14
  • 2
    Do you mean your unchanged code is producing this error? Or have you changed the code to do the saving through Lightning Data Service? – Keith C Jan 8 '18 at 14:23
  • This exact same thing has happened to me as well. – George Albrecht Jan 8 '18 at 18:09
  • The code is still in sandboxes but it was working like charm till the rollout. No changes were made by the devs. The fields that error are only the calculated fields that by definition aren't writable. – user682217 Jan 9 '18 at 9:37
  • I just started noticing this issue as well. So frustrating! – Charles Naccio Jan 10 '18 at 15:16
2

I found a workaround. I wired a separate force:recordData markup and only included the formula fields there. Then in my original force:recordData, I excluded the formula fields.

You can then adjust references on the component accordingly.

| improve this answer | |
  • Good to know someone else can reproduce it. Hopefully we will get a patch before promotion to production. Thanks – user682217 Jan 9 '18 at 9:39
1

Just realized that changing my layoutType to COMPACT resolved my issue. See below.

<force:recordData aura:id="contractLineData"
                    layoutType="COMPACT"
                    mode="EDIT"
                    targetRecord="{!v.contractLine}"
                    targetFields="{!v.contractLineFields}"
                    targetError="{!v.errorMessage}" />
| improve this answer | |
0

I had the same problem show up with Spring 18, but SystemModstamp was being pulled in for every save after the first save, so the first save worked but not any save after that. Instead of creating a separate force:recordData I created a list of the Id and the updateable fields. I create a copy of the record and delete the fields that are not in that list from the copy, and return that for the save.

Also, I usually only use targetFields, but I also had to pull in targetRecord.fields and repeat this process on the object holding those fields too. Hope I can remove this before going to production.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.