• David Hickman
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

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?
 

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?