Rahul Lakhanpal Rahul Lakhanpal - 2 months ago 7
Python Question

How to create an sObject for a sType without using get_unique_sobject method?

I wish to create a new sobject for a specific stype.
Currently I am using

server.get_unique_sobject( stype, data)
, But it assumes that an sobject is already present i.e it creates a new sobject iff there is no combination of sobject with same data already existing in the DB.

I wish to create a new sobject each and every time I wish , even if there is a sobject already present with the same name and data present.

Answer

Found it, the API itself provides a method of inserting a sObject to any sType in the system. It was by using server.insert( sType, data = {}) where data is a dictionary of key value pairs.