Quantcast
Channel: Jason Lattimer's Groups Activities
Viewing all articles
Browse latest Browse all 869

Filter OData Query on expanded Entity Entity Reference field

$
0
0

Hi, i have this code snippet using the provided SDK.REST.js file for a web resource to query a collection of custom related entities and sum up their totals.

function SetTotal() {
    var yearFilteredExpenses = "$select=custom_Amount&$expand=custom_custom_month_custom_expense_Month" +
                                              "&$filter=custom_ProjectExpenseId/Id eq " + FormatGuid(projectID) +
                                              "and custom_custom_month_custom_expense_Month/custom_yearmonthId/Id eq " + FormatGuid(yearID);
    SDK.REST.retrieveMultipleRecords("custom_expense",
                                     yearFilteredExpenses,
                                     ProcessExpenses,
                                     function (err) { alert("Getting Filtered Expenses by Year:" + err) },
                                     CompleteExpenses);
}
function FormatGuid(id) {
    return "(guid'" + id.replace(/[{()}]/g, '') + "')";
}


The Alert is triggered saying :

"Getting Filtered Expenses by Year:Error: Error : 500: Internal Server Error: attributeName"

I've confirmed the names of the entities and attributes as they do give different errors, and the processing and complete functions are used by other queries that work fine. The only difference in this query is the related Entity reference field filter.

Am I missing something?


Viewing all articles
Browse latest Browse all 869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>