Re: Integrating CRM lookups into custom ASP.NET? by Mike
Mike
Tue May 03 01:41:29 CDT 2005
"Michael F" <MichaelF@discussions.microsoft.com> wrote in message
news:1B801456-63DA-466E-91A7-AE7318845662@microsoft.com...
> I'm hoping someone might offer suggestions on how to call the standard CRM
> lookup forms from a custom ASP.NET page?
>
> Is it possible? Any challenges or issues people have come across? Etc.
>
> Short sample code example would be greatly appreciated J
>
> Thank you in advance for any responses,
>
> Mike
Hi Mike,
Use the RetrievePicklist method in the customisation class. A full
description can be found in the SDK.
I have enclosed a snippet of code that pulls a customised country list and
displays in a drop down on an ASPX page.
Regards
Mike
' Country
strResults = ""
Try
strResults = .cCustomisation.RetrievePicklist(.CurrentUser,
Microsoft.Crm.Platform.Types.ObjectType.otAccount, _
"CFPaddress1_country")
Catch ex As Exception
If Trace.IsEnabled Then
Trace.Warn("PickList XML (CFPaddress1_country): " & ex.ToString)
End If
strResults = "<Picklist><Entry><Value></Value></Entry></Picklist>"
End Try
Try
xmlObj = New XmlDocument
xmlObj.LoadXml(strResults)
PickList = xmlObj.SelectNodes("Picklist/Entry/Value")
'Add an empty value ""
Me.country.Items.Add("")
For Each PickListValue In PickList
Me.country.Items.Add(PickListValue.InnerText)
Next
Catch ex As Exception
If Trace.IsEnabled Then
Trace.Warn("PickList XML (CFPaddress1_country): " & ex.ToString)
End If
End Try