You need to sign in to do that
Don't have an account?
Setting parent asset on child asset via Apex
Is it possible to set the parent id on an asset other than using the constructor method? I need to set the parent id for an asset in a trigger method. This code does not work:
a.parentId = parentAsset.id;
Results in: Save error: Invalid field parentId for SObject Asset
My user does have access to the object and the parent field. I can set the parent id using the constructor method:
Asset a = new Asset(name='test component with parent',
hin__c = 'CRC10890L516',
recordtype =bc,
dealer_key__c = '43536.001',
dealer_brand_key__c = '43536.001CL',
parentId = '02i54000000hS4aAAE')
Unfortunately that will not work for my use case.
Ideas?
All Answers