Retrieving Account Information By Id

Hello,

I am trying to get an account's information by passing the Account Id.
I have included the web reference
(.../mscrmservices/2006/crmservice.asmx)

I created an account object:

CrmSdk.account oAccount = new CrmSdk.account();

I can access all of the account's attributes from this point
(oAccount.name, etc).  But, I want to filter it down to a specific
account by sending in the AccountId.

In 1.2 I did:

string cXml = "";
cXml += "<columnset>";
cXml += "<column>name</column>";
cXml += "<column>accountnumber</column>";
cXml += "<column>address1_line1</column>";
cXml += "<column>address1_city</column>";
cXml += "<column>address1_stateorprovince</column>";
cXml += "<column>address1_postalcode</column>";
cXml += "</columnset>";

string cAccountXml = oAccount.Retrieve(oUserAuth, m_cAccountId, cXml);

Where m_cAccountId was passed in.

I'm trying to convert to 3.0 now.

Any ideas?

Thanks,
Kimberly

0
Kimy
4/12/2006 9:26:09 PM
crm 35858 articles. 1 followers. Follow

3 Replies
794 Views

Similar Articles

[PageSpeed] 8

Easiest way is to do this:

account acct = (account)service.Retrieve(EntityName.account.ToString(), 
pAccountID, new AllColumns());

where paccountID is the GUID corresponding to the account id.

for anything more complex read up on QueryExpression and QueryByAttribute in 
the 3.0 SDK.




"Kimy" wrote:

> Hello,
> 
> I am trying to get an account's information by passing the Account Id.
> I have included the web reference
> (.../mscrmservices/2006/crmservice.asmx)
> 
> I created an account object:
> 
> CrmSdk.account oAccount = new CrmSdk.account();
> 
> I can access all of the account's attributes from this point
> (oAccount.name, etc).  But, I want to filter it down to a specific
> account by sending in the AccountId.
> 
> In 1.2 I did:
> 
> string cXml = "";
> cXml += "<columnset>";
> cXml += "<column>name</column>";
> cXml += "<column>accountnumber</column>";
> cXml += "<column>address1_line1</column>";
> cXml += "<column>address1_city</column>";
> cXml += "<column>address1_stateorprovince</column>";
> cXml += "<column>address1_postalcode</column>";
> cXml += "</columnset>";
> 
> string cAccountXml = oAccount.Retrieve(oUserAuth, m_cAccountId, cXml);
> 
> Where m_cAccountId was passed in.
> 
> I'm trying to convert to 3.0 now.
> 
> Any ideas?
> 
> Thanks,
> Kimberly
> 
> 
0
Utf
4/13/2006 12:38:02 AM
Thank you very much.  Now, how would I get a Contact's information when
passing in the AccountId?

0
Kimy
4/13/2006 3:31:19 PM
Actually, here's my real problem.

I'm doing this to get the contact:

        //+ credentials
        CrmSdk.CrmService oCrmService = new CrmSdk.CrmService();
        oCrmService.Credentials = new
System.Net.NetworkCredential(m_cUsername, m_cPassword);
        // oCrmService.Credentials =
System.Net.CredentialCache.DefaultCredentials;
        //+ send credentials on first round trip
        oCrmService.PreAuthenticate = true;

        CrmSdk.ColumnSet oColumnSet = new CrmSdk.ColumnSet();
        oColumnSet.Attributes = new string[] {"accountid", "firstname",
"lastname", "telephone1", "emailaddress1"};
        oContact = (CrmSdk.contact)oCrmService.Retrieve("contact", new
Guid(m_cContactId), oColumnSet);

To get a value of an attribute, I'm doing this:
m_cContactEmail = oContact.emailaddress1;

Not sure if this is right?  But, when doing it this way, I get an error
when trying to get the contact's accountid.  So, I don't think I'm
putting the contact's values into my variables correctly.

Any ideas?
Thanks,
Kimberly

0
Kimy
4/13/2006 3:43:00 PM
Reply:

Similar Artilces:

Sender ID sp2
Hello all I recently isntalled sp2 and I have enabled sender id in reject mode. I now see some NDR messages that say Your message did not reach some or all of the intended recipients. Subject: Kirschners So Cal January Sent: 10/27/2005 11:14 AM The following recipient(s) could not be reached: Tom Delay on 10/27/2005 11:12 AM You do not have permission to send to this recipient. For assistance, contact your system administrator. <bbserver.mydomain.com #5.7.1 smtp;550 5.7.1 Sender ID (PRA) Not Permitted> Tom Delay is a user on my server. What is this message telling me?...

How to retrieve the string from dialog box
Hi All, Does anyone know how to retrieve a string in IDC_STATIC on a dialog box? I have to print out a report with an application version at the bottom line for users to be aware of it in my application. I don't know how to retrieve the string in IDC_STATIC control on a dialog box. It would be very nice that someone let me know how to do that without calling the dialog box. TIA Hwasoo Lee Back 9 wrote: > Hi All, > > Does anyone know how to retrieve a string in IDC_STATIC on a dialog box? > I have to print out a report with an application version at the bottom line &g...

Always uses default account when sending mail
I have several accounts configured in Outlook 2003 SBE. If I have composed a message and I use the Accounts button to change the account used. Outlook then displays which account will be used for sending the message; this is another than the default one. When I send the message, it still uses the default account to send it, I see this when I test it. What is the matter? Cheers, Thorbjorn I appear to be having a similar problem under Outlook 2003 on a new XP system. I've configured in multiple email POP accounts. Usually if I send just one email at a time, it will retain the default...

Transfering information from one cell to another
I'm using Excel 2003 I have a workbook open and am using 2 worksheets. On sheet 1 I get information from the internet and then transfer three cells of it to sheet 2. Sheet 1 updates every time I open the workbook. How do I get sheet 1 to put the information into a different cell in sheet 2 each time it updates. I would like to get them to follow the dates down a column. Garry gtpighin@shaw.ca One way: This will transfer one value from sheet 1, cell A1 to sheet 2, column A. You may be able to adapt it for three cells, but the best implementation will depend on which three cells you&...

how do you delete account
I downloaded my checking information and somehow the balance is wrong. I need to delete checking account and then redownload checking activity. I must have done something wrong during the import to Money. I figured out how to delete one item at a time but that would be to time consuming being 100 transactions to delete. Walt The general answer for general cases of people not using Money Essential (MEss) is to go to the Account List, Select the account, and use the Delete... choice on the r-click menu. IF Money discovered this account on its own through the downloaded transaction dat...

retrieve an AVERAGE of a range using VLOOKUP to locate start/end d
Can I calculate the average of a range based on VLOOKUP? In other words, can I get Excel to "look up" the respective START / END dates of an investment position listed in Sheet 1 and then go and locate those 2 distinct cell values in in a different sheet (Sheet 2) utilizing VLOOKUP function and then return the calculated AVERAGE of the cells within that range back into Sheet 1? Appreciate any thoughts if doable in Excel in any way? tAKE A LOOK AT AverageIFS and see if that does what you want. If it were me, I'd probably enter the formula manually, record the resu...

Exchange.account
I use Exchange server. When I am not connected, I can not add new e-mails to my contacts or sent e-mail to people who are not contacts. Anyone knows why? I removed the account, but now I get message that I am offline. Again why??? Thanks. unless you use outlook in offline mode all of your data is stored on the server and it;s not available when you are offline. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center...

Retrieve mouse position
Hi, I am writing an app in which I need to retrieve the mouse coordinates even when it mouse is outside the main frame. How do I do it? Thanks! xg >Hi, I am writing an app in which I need to retrieve the mouse coordinates >even when it mouse is outside the main frame. How do I do it? Thanks! Have you tried calling GetCursorPos? If you want to know when the mouse is moving I think you'll need to use a hook - have a look at SetWindowsHookEx WH_MOUSE. Dave IN addition to David's answer, you have not stated the problem you are trying to solve. For examp...

Exchange 2003 mailbox setup to receive all messages from the other mail accounts?
Is it possible to setup an email account, in Exchange 2003, which transparently receives all the email messages sent by the other mail accounts on the domain? By transparently I mean that the employees shouldn't be aware of this configuration. I have this company which currently has its email handled by an external service company which runs MailEnable Enterprise email server. On the server side there is a mailbox, which receives all the mail sent-by and addressed-to all the other email accounts on the domain. The two VPs have access to this mailbox, so they can have records and contro...

Transffer Sale onto account
Hi, We are using RMS2.0 and was wondering if it is possible to transfer a previous sale onto a customers account. Thanks is advance for your help ...

Retrieving comment using range name
I have singular cells in different places referenced by their range names. Is there a way to get the comments corresponding to the referenced ranges (singular cells)? Thanks in advance, Tomek Set testrng = Range("A3:A4", "C3:C4") comment1 = testrng(1).Comment.Text .... commentn = testrng(n).Comment.Text Stefi „topola” ezt írta: > I have singular cells in different places referenced by their range > names. Is there a way to get the comments corresponding to the > referenced ranges (singular cells)? > Thanks in advance, > Tomek > > did yo...

Retrieving messages
Help, I mistakenly restored all the defaults on Outlook (the computer did not crash) losing all the messages and address book. I have had to set up the application from scratch entering account details etc. Question is: are all the messages and contacts still held on the computer even the program needs to be set up again and, if so, how do I retrieve them. Any assistance greatly appreciated. Thanks. P89 If you made a backup of your system or My Documents, search for a file called Outlook.pst. If you have that you can import all the information. Al "peterson89" <peterson...

Retrieving lost messages after Synchronization in Outlook Express
Setup for my hotmail messages to be downloaded to Outlook Express. When tried to connect to see an old message, didn't realize that it was setup to auto synch. My messages were deleted from hotmail, and are now lost on Outlook Express after synching. Is there anyway to retrieve the lost messages from Outlook Express? I really needed some of the items in there, and had downloaded them so they wouldn't be lost. Thanks! ...

Perfomance by Investment Type or Account is WRONG
The "Performance by Investment Type or Account" Reports are WRONG and I cannot get anyone to fix this situation. Here's an EASY way to show you what the problem is: Go in and make the following transactions under an Investment Account in your SAMPLY.MNY file. Buy a Cash Money Market in the amount of $1,000 (at $1/share) on 10/01/05. Now, enter a "Reinvested Interest" amount of $10.00 (at $1/share) on 12/31/05. Okay, go to the report and look at the "Return for Period" column and see what the problem is (it will say your return was $20 - not $10). Just...

Retrieve
Hi how do i retrieve all the postings i have posted in this group. sometimes forget of where i posted my i will be glad to get to know how to pull out my own questions cheers Click on your name to view the profile...Then click 'Recent posts by this user' http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.excel.misc&p=1&tid=467a932d-65b6-4bb1-98e1-25def53a971a&mid=467a932d-65b6-4bb1-98e1-25def53a971a -- Jacob (MVP - Excel) "Amin" wrote: > Hi how ...

Retrieving
Is there any way to retrieve how many web pages are opened by Internet Explorer, and what URLs are opened by it, from another process? I searched for IHTMLDocument5 and so on, however, I could't find any hint. Please reply. Thanks in advance. Regards, Hyun-jik Bae ...

No free/busy information could be retrieved
Recently migrated from 5.5 to exch2003, once the 5.5 machine was turned off, users free/busy information is not available, if the 5.5 machine is turned on it is available, does anyone know what I need to so that the information is available after 5.5 is turned off? -- Thanks Sounds like you forgot to re-home the System Public Folders (specifically the Free/Busy Public Folder) before turning the old server off. Follow the details in this article for a list of things you should do in order to retire the 5.5 server. http://support.microsoft.com/default.aspx?scid=kb;en-us;307917 - referen...

backup outlook 2002 account info
Hello, all. I know how to back up Outlook data files, etc. Is there a way to back up Outlook XP(2002) account information? I have to create a new user profile on my win2000 laptop and upon doing so, the Outlook account is not set up for new profile. We connet to an Exchange server and it really isn't prudent to set up the account over a dial up connection. Any and all help is greatly appreciated!! Later versions of Outlook do not allow you to export your mail account settings, only import. Let me check to see if Outlook 2002 does this also. --� Milly Staples [MVP - Outlook] Post...

sub accounts or department accounts
We have a small non profit club with a single checking account, we have several different departments like club house and associated expenses, range and associated expenses, etc. We enter income and expenses against categories for the above, but would like to have a report showing the present value of each department or subaccount. Some years more comes in than goes out, other years the opposite, but it is not apparent how to report on the current balance in a category I cannot figure out a way to get Money to do this, can someone help me out please? thanks in advance -- Steve...

Multiple Hotmail accounts in Outlook02 : possible?
I tried a search on this without any luck... ::I've been trying to add a couple more hotmail accounts to b synchronised in outlook2002, but it can't access them.:: I've currently got my hotmail account, which works in Outlook, and POP3 account which also works. When I try to add my wife's hotmail account or a second hotmail accoun of my own (which can both be accessed from internet explorer without problem)outlook cannot recognise them. I had this problem with Outloo Express as well. I think I have all the settings configured correctly, (like SPA is NO ticked in the acc...

retrieving my questions
I am still learning how to use this system to it's fullest. How can I locate the questions I have asked in the past? Is there an easy way? -- Zunibear in Montana It depends upon how you are viewing this forum. If using Outlook Express, make sure your view is set for all messages. You could then sort by "From". If you don't want to loose the threaded response view, don't sort, but you probably have a copy of any post you did in the "Sent Items" folder in Outlook Express. Look there, find the one you are interested in, and scroll to that date in the f...

Sender ID not working.
I installed sp2 on our Exchange 2003 servers and configured IMF and sender ID. Sender id does not work at all. What are the steps for configuration? ...

How to retrieve SYSTEMTIME
When I use: SYSTEMTIME st; MyTime = CTime::GetCurrentTime(); MyTime.GetAsSystemTime(st); st.wHour, st.wMinute,st.wSecond are correctly loaded but st.wMilliseconds is always 000. What am I doing wrong? Ron H. x-- 100 Proof News - http://www.100ProofNews.com x-- 30+ Days Binary Retention with High Completion x-- Access to over 1.9 Terabytes per Day - $8.95/Month x-- UNLIMITED DOWNLOAD On Fri, 16 Sep 2005 10:30:03 -0500, "Ron H" <rharshbarger@mmm.com> wrote: >When I use: > > SYSTEMTIME st; > MyTime = CTime::GetCurrentTime(); > MyTime.GetAsSys...

How do I retrieve
Is there a way to restore emails that were in the inbox before I did an easy transfer. System is Windows 7 with Outlook 2007 niether Easy Transfer or copy has any impact on the origonal data, which remains in the origonal PC (unless you did something else to it) "Glenn" <Glenn@discussions.microsoft.com> wrote in message news:0A92A4E7-6B84-4E2E-AD46-65544E08A801@microsoft.com... > Is there a way to restore emails that were in the inbox before I did an > easy > transfer. System is Windows 7 with Outlook 2007 Do you still have access to the origina...

Product key retrieval
A customers single RMS station died, and you guessed it, they lost their Product Key and have no backups of their database. I managed to take the hard drive out and install it in a PC with like hardware and it booted up, so I can start RMS and backup their hard database, but is there anyway to get the key? Perhaps hidden in the registry? Thanks in advance RMS version 2.0.0108 Windows Vista x86 SQL Express 2005 Their RMS reseller should have kept a copy of the license key and delivered the original licenses to the end user. If the software was purchased legally and they registered th...