CalculateRollupField动态WebAPI

时间:2017-10-17 13:53:53

标签: javascript odata dynamics-crm microsoft-dynamics microsoft-dynamics-webapi

我正在尝试拨打来自CalculateRollupField来自https://crm.com/api/data/v8.0/CalculateRollupField(ccseq_contracts(FFA8E06D-30AD-E711-80E8-005056B33317), ccseq_totalamount) 来自t <- data.table(user1 = c(1,2), user3 = c(5,6), user2=c(3,4)) t$user4<- t$user3 t$user3<-NULL names(t)[names(t) == "user4"] <- "user3" t ## user1 user2 user3 ## 1: 1 3 5 ## 2: 2 4 6 。我似乎找不到很多实现的例子,我试图跟随documentation抛出错误:

  

请求URI无效。细分&#39; CalculateRollupField&#39;不能包含键谓词,但它可能以空括号

结尾

WebAPI呼叫

//userid, groupCache, shoutCache defined above

function arraysEqual(arr1, arr2) {
    if(arr1.length !== arr2.length)
        return false;
    for(i = arr1.length; i--;) {
        if(!arr2.indexOf(arr1[i]))
            return false;
        }

    return true;
}

setInterval(function() {
    $.getJSON("https://api.roblox.com/users/" + userid + "/groups").done(function (data) {
        console.log(data)
        for (i = 0; i < data.length; i++) {
            if (!arraysEqual(data, groupCache)) {
                groupCache.push(data[i].Id.toString())
            }
        }
        for (var v = 0; v < groupCache.length; v++) {
            $.get("https://web.roblox.com/My/Groups.aspx?gid=" + groupCache[v]).done(function (dataA) {
                var elems = $(dataA);
                var finda = $('#ctl00_cphRoblox_GroupStatusPane_StatusTextField', elems);
                shoutCache[groupCache[v]] = finda.text() // does not work
                console.log(groupCache[v] + " :GC")
                console.log(shoutCache)
            })
        }
    })
}, 10000);

我需要调整什么才能使此WebAPI调用起作用?

1 个答案:

答案 0 :(得分:0)

正确的网址在

之下
https://crm.com/api/data/v8.0/CalculateRollupField(Target=@tid,FieldName=@field)?@tid={'@odata.id':'ccseq_contracts(3047FD4D-CCC3-E711-80E9-005056B33317)'}&@field='ccseq_totalamount'