Module: SfCli::Sf::Data::CreateRecord
- Defined in:
- lib/sf_cli/sf/data/create_record.rb
Instance Method Summary collapse
-
#create_record(object_type, values: {}, target_org: nil, api_version: nil) ⇒ String
create a object record.
Instance Method Details
#create_record(object_type, values: {}, target_org: nil, api_version: nil) ⇒ String
create a object record.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sf_cli/sf/data/create_record.rb', line 16 def create_record(object_type, values: {}, target_org: nil, api_version: nil) field_values = field_value_pairs(values) flags = { :"sobject" => object_type, :"values" => (field_values.nil? ? nil : %|"#{field_values}"|), :"target-org" => target_org, :"api-version" => api_version, } action = __method__.to_s.tr('_', ' ') json = exec(action, flags: flags, redirection: :null_stderr) json['result']['id'] end |