Answered by:
Calculated field using Jscript

Question
-
Hi
I want to put calculated data into one of field using Java Script plug-in (Web Resource).
Found couple samples for calulating fields and fields but I need the total count of Customers in form.
For example,
Fields : Name, Country, Total in User's Country(calculated field), etc..
If I have 100 user records and 60 customers with USA as Country, for the new entry form will be displayed as..
Name: John
Country: USA
Total in User's Country : 60 (display right after I put the USA in Country field)
After record/save it, if I re-open it, it will display as..
Name: John
Country: USA
Total in User's Country : 61 (becuase John is added)
Country fields will use On Change event.
However, for the java script, I do not know how to pull the total user count based on field selection(Country).
Thank you
FYI, I'm using CRM 2011 Online.
SoyLover- Edited by SoyLover Thursday, September 8, 2011 9:01 PM update
Thursday, September 8, 2011 8:41 PM
Answers
-
You can use the returntotalrecordcount property of fetch xml.
Here is link to use fetch xml in javascript
http://mileyja.blogspot.com/2011/06/aggregation-count-max-min-etc-and.html
Here is link to get total records in fetch xml
http://www.crmsoftwareblog.com/2011/05/fetchxml-2011-total-record-count/
I hope this helps.
Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/- Proposed as answer by Amreek Singh Friday, September 9, 2011 12:51 AM
- Marked as answer by SoyLover Friday, September 9, 2011 4:04 PM
Friday, September 9, 2011 12:51 AM -
Hi,
If you want to count the number of Accounts in a country then you can execute FetchXml request (http://crmbusiness.wordpress.com/2011/05/12/crm-2011-how-to-execute-fetch-xml-in-javascript/) via JScript tp get the numbers count (http://blog.customereffective.com/blog/2011/05/fetchxml-2011total-record-count.html), you may use t
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".- Marked as answer by SoyLover Friday, September 9, 2011 4:04 PM
Friday, September 9, 2011 12:58 PM
All replies
-
You can use the returntotalrecordcount property of fetch xml.
Here is link to use fetch xml in javascript
http://mileyja.blogspot.com/2011/06/aggregation-count-max-min-etc-and.html
Here is link to get total records in fetch xml
http://www.crmsoftwareblog.com/2011/05/fetchxml-2011-total-record-count/
I hope this helps.
Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/- Proposed as answer by Amreek Singh Friday, September 9, 2011 12:51 AM
- Marked as answer by SoyLover Friday, September 9, 2011 4:04 PM
Friday, September 9, 2011 12:51 AM -
Hi,
If you want to count the number of Accounts in a country then you can execute FetchXml request (http://crmbusiness.wordpress.com/2011/05/12/crm-2011-how-to-execute-fetch-xml-in-javascript/) via JScript tp get the numbers count (http://blog.customereffective.com/blog/2011/05/fetchxml-2011total-record-count.html), you may use t
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".- Marked as answer by SoyLover Friday, September 9, 2011 4:04 PM
Friday, September 9, 2011 12:58 PM -
Jehanzeb,
As a MCC, Is it okay to contact you for more detail questions?
Thank you
SoyLoverFriday, September 9, 2011 5:58 PM -
Hi,
Yes you can contact anytime for more questions.
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".Friday, September 9, 2011 6:13 PM