Inhalte aufrufen

Profilbild

WebApi: Assiging customerrole results in empty CustomerRole collection


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
Keine Antworten zum Thema vorhanden

#1 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 06 May 2020 - 13:38

If i assign a customer role like this: $"{serverBaseUrlOData}Customers({CustomerID})/CustomerRoles({CustomerRoleID})" then it seems that the Customer.CustomerRolles collection becomes nothing/ returns no collection items. If i create a new users and assign it a CustomerRole via de backend of the website than the Customer.CustomerRolles collection does returns collection items.
 
I get the Customers with this URL:

$top=99999&$expand=Orders,BillingAddress,BillingAddress/Country,ShippingAddress,CustomerRoles,Addresses

For example:
 

POST https://shop.com/odata/v1/Customers(1232)/CustomerRoles(7)

Response

{
  "odata.metadata":"https://shop.com/odata/v1/$metadata#CustomerRoles/@Element","Name":"PayOnInvoice","FreeShipping":false,"TaxExempt":false,"TaxDisplayType":null,"Active":true,"IsSystemRole":false,"SystemName":null,"Id":7
}