Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

[Dynamics Webapi] - Create associations by value and not Guid's

(0) ShareShare
ReportReport
Posted on by 25

Hi all.

This is my first post, so I'm sorry if I'm not putting in the right place my question.

I'mm using dynamics API's in order to integrate data with external systems. I'm able to create accounts, bu I need to be able to set also some data for lookup values. However, I don't want to do the association via 

transactioncurrencyid@odata.bind":"/transactioncurrencies(f2f82c36-a77d-e911-a97b-000d3ae12152)"

My external systems knows iso currency codes, and that is the one that I want to use, to set account currency

"isocurrencycode""CAD",

{
	"accountnumber": "AcctCodeDemo",
	"name": "Account name - test",
	"new_masterclientid": "00000000-0000-0000-0000-000000000005",
    "parentaccountid@odata.bind": "/accounts(9081263d-96ea-e911-a812-000d3a797c95)", 
    "msdyn_externalaccountid": "100000001 - development machine (100000000)",
    
    -- works with this
    "transactioncurrencyid@odata.bind":"/transactioncurrencies(f2f82c36-a77d-e911-a97b-000d3ae12152)",
    
    --does not work with this
    "transactioncurrencyid":{ "isocurrencycode": "CAD" },
    
	
	"alssc_account_alssc_angleclientoffice_Account": [{
		"alssc_accountcode": "Office 1 code",
		"alssc_name": "Office 1 name ## "
	},
	{
		"alssc_accountcode": "Office 2 code",
		"alssc_name": "Office 2 name ##"
	}],
	
	"contact_customer_accounts": [
		{"firstname": "Cust one","lastname": "las name one"},
		{"firstname": "Cust two","lastname": "last name 2"}
	]
}

How can I do that ?

Thanks in advance for any help.

Manuel

  • Suggested answer
    mesteves Profile Picture
    mesteves 25 on at
    RE: [Dynamics Webapi] - Create associations by value and not Guid's

    Hi Andrew,

    Thanks for the tip! That was exactly what I was searching for. Despite some problems in the creation of indexes in the alternate keys, it still works. Some other issue and I investigate a bit and might be necessary to create a support request to MSFT.

    Thanks!

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: [Dynamics Webapi] - Create associations by value and not Guid's

    Hello,

    There are 2 ways you can use:

    1. You can retrieve id of currency first and then use that id in your queries.

    2. Activate alternate key for currency entity - docs.microsoft.com/.../define-alternate-keys-entity and use it afterwards - community.dynamics.com/.../using-alternate-keys-with-the-webapi

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans