function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ndganindgani 

SyncedQuoteId is Read-Only in trigger

Hello All

 

my issue is this:

 

In a trigger, i need to retreive the synced quote of an opportunity.

In this trigger i have a query retreiving Opportunities.

When i add the field 'SyncedQuoteId' to the query (and nothing more - no changes to the field or anything)

i get the following exception:

 

Error:Apex trigger Opp1_AfterUpdate caused an unexpected exception, contact your administrator: Opp1_AfterUpdate: execution of AfterUpdate caused by: System.Exception: The opportunity SyncedQuote field is read only within a trigger.: Trigger.Opp1_AfterUpdate: line 58, column 10

 

why do i get this exception just for querying the field?

has someone encountered this and solved it?

 

thanks

NDgani

 

Mel1Mel1
Goto setup/administrative setup/security controls/field accessibility/select object/select SyncedQuote field to see if this column is allowed right permissions for the currently logged-in user's profile, to see if thats the problem.
ndganindgani

Hi Mel1

 

i checked what you suggested and field is marked as read-only and visible.

but that should not present a problem, because i'm only retreiving it in a query, nothing else.

 

NDgani

Mel1Mel1
For afterupdate trigger the value becomes readonly if attempt to update values. try changing to before update trigger.
KitagawaSan1337KitagawaSan1337

Running into this issue as well... anybody ever find a solution?