0

We have a vb.net app that use the salesforce soap API. The Enterprise wsdl file originally compiled was dating from 2019, so i updated it to the latest version (API Version 50.0). After Updating the file, i noticed that it broke some code reference when trying to get the Owner.FirstName or Owner.LastName (from the 'Task' object). The error says that 'FirstName' and 'LastName' are not a member of 'sObject'.

By comparing both wsdl files, i can see that 'Owner' was defined as type 'Name' in the old one, but now it is defined as 'sObject' in the new one.

How would you handle this?

old wsdl url: https://login.salesforce.com/services/Soap/c/44.0/0DF4A000000AU1p

New wsdl url: https://login.salesforce.com/services/Soap/c/50.0/0DF4w000000AUCn

i saw this post talking about this but no real solutions: Enterprise WSDL maps objects to different types in different organizations

I hope someone can guide me in to the right direction

2
  • 1
    The Owner relationship is now polymorphic because Tasks can be assigned to Queues as well as to Users. You cannot directly traverse a polymorphic relationship because the target may have multiple types, but I don't know enough about .NET/SOAP API to recommend a workaround.
    – David Reed
    Commented Jan 19, 2021 at 20:28
  • Thanks David, That explain what i see in the new enterprise wsdl file. As far as code change needed, i found my answer.
    – MartinT
    Commented Jan 25, 2021 at 12:23

1 Answer 1

0

I finally found my answer. since the object type as changed , i must change my code by casting type sObj to Name:

ctype(owner,Name).FirstName

thanks to all for your help

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .