Doubt in getting the record count of customised field..

Hi,

In MSCRM i want to get the total count of contact records according to
a database status field or according to my own customised field. how
can do it. fromSDK i got this code snippet but how can i mention the
code number that i want to retrieve.(ex) select count(myfield) from
contacts where myfield='5'.
How can i convert this query as xml query.

code which i got from sdk is.

String strQuery;
strQuery = "<fetch mapping='logical' aggregate='true'>"
strQuery += "   <entity name='Contact'>"
strQuery += "      <attribute name='myField' aggregate='count'
alias='number' />"
strQuery += "   </entity>"
strQuery += "</fetch>"

// Execute the query
int intCnt = query.ExecuteQuery(userAuth, strQuery);
0
iamiamiam_77
2/10/2004 6:26:28 PM
crm 35858 articles. 1 followers. Follow

1 Replies
640 Views

Similar Articles

[PageSpeed] 14

Try this XML:

<fetch mapping='logical' aggregate='true'>
	<entity name='contact'>
	<attribute name='contactid' aggregate='count' 
alias='number' />
	<filter>
		<condition attribute = 'myField' 
operator='eq' value='5' />
	</filter>
	</entity>
</fetch>

Regards,
Matt Narayan.


>-----Original Message-----
>Hi,
>
>In MSCRM i want to get the total count of contact records 
according to
>a database status field or according to my own customised 
field. how
>can do it. fromSDK i got this code snippet but how can i 
mention the
>code number that i want to retrieve.(ex) select count
(myfield) from
>contacts where myfield='5'.
>How can i convert this query as xml query.
>
>code which i got from sdk is.
>
>String strQuery;
>strQuery = "<fetch mapping='logical' aggregate='true'>"
>strQuery += "   <entity name='Contact'>"
>strQuery += "      <attribute name='myField' 
aggregate='count'
>alias='number' />"
>strQuery += "   </entity>"
>strQuery += "</fetch>"
>
>// Execute the query
>int intCnt = query.ExecuteQuery(userAuth, strQuery);
>.
>
0
anonymous
2/11/2004 8:08:46 AM
Reply:

Similar Artilces:

Message From Field in Folder
When viewing the list of my new messages, is there a way to see the email address of the sender instead of the alias before I open it? In the From column I see "John". When I open the email I see "John <john@johnsemail.com>". I want to see the "john@johnsemail.com" before I open it so I can tell the difference between emails from "Microsoft Support <yourfu@edifyouopenedthis.com>" and "Microsoft Support <someguywhosreally@microsoft.com>" I am currently using outlook 2002 and 2003 alternately based on my mood. Mike If you ...

modify fields
Hi - just started using CRM and have several questions. 1. How do I modify the COUNTRY field? I want a user to be able to type in the name of the country and return and display the 2-letter country abbreviation? Do I have to build a new table for that or can I modify the country field as it is now? 2. How do I apply or change field rules such as case- convert, etc. for either existing fields or fields I create? Thanks in advance for any assistance you can give me. Cheers Ruthie I think the existing country field is a simple text field. You cannot out any logic behind these fields. One op...

All Task bars gone How do I get them back?
All of a sudden the other day everything at the top of my screen disappeared. I can load my word documents by searching my files and double clicking on the name but I can not Open a document inside word. I have never seen anything like this where all the buttons for using Word are gone. How do I get them back. http://www.gmayor.com/my_toolbars_are_missing.htm or http://word.mvps.org/FAQs/AppErrors/MissingMenusEtc.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP ...

count between a date range
Hi, I want to be able to count between a date range and return the value yes. I will show you the formula I currently have: =IF(M2>=DateCell-365,"Yes","No") This gives a yes if the date is greater than the date in M2 minus 365. This however cincludes all the dates beyond M2 which isnt what I want. I want the dates upto M2. If that makes sense? Any help would be greatly appreciated Thanks Try.. =IF(M2>=datecell-DATE(1,0,0),"Yes","No") -- Jacob (MVP - Excel) "Dave" wrote: > Hi, I want to be able to count be...

Report
I want to build (1) report and have my Record Source be one of three queries based on a selection in an option box on a form. Can I do this? If so, do you have any coding that might get me started? OR Do I need to create three reports and use each query as the record source? Thanks If you have Access 2003 + you can use Reports!MyReportName.RecordSource = "MyQuery" where MyQuery is the name of the query you wish to change to. I don't know if it works with earlier versions. Evi "NEWER USER" <NEWERUSER@discussions.microsoft.com> wrote in message news:6C9AA...

New (Blank) record not active
The form I use to enter new data has an icon for "New (Blank) record". This icon is faded and not active, so I can't use it to enter new data. Did I somehow inadvertently lock something? -- Ted in Chicago Usually, if your form is not updateable, the source of the form isn't either. Check the table or query you based the form on. -- Milton Purdy ACCESS State of Arkansas "TedChicago" wrote: > The form I use to enter new data has an icon for "New (Blank) record". This > icon is faded and not active, so I can't use it to e...

Getting the longest string
XML <data> <option>this is test 1</option> <option>this is test 11</option> <option>this is test 111</option> <option>this is test 1111</option> <option>this is test 11111</option> </data> The 5 option has the longest content. I need to get that length and place in a variable. The test has to look across all of the option nodes and return the longest one. Any suggestions? Cheers Keith Keith Chadwick wrote: > <data> > <option>this is test 1</option> > <opti...

Re: How to get all mails, even those for unknown recipient
Yes, good idea :) It is all i need (for example http://www.christensen-software.com/cscatchall.htm) But i wish those NDR are generated. To inform user that used address might be misstyped Is it posible to combine catchall mailbox with a ability of standard NDR generating? TIA Martin Blackstone - MVP wrote / napisal(a): > I think you are talking a Catch All mailbox. > Check this out > http://mostlyexchange.blogspot.com/2005/04/creating-catch-all-mailbox-in-exchange.html > > > "guzzi" <guzzi@_DOT_yandex.ru> wrote in message news:OoSFMGZhGHA.12...

Money 2004 Deluxe/Recording Spin-Off
Hello, Can anyone tell me what is the best way to record a spin- off, i.e. MerckMedcoHealth from Merck? Many thanks, Jim In microsoft.public.money, Jim Hammond wrote: >Hello, > >Can anyone tell me what is the best way to record a spin- >off, i.e. MerckMedcoHealth from Merck? > >Many thanks, > Go to the Merck investment details and choose "Record a spinoff" on the left. The details as to how much basis should be allocated to each is available on the web. >-----Original Message----- >In microsoft.public.money, Jim Hammond wrote: > >>Hello, &...

Using Input Form
I am using an Input Form to create a large number of similar records. Even though each key field is unique, the bulk of the fields in each database record are duplicate. Is there a simple way to "duplicate the previous record" using an Input Form in Access? I hope this makes sense. George L. Are you using a custom Add Record command button, or Access' native New Record buutton? -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000 Message posted via http://www.accessmonster.com A simple solution might be to assign the default valu...

Remove records from lookup
Not sure if this is possible but I would like to remove all records except the account records from the look up records dropdown menu of the appointment entity. The associated schema is regardingobjectid and the label is regarding. I see the other entities listed under relationships but there is no option to delete. Is there a way to create a new lookup and have it added to my appointment form? Thanks. There is no supported way to change this. The system is setup to allow you to set appointments that are related to specific records (Opportunities, Quotes, Cases, etc) and it will then ro...

Error: "Updated 18040 global customer record(s) in store database"
At one store, when ever HQ Client processes a worksheet it also updates thousands of customer records every time, bogging down the system. The result is that SQL and HQ Client hog resourses to the point that requests from other registers time out and POS crashes, until the worksheet is done processing. This happened once a year ago but nobody can remember how we fixed it. Any thoughts? Thanks. Mark L According to the dealer manuals you should have HQ client on a separate PC. Not on the one with the MSDE running on it. Try moving it to a less busy machine. Or poll only after hours,...

enter value based on drop down list of another field?
I have an excel 2003 spreadsheet with 3 worksheets. In sheet 1, I created a drop down list in column A based on values in sheet 3, column A (item number). Thisd data comes from sheet 3, where I have column A (Item #'s), column B (Item desc)an Column C (price) In column B of sheet 1, I have Item Descriptions and in column C I have price. I want this to automatically fill in based on what I enter in the column A sheet 1 and it should get the corresponding values from sheet 3 column B and C. I can make the drop down list in sheet 1 column B and C, but some of the descriptions need ...

Get paid to surf
Surfjunky pays up to .75$ per hour you surf, no limit to how long you surf. I've had an account for 2 days now, and i've let it sit and i've raked in 27$ http://www.surfjunky.com/?r=Etra1n ...

How to get device name?
Hello all: I want to know all the name of devices in my PC, because I want to open them using API CreateFile and test it, how to do?thanks. Hi, what you want do by meanin "test it"? You cant open all devices with the API CreateFile (for several reasons). Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre bien devoue Kerem G�mr�kc� Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "Lee Tow" <fbjlt@pub3.fz.fj.cn> schrieb im Newsbeitrag news:#vVH#JkqKHA.4220@TK2MSFTNGP0...

Counting # of events per day`
I have a file with the following format col a event name col b event date (e.g., 9/01/2006) col c event day of week (Mon, Tu, etc) col d, etc other info There are about 1600 of them. I need to get the following info: Number of days throughout the year with 0, 1, 2, 3, or 4 or more events per day Similar results for Mondays, Tuesdays, etc. Any suggestions on how to go about doing that? Thanks Hi Elliott Create a Pivot Table. Data>Pivot Table>Next>Mark the range of your data>Next>Layout Drag Event day of Week to Column Area Drag Event Date to Row area Drag Event Name to...

Restrickting from field
Hi, When you create new email, you can click option and tick FROM field. It will be add FROM field and you can use address book to pick up any name. Are their any options or policy to restrict this function? Thanks Using Exchange server? This should not be possible by default - someone has changed the permissions. What version of Exchange? Follow the KB 262054 to see where permissions might be set - and remove groups that shouldn't be there. wschoi wrote: > Hi, > > When you create new email, you can click option and tick > FROM field. > > It will be add FROM f...

limit create window/control max count?
Hi all. I am testing a create control. But I want create many control (more 10000) in dialog. I test dynamic create CButton. It's created about 9800. I want work. 1. have a two dialog.(A, B) 2. A dialog has 40 controls(Button, Spin, static). 3. B dialog has contain A dialog. A dialog is more than 200. 4. create A dialog dynamic.(Using A->Create(IDD, this)) and attach B dialog. A dialog is modaless. 5. But not create about 190. dialog create function return 0. thank for read. Have a nice day. You need to redesign your system, IMO. -- - Mark Randall http://zetech.swehli.com...

I have a problem with getting a total Sum of numbers (URGENT)
I'd really appreciate if someone could help me here. I am using Microsoft Excel 2002 on a Microsoft Office XP system. I a trying to develop a minor league baseball schedule, but am having som problems. I have attached a copy of my spreadsheet to give everyone some idea o what I'm doing here. I have where the fans list the "RUNS, HITS & ERRORS) of both teams an for each game of the series. I then have it set up in the TOTA WON/LOST column where if the T-Bones RUNS are more than the SALTDOG runs, a "1" appears in the WON column. If the SALTDOGS have a highe numbe...

Getting back a deleted test frame after saving the changes
My son just deleted a text frame with all his work and started a new text frame and then when asked if he wanted to save his work he clicked yes. Is there any way to retrieve that missing text frame when it won't allow you to undo? On Sat, 27 Aug 2005 16:04:01 +0100, Denise wrote (in article <09056FDE-03FC-4988-8AB0-D1EA0896BFC7@microsoft.com>): > My son just deleted a text frame with all his work and started a new text > frame and then when asked if he wanted to save his work he clicked yes. Is > there any way to retrieve that missing text frame when it won't a...

Counting Texts
If cell A1 contains a paragraph of texts and if I want to count just letter "W"s (Upper or lower case), How can I achieve this? Example: A1 contains "How now brown cow" the formula should return "4". Thank you. Write a macro and use the VBA functions Instr(strName, "w") together with Split(strName, "w") and count the number of times that it finds "w" or "W" Chris "Keith" <Keith@discussions.microsoft.com> wrote in message news:CC60AA13-B569-4C55-BDC7-1B6295CDAFB9@microsoft.com... > If cell A1 co...

Automatic Data Entry Script OnChange Event for Date Field.
Hi, Sub: Automatic Data Entry Script OnChange Event for Date Field. has anyone assigned 'Today date'( new Date()) to a custom date filed on the form - OnChange of a Picklist field, I have the following code. DatefiledName.value = new Date(); This assigns, currect date to the field, but then when I save it does not like it. When I manually assign a date it displays in the format mm/dd/yyyy, and saves correctly, so I changed the script to: d= new Date(); s = d.(getMonth() +1); s += '/' + d.getDate(); s += '/' + d.getFullYear(); DatefiledName.value = s; This also acc...

Data missing from enterprise custom task fields after migrating
We can see the enterprise task fields, but none of the data is displayed in files migrated from Project Server 2003 to 2007. Any ideas? -- michael Michael: What process did you follow for migration? -- Gary L. Chefetz, MVP, MCT, MCTIP Business: http://www.msprojectexperts.com FAQs: http://www.projectserverexperts.com BLOG: http://www.projectserverhelp.com "michaelj" <notreallyme.com> wrote in message news:4BD612D9-D1AD-4FF8-B103-699AB1B54D06@microsoft.com... > We can see the enterprise task fields, but none of the data is displayed > in > fil...

How do I get a copy of Publisher 2002?
I'd like to get a copy of Publisher 2002. I still have Windows 98 on my computer and don't want to upgrade to XP right at this time. Other than ordering off of e-bay or other sites I'm not familiar with, is it possible to get a copy of Publisher 2002 that would be compatible with Windows 98? Amazon.com -- Don Vancouver, USA "Crystal1365" <Crystal1365@discussions.microsoft.com> wrote in message news:33518C70-6D02-4E03-B9C2-2C1FDEEB4A68@microsoft.com... > I'd like to get a copy of Publisher 2002. I still have Windows 98 on my > computer and don...

Can't get at downloaded transactions
While Money was going through it's online update I also was in the process of requesting a download of transactions from a bank which uses web statements rather than direct statements. Somehow things must have gotten out of sync so that now Money is showing I have 19 transactions from this institution to review (which is correct) but it doesn't present me with anything to review when I'm in that account. I've tried re-downloading from the bank but that doesn't help. Any ideas how I can access the downloaded transactions? In microsoft.public.money, Ken wrote: &...