You need to sign in to do that
Don't have an account?
C# - Update 'OwnerID' on unknown object type
Hey everyone,
I have a utility that I use to update the 'OwnerId' field on the Lead Object, but I want to make it flexible enough to handle all sorts of salesforce objects.
How can I repalce the "sf.Lead" in the foreach statement to match the object type of the "sfobjects" array?
sf.sObject[] sfobjects = binding.retrieve("ID, OwnerId", objecttype, objectids); foreach (sf.Lead sfobject in sfobjects) //need to change this to any object type { sfobject.OwnerId = "005000000071z0V"; binding.update(new sObject[] { sfobject }); }
Thanks,
Isaac