Crm Update productsubstitutes gets 502 error within logic app - dynamics-crm

I am trying to update existing productsubstitutes entities in Dynamics CRM Online within a Logic App.
I make lookups on the products that should be linked and than use the connector to send the following data:
{
"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
}
This results in the strange error message:
"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"
}
}
}
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.
This problem is reproducible, and as it looks its only happening on particular products.
Edit:
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.
Edit2:
I have a MS ticket open they are aware of the issue.. and will come back on it on the 23.08 days.

Related

Unable to Launch Alexa Hosted Skill which was created using Fact Skill template

Unable to Launch Alexa Hosted Skill which was created using Fact Skill template. This is a custom skill written in Python. I haven't changed any code except the class name of Launch Request handler.
class GetNewQuestionHandler(AbstractRequestHandler)
Above mentioned class is supposed to handle the Launch request, however request doesn't hit this code as I don't see any log printed from this class. CatchAllExceptionHandler also doesn't print any log.
Intent handlers and exception handlers are registered like this:
sb.add_request_handler(GetNewQuestionHandler())
sb.add_exception_handler(CatchAllExceptionHandler())
Here is the response json -
{
"header": {
"namespace": "SkillDebugger",
"name": "CaptureError",
"messageId": ""
},
"payload": {
"code": "SKILL_ENDPOINT_ERROR",
"description": "Skill execution returned an exception for requestId abcd",
"debuggingInfo": {
"type": "SkillExecutionInfo",
"content": {
"invocationRequest": {
"body": {
"version": "1.0",
"session": {
},
"context": {},
"request": {
"type": "SessionEndedRequest",
"reason": "ERROR",
"error": {
"type": "INTERNAL_SERVICE_ERROR",
"message": "Can't find skill bundle metadata for skillId abc locale xyz stage development"
}
}
}
}
}
}
}
}
Please let me know what is the issue with this skill.
Note: Please let me know in case any other info is required.

Microsoft Graph API UnableToDeserializePostBody 400 error

I'm trying to create recurring events under my outlook calendar and for that, I'm following instructions from here.
My payload looks like this:
{
"Subject": "Blocked By DEV",
"Body": {},
"Start": {
"DateTime": "2022-08-30T23:30:00",
"TimeZone": "Asia/Calcutta"
},
"End": {
"DateTime": "2022-08-30T23:45:00",
"TimeZone": "Asia/Calcutta"
},
"Recurrence": {
"pattern": {
"type": "WEEKLY",
"interval": 1,
"daysOfWeek": [
"Monday",
"Tuesday"
]
},
"range": {
"type": "numbered",
"startDate": "2022-08-30",
"numberOfOccurences": 3
}
}
}
I'm trying to hit the endpoint /me/events from Graph Explorer and getting this 400 error.
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize "
}
}
Is there anything wrong with my payload? Is there any way to have more details about the failure?
Just spotted the culprit, numberOfOccurences was supposed to be numberOfOccurrences.
And if someone asks why I ended up doing that mistake, I just referred docs, and seems like official documentation has that typo.

Send Conversation History API returning HTTP 400 BotFramework

I'm trying to sendConversation History API provided by Microsoft in BotFramework Documentation. It takes Transcript object (array of activities) as the input. But I've getting HTTP 400 Bad Request when using trying that.
I'm making a POST request on this and authenticating it using JWT Token generated by client credentials for the bot.
https://directline.botframework.com/v3/conversations/HBoZPkTiBYOAadigqEqFaJ-us/activities/history
This is the error I get.
{
"error": {
"code": "BadSyntax",
"message": "Invalid or missing activities"
}
}
This is the activity array payload that I'm using
[
{
"type": "message",
"id": "HBoZPkTiBYOAadigqEqFaJ-us|0000003",
"timestamp": "2022-09-05T08:10:00.3574378Z",
"localTimestamp": "2022-09-05T13:39:57.633+05:30",
"localTimezone": "Asia/Calcutta",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "dl_uID1",
"name": "userName"
},
"conversation": {
"id": "HBoZPkTiBYOAadigqEqFaJ-us"
},
"recipient": {
"id": "bot-name-dev#abcd",
"name": "bot-name-dev"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "hi",
"channelData": {
"clientActivityID": "1662365337633rmq6e8mbm09",
"clientTimestamp": "2022-09-05T08:09:57.633Z"
}
}
]
I'm not able to figure out what's the correct format of activity object that it is expecting.
Create the bot and get it connected to the Direct Line. Get the secret keys of the site that need to connect.
Before calling SendConversationHistory if the message is delivered to the recipient, it will create the bad request error message as it is unable to get the conversation history as the message was already received. SendConversationHistory must be called before sending the message then the Conversation History will be tracked. The below screens will be helpful to create the DirectLine connection to the bot created. Then needed to add the trusted sites to DirectLine. Then proceed with the code sample mentioned below which takes the conversation history.
Click on Create a resource
Search for bot and click on create
Select Channels
Get the App Service Extension Keys and click on Default_site
Click on the toggle and enable the enhanced authentication options and add the website which we need to communicate.
In the code block of the current working application, to get the conversation history, use the following code block.
foreach (var a in activities)
{
incrementId++;
// Use your own ID format
a.Id = string.Concat("history|", incrementId.ToString().PadLeft(7, '0'));
a.ChannelData = null;
a.Conversation = new ConversationAccount(id: convId);
if (a.From.Name == message.Recipient.Name)
{
// Bot to recipient connection
a.Recipient = message.From;
a.From = message.Recipient;
}
else
{
// User to bot connection (here bot will be the recipient)
a.Recipient = message.Recipient;
a.From = message.From;
}
}
After connecting with Microsoft, I found this is the correct payload for this API.
{
"activities": [
{
"type": "message",
"id": "whatever-conversation-id-in|0000000",
"timestamp": "2022-11-20T20:14:26.242902Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "dl_test_id",
"name": ""
},
"conversation": {
"id": "whatever-conversation-id-in"
},
"recipient": {
"id": "ABC_bot",
"name": "ABC_bot"
},
"text": "Hello Bot"
}
]
}

LogicApp CRM connector create record gives a 500 error

I've build a fairly simple LogicApp with the most recent version that came out about a week ago. It runs every hour and tries to create a record in CRM online. In the same manner I've created a LogicApp that retrieves records and that works.
The failed input and output looks like this:
{
"host": {
"api": {
"runtimeUrl": "https://logic-apis-westeurope.azure-apim.net/apim/dynamicscrmonline"
},
"connection": {
"name": "subscriptions/6e779c81-1d0c-4df9-92b8-b287ba919b51/resourceGroups/spdev-eiramar/providers/Microsoft.Web/connections/EE2AF043-71F0-4780-A8D1-25438A7746C0"
}
},
"method": "post",
"path": "/datasets/xxxx.crm4/tables/accounts/items",
"body": {
"name": "Test 1234"
}
}
Output:
{
"statusCode": 500,
"headers": {
"pragma": "no-cache",
"x-ms-request-id": "d121f98c-3dd5-4e6d-899b-5150b17795a3",
"cache-Control": "no-cache",
"date": "Tue, 01 Mar 2016 12:27:09 GMT",
"set-Cookie": "ARRAffinity=xxxxx082f2bca2639f8a68e283db0eba612ddd71036cf5a5cf2597f99;Path=/;Domain=127.0.0.1",
"server": "Microsoft-HTTPAPI/2.0",
"x-AspNet-Version": "4.0.30319",
"x-Powered-By": "ASP.NET"
},
"body": {
"status": 500,
"message": "Unknown error.",
"source": "127.0.0.1"
}
}
Does anybody know how to solve this issue?
Do you have security roles setup to access the CRM Org, i.e. can you access the URL from browser? https://xxxx.crm4.dynamics.com
Update: Fix for this issue has been rolled out. Please retry your scenario.

Mailchimp API v3 add merge field with checkboxes

I need to add checkboxes merge-field with choices to a list.
API key is valid, other requests work and I'm doing such request:
POST https://us12.api.mailchimp.com/3.0/lists/424242/merge-fields
Body: {"name": "provider_accounts", "type": "checkboxes", "options": { "choices": ["BMW", "Audi", "Toyota"]}, "tag": "provider_accounts"}
And I got an error for some reason!
{
"type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title": "Invalid Resource",
"status": 400,
"detail": "The resource submitted could not be validated. For field-specific details, see the 'errors' array.",
"instance": "",
"errors": [
{},
{}
]
}
BTW if I change the type to radio request works and new merge-field is created.

Resources