You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sfab_ObjectDescriber.ParentRelationshipObjectCannotBeAutoCreatedException:
Cannot automatically create a Fabricated Object for the relationship EventRelation.Relation
as it is polymorphic and so not possible to automatically ascertain which SObject to use
If I remove the .set('Relation.Type','Account')
I get this runtime error
(System Code)
Class.sfab_FabricatedSObject.toSObject: line 291, column 1
System.JSONException: Cannot deserialize instance of <unknown> from null value null or request may be missing a required field
Thoughts
Now I don't actually know if you can round trip across polymorphic relationships but it would seem doable. sfab is told the polymorphic parentType in .setParent('Relation',new sfab_FabricatedSObject(Account.class) so the error message in
sfab_ObjectDescriber.ParentRelationshipObjectCannotBeAutoCreatedException:
Cannot automatically create a Fabricated Object for the relationship EventRelation.Relation
as it is polymorphic and so not possible to automatically ascertain which SObject to use
seems contradictory (i.e. ...automatially ascertain which SObject to use...)
For grins, I did a REST query on a real EventRelation and got this:
This will deserialize into an EventRelation with proper polymorphic lookup to Contact so I would imagine if you could build the above in memory and then serialize it/deserialize in the toSobject() method, it would work
The text was updated successfully, but these errors were encountered:
@bobalicious The Readme doc doesn't say that polymorphic parents aren't supported so of course, I gave it a try
Schema:
Event -> EventRelation
w/ polymorphic lookup viaEventRelation.Relation
field toAccount
,Contact
,Lead
,User
This example
generates exception:
If I remove the
.set('Relation.Type','Account')
I get this runtime error
Thoughts
Now I don't actually know if you can round trip across polymorphic relationships but it would seem doable. sfab is told the polymorphic parentType in
.setParent('Relation',new sfab_FabricatedSObject(Account.class)
so the error message inseems contradictory (i.e. ...automatially ascertain which SObject to use...)
For grins, I did a REST query on a real
EventRelation
and got this:This will deserialize into an
EventRelation
with proper polymorphic lookup toContact
so I would imagine if you could build the above in memory and then serialize it/deserialize in thetoSobject()
method, it would workThe text was updated successfully, but these errors were encountered: