You need to sign in to do that
Don't have an account?
davidesi
We have a class that yesterday was working ok, but today when we try to add a user to a campaign,
we get this error:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger CampaignUsersAfterInsert caused an unexpected exception, contact your administrator: CampaignUsersAfterInsert: execution of AfterInsert caused by: line 2, column 44: trigger body is invalid and failed recompilation: Dependent class is invalid and needs recompilation: Ap02Campaign: line 18, column 14: Field is not writeable: CampaignShare.CampaignAccessLevel
When you access to this class (Ap02Campaign) , now it is uncompiled, and if you try to save it you get the following error:
Field is not writeable: CampaignShare.CampaignAccessLevel
The fact is that the same class is saved and working in thifferent environments (Cert, Pre, production ...)
Anybody knows why of the error?
A class has been 'magically' uncompiled
We have a class that yesterday was working ok, but today when we try to add a user to a campaign,
we get this error:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger CampaignUsersAfterInsert caused an unexpected exception, contact your administrator: CampaignUsersAfterInsert: execution of AfterInsert caused by: line 2, column 44: trigger body is invalid and failed recompilation: Dependent class is invalid and needs recompilation: Ap02Campaign: line 18, column 14: Field is not writeable: CampaignShare.CampaignAccessLevel
When you access to this class (Ap02Campaign) , now it is uncompiled, and if you try to save it you get the following error:
Field is not writeable: CampaignShare.CampaignAccessLevel
The fact is that the same class is saved and working in thifferent environments (Cert, Pre, production ...)
Anybody knows why of the error?
Can you share code here? it will be easy for us to assist you
We have found that the error is due to the sharing settings of CampaingShare .
Following the link you have written I can see that campaignshare.CampaignId is not updatable, but I'm not updating but creating from zero.
The code is the following: