Module: SfCli::Sf::Data::UpdateRecord
- Defined in:
- lib/sf_cli/sf/data/update_record.rb
Instance Method Summary collapse
-
#update_record(object_type, record_id: nil, where: nil, values: nil, target_org: nil, api_version: nil) ⇒ String
Update a object record.
Instance Method Details
#update_record(object_type, record_id: nil, where: nil, values: nil, target_org: nil, api_version: nil) ⇒ String
Update a object record.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sf_cli/sf/data/update_record.rb', line 20 def update_record(object_type, record_id: nil, where: nil, values: nil, target_org: nil, api_version: nil) where_conditions = field_value_pairs(where) field_values = field_value_pairs(values) flags = { :"sobject" => object_type, :"record-id" => record_id, :"where" => (where_conditions.nil? ? nil : %|"#{where_conditions}"|), :"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 |