title: Crm Update productsubstitutes gets 502 error within logic app
body: <p>I am trying to update existing <code>productsubstitutes</code> entities in Dynamics CRM Online within a Logic App.</p>
  
  <p>I make lookups on the products that should be linked and than use the connector to send the following data:</p>
  
  <pre><code>{
  "host": {
      "connection": {
          "name": "/subscriptions/XXXX/resourceGroups/XXX/providers/Microsoft.Web/connections/dynamics_crm_dev"
      }
  },
  "method": "patch",
  "path": "/datasets/XXX.crm4/tables/productsubstitutes/items/ITEMID",
  "retryPolicy": {
      "type": "None"
  },
  "body": {
      "ItemInternalId": "ITEMID",
      "_productid_value": "1f2017c1-b9e8-40db-9e15-c890b127e7b2",
      "_salesrelationshiptype_label": "Interchangeable",
      "_substitutedproductid_value": "4e1d1dd7-b9e8-40db-9e15-c890b127e7b2",
      "direction": 0,
      "productsubstituteid": "839229d1-b9e8-40db-9e15-c890b127e7b2",
      "interchangability": 928350000,
      "type": 928350000
  }
  </code></pre>
  
  <p>This results in the strange error message:</p>
  
  <pre><code>"statusCode": 502,
  "headers": {
      XXX
  },
  "body": {
      "error": {
          "code": 502,
          "source": "logic-apis-westeurope.azure-apim.net",
          "clientRequestId": "XXXX-XXX-4b5c-a4d5-XXXX",
          "message": "BadGateway",
          "innerError": {
              "status": 502,
              "message": "The other row for the product relationship is not available.",
              "source": "XXXX.crm4.dynamics.com",
              "errors": [],
              "debugInfo": "XXXX-XXX-4b5c-a4d5-XXXX"
          }
      }
  }
  </code></pre>
  
  <p>Both product IDs: 4e1d1dd7-b9e8-40db-9e15-c890b127e7b2 and 1f2017c1-b9e8-40db-9e15-c890b127e7b2 are correct and where obtained via lookups before the update requests.</p>
  
  <p>This problem is reproducible, and as it looks its only happening on particular products.</p>
  
  <p>Edit:</p>
  
  <p>I rebuilt the update within a small C# component with the XRM SDK and I am getting the same error.
  So its definitely crm related.</p>
  
  <p>Edit2:
  I have a MS ticket open they are aware of the issue.. and will come back on it on the 23.08 days. </p>