Hi Guys,
I have an Odata entity on which I have exposed a method. I want this method to take more than a single input and in particular, I want to be able to pass a collection/list of records as one of the inputs. Eventually I want to pass VendInvoiceInfoTable as one input and another input as a list of records of VendInvoiceInfoLine table. The output from this method will just be a string.
But before doing that I wanted to get the below code to work. It takes just one input ; list of Records of resource Fiscal Calendar. My understanding is that, 'Record' can refer to a resource that can be any table or data entity. I assume this also helps in parsing the incoming json into the respective object without the need of a contract class as in the case of a custom json not adhering to any table or entity structure.
I was successful in getting 'Types::String' to work but when I can make the Type a 'Record' with a resource name it fails regardless of the resource name and the respective input in postman.
[
SysOdataAction("Hello",false),
SysODataCollectionAttribute('name', Types::Record, "FiscalCalendar")
]
Public Static str Hello(List name)
{
return "good";
}
PostMan Request: Passing just 1 record with the field names of the 'FiscalCalendar' table which are 'CalendarId' and 'Description' . Both are of String types
{
"name": [
{
"CalendarId": "test",
"Description": "test"
}
]
}
Response:
{
"Message": "No HTTP resource was found that matches the request URI 'usnconeboxax1aos.cloud.onebox.dynamics.com/.../Microsoft.Dynamics.DataEntities.Hello'. No route data was found for this request."
}
I have already looked at these 2 forum discussions but unable to get it to work for me.
https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/371263/sysodataactionattribute-execute-action-with-comma-seperated-values-or-list-parameters-are-not-working
https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/305005/sending-a-json-list-to-custom-service