You need to sign in to do that
Don't have an account?
Deepak Pansari
duplicate value found: <unknown> duplicates value on record with id: <unknown>
Hi All,
We are getting this error while inserting Case Manual share records through Apex manual sharing.
duplicate value found: <unknown> duplicates value on record with id: <unknown>
We are not able to identify and reproduce this error.
Can someone provide some inputs on cause of this error?
Thanks
Deepak
We are getting this error while inserting Case Manual share records through Apex manual sharing.
duplicate value found: <unknown> duplicates value on record with id: <unknown>
We are not able to identify and reproduce this error.
Can someone provide some inputs on cause of this error?
Thanks
Deepak
If you are updating/upserting, then the list you are updating contains more than one record with the same id.
Use a set first to create an unique set of ids and create a list of records based on that set. Update this newly created list.
Below are samle code where i tring to insert same share twice and not getting any error.
List<CaseShare> sharesToCreate = new List<CaseShare>();
for(integer i=0;i<2;i++)
{
CaseShare cs = new CaseShare();
cs.CaseAccessLevel = 'edit';
cs.CaseId = '500f0000005GEIy';
cs.UserOrGroupId = '00540000001DUnk';
sharesToCreate.add(cs);
}
insert sharesToCreate;
This solution resolved problem: just remove the History Tracking on the custom field and then deploy. Once the deployment is completed, history tacking can be enabled on the custom filed as part of post deployment step.
https://success.salesforce.com/issues_view?id=a1p30000000T5hTAAS
@yahor I have run into this too. Except turing off field history tracking in my target environment broke other parts of my deployment as field history is ON in my source. And if you turned off field history tracking in the target, then turned it back on again in the post deployment steps... won't you miss the field history selections that are included in your deployment metdata? How did you get around this?
For me, i found that I can manually create the lookup fields that have filters in the target environment (without the filter , just provide the lookup), then i can deploy from my source environment with filters, FLS, etc... just fine.
Why is this happening I wonder? -tjb
Just need to check duplicate entery in the CSV file or Package.xml