Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Set currency when creating Records via SDK

$
0
0

I have an Entity which has one or more Money-Fields. Therefore, it also has a transactioncurrencyid-field, which specifies the currency for the record.

Now, when i create a record of that entity in the browser, the transactioncurrencyid-field gets pre-populated with the default currency of the system or the user.

However, when creating a record of that entity via SDK without specifying a value for any of the Money-fields, the transactioncurrencyid-field stays empty. After that, no user is able to edit any Money-field because the currency is not set:

A currency is required if a value exists in a money field. Select a currency and try again.

Strangely, this doesn't happen when i set a value for a Money-field (even though I don't tell it what currency to use), e.g.:

var entity = new Entity("new_myentity")
{
    Attributes =
    {
        { "name" = "Name 1" },
        { "amount" = new Money(1000) }
    }
}

So my question is:
Is there a way to set the Currency of a record to the default value when creating it via SDK without any populated Money-Attributes?


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images