Class: LockstepSdk::CustomFieldSyncModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/custom_field_sync_model.rb

Overview

The CustomFieldSyncModel represents information coming into Lockstep from an external financial system or other enterprise resource planning system. [Custom Fields](developer.lockstep.io/docs/custom-fields#custom-fields) represent custom data extensions that you can use with the Lockstep Platform. If you need to store extra information about an object that does not match Lockstep’s official schema, you can store it in the Custom Field system using CustomFieldSyncModel.

To store a custom field for an object, create a CustomFieldSyncModel record containing the ‘TableKey` and `ErpKey` of the entity to which you will attach a custom field. Next specify the field’s ‘CustomFieldLabel` and either a `StringValue` or `NumericValue`.

Once imported, this record will be available in the Lockstep API as a [CustomFieldValueModel](developer.lockstep.io/docs/customfieldvaluemodel).

For more information on writing your own connector, see [Connector Data](developer.lockstep.io/docs/connector-data).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CustomFieldSyncModel

Initialize the CustomFieldSyncModel using the provided prototype



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 37

def initialize(params = {})
    @on_match_action = params.dig(:on_match_action)
    @erp_key = params.dig(:erp_key)
    @table_key = params.dig(:table_key)
    @custom_field_label = params.dig(:custom_field_label)
    @string_value = params.dig(:string_value)
    @numeric_value = params.dig(:numeric_value)
    @value = params.dig(:value)
    @created = params.dig(:created)
    @modified = params.dig(:modified)
end

Instance Attribute Details

#createdDate-time



79
80
81
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 79

def created
  @created
end

#custom_field_labelString



63
64
65
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 63

def custom_field_label
  @custom_field_label
end

#erp_keyString



55
56
57
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 55

def erp_key
  @erp_key
end

#modifiedDate-time



83
84
85
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 83

def modified
  @modified
end

#numeric_valueDouble



71
72
73
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 71

def numeric_value
  @numeric_value
end

#on_match_actionMatchAction



51
52
53
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 51

def on_match_action
  @on_match_action
end

#string_valueString



67
68
69
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 67

def string_value
  @string_value
end

#table_keyString



59
60
61
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 59

def table_key
  @table_key
end

#valueString



75
76
77
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 75

def value
  @value
end

Instance Method Details

#as_json(options = {}) ⇒ object



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 87

def as_json(options={})
    {
        'onMatchAction' => @on_match_action,
        'erpKey' => @erp_key,
        'tableKey' => @table_key,
        'customFieldLabel' => @custom_field_label,
        'stringValue' => @string_value,
        'numericValue' => @numeric_value,
        'value' => @value,
        'created' => @created,
        'modified' => @modified,
    }
end

#to_json(*options) ⇒ String



103
104
105
# File 'lib/lockstep_sdk/models/custom_field_sync_model.rb', line 103

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end