Create a money attribute

// ** Create a money attribute **

MoneyAttributeMetadata moneyAttribute = new MoneyAttributeMetadata

{

    // Set base properties

    SchemaName = "new_money",

    DisplayName = new Label("Money Picklist", 1033),

    RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),

    Description = new Label("Money Attribue", 1033),

    // Set extended properties

    MaxValue = 1000.00,

    MinValue = 0.00,

    Precision = 1,

    PrecisionSource = 1,

    ImeMode = ImeMode.Disabled

};

 

 

 

// Create the request.

CreateAttributeRequest createAttributeRequest = new CreateAttributeRequest

{

    EntityName = "EntityLogicalName",

    Attribute = moneyAttribute

};

 

// Execute the request. Get Response

CreateAttributeResponse resp = (CreateAttributeResponse)_service.Execute(createAttributeRequest);