Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Getting Posted Fields in a Posted Form in CRM via C#

$
0
0

I am able to fetch the Posted Forms data in CRM by using the RetrieveMultiple method. I am not able to find how to fetch all the posted Fields in a particular Form. E.g. In the CRM web portal I get 3 Posted Forms. To view the data submitted by a user by filling up that form, I have to click on that particular Posted Form and then I can view submitted records like "Business Email", "Company Name" etc. How can I retrieve the same thing in the code below inside the foreach loop for each of the Posted Form.

I am using the below code to retrieve the Posted Forms:

string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='cdi_postedform'>
<attribute name='cdi_name' />
<attribute name='createdon' />
<attribute name='cdi_success' />
<attribute name='cdi_leadid' />
<attribute name='cdi_contactid' />
<attribute name='cdi_formcaptureid' />
<attribute name='cdi_webcontentid' />
<attribute name='cdi_campaignid' />
<attribute name='cdi_postedformid' />
<order attribute='createdon' descending='true' />
<filter type='and'>
<condition attribute='cdi_name' operator='eq' value='CRM Automation Test Form' />
</filter>
</entity>
</fetch>";

EntityCollection fxResult = service.RetrieveMultiple(new FetchExpression(fetchXml));

foreach (var e in fxResult.Entities)
{
Console.WriteLine("Name: {0}", e.Attributes["cdi_name"].ToString());

////????////

}


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images