i can't generate primary entity in crmrestbuilder please find below screenshot .if anyone know please help me
*This post is locked for comments
i can't generate primary entity in crmrestbuilder please find below screenshot .if anyone know please help me
*This post is locked for comments
Hi,
You have to pass the Guid of parent record.
Thanks,
hi Aric Levin
I cant get the id when Create Request button please find below screenshot
In addition to that you can also refer: missdynamicscrm.blogspot.com.au/.../tips-and-trick-odata-crm-2011-2013.html
How to use it.
Hi Sabih,
I don't have CRM 2013 or your solution installed, but I will try to walk you through it.
When you go to Settings -> Solutions, you should now see on the Command Bar a button for REST Builder.
Click on the button, and that will open CRM Rest Builder in a new window/tab.
- In the Action, select Retrieve Multiple.
- In the Primary Entity, select the entity of the subgrid on which you want to calculate the items.
- In the Fields to select, select the fields that you want to return from your query. This will have to include the amount fields for which you want to calculate the totals.
- In the Filter, add the attribute of the parent record id. For example, if you were on the Invoice record and had a subgrid of Invoice Details, the attribute would be Invoice Id, operator would be Equal and Value would be the Guid of the Invoice. You will need to follow the same logic on your entity and subgrid.
After you have set all the options, click on the Create Request button. You will see the code in the window, and you can copy the code in your browser. From the sample I just gave you, this is the results output:
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/InvoiceDetailSet?$filter=InvoiceId/Id eq (guid'12345678-9ABC-DEF0-1234-567890ABCDEF')", true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function() {
if (this.readyState === 4) {
this.onreadystatechange = null;
if (this.status === 200) {
var returned = JSON.parse(this.responseText).d;
var results = returned.results;
var InvoiceDetailId = results[i].InvoiceDetailId;
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
*********
After the var results = returned.results line, you can add a for loop to do you calculations:
var totalAmount = 0;
for (var i = 0; i < results.length; i++)
{
var amount = results[i].new_costinbhd;
totalAmount += amount;
}
Hope this helps you.
If you get into code error issues, you can add debugger to your lines of code, or click on F12 to open your browser Developer Tools.
Hope this helps.
hI Mahender and Aric Levin
YES IMPORTING TO OUR CRM.please find below screenshot .could you please advise me next step
Hi Sahib,
Open your CRM application, navigate to Settings->Solutions->Import and then select the managed solution that is there.
Let us know if you are still facing any issue
Did you install the managed solution?
As Andrew mentioned earlier, don't download the source code, but the managed solution.
After you downloaded the solution, in CRM go to Settings -> Solutions.
Click Import, and select the zip file of the CRM Rest Builder managed solution.
You should be able to use it after that.
Also, if you have v2.5 installed, uninstall it first.
Let me know if that helps you out.
Hi Aric Levin ,
Actually i download CRMRESTBuilder_1_5_0_0_managed but I don't know how to use Rest builder statement for this
please find below downloaded folder
e
Please find below my javascript ,I want to use with web api(crmrestbulder) but I don't know how to use in crmrestbuilder .please advise me how to do this
my java script
*****************
function getCostBHDTotal() {
debugger;
var costBHDTotal = 0;;
// but here I want to use SDK.REST.retrieveMultipleRecords
function (results) {
for (var i = 0; i < results.length; i++) {
var new_costinbhd = results[i].new_costinbhd;
costBHDTotal += parseInt(new_costinbhd);
}
},
function (error) {
alert(error.message);
},
function () {
alert(costBHDTotal);
}
);
// alert(costBHDTotal);
}
Sorry, my mistake. No rollups in CRM 2013, only 2015 and above.
In that case, your best best is use JavaScript with REST Builder.
Build your Rest statement with Rest Builder to retrieve all child records and sum them up.
The code that you provided seems fine, except that you did not share your actual query.
Are you getting errors?
Also check that you are getting the proper results from the Rest Builder statement.
HI Aric Levin
there is no rollup field in our crm 2013 on premise. what will do
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156