Class: DynamicsCRM::Metadata::AttributeMetadata

Inherits:
XmlDocument
  • Object
show all
Defined in:
lib/dynamics_crm/metadata/attribute_metadata.rb

Overview

AttributeMetadata ManagedPropertyAttributeMetadata IntegerAttributeMetadata BooleanAttributeMetadata DateTimeAttributeMetadata DecimalAttributeMetadata DoubleAttributeMetadata EntityNameAttributeMetadata MoneyAttributeMetadata StringAttributeMetadata LookupAttributeMetadata MemoAttributeMetadata BigIntAttributeMetadata PicklistAttributeMetadata StateAttributeMetadata StatusAttributeMetadata

msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.attributemetadata.aspx

Instance Attribute Summary

Attributes inherited from XmlDocument

#document

Instance Method Summary collapse

Methods inherited from XmlDocument

#initialize, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from DynamicsCRM::Metadata::XmlDocument

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DynamicsCRM::Metadata::XmlDocument

Instance Method Details

#picklist_optionsObject

Only applicable to PicklistAttributeMetadata



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 25

def picklist_options
  return @picklist_options if @picklist_options

  @picklist_options = {}
   = "./d:OptionSet/d:Options/d:OptionMetadata"
  @document.get_elements().each do |option|
    numeric_value = option.elements["d:Value"].text
    label = option.elements["d:Label/b:UserLocalizedLabel/b:Label"].text
    @picklist_options[numeric_value.to_i] = label
  end

  @picklist_options
end