Wednesday, May 30, 2012

Database Lookup Functoid : Multiple Where Clause : CRM PickList field

When integrating CRM I came across a Scenario while mapping a PickList field in CRM using BizTalk. Since we need to send the Index (AttributeValue) of the Value in the Xml to CRM for the PickList field I had to do a look up first to get the Picklist value Index.
Assume my Query is
Select top 1 from StringMap where Value='Staff' and AttributeName='lucky_title'
Staff comes from the Title field in the Input Xml.

Now in traditional Database Lookup Functoid we know about single where clause parameters but what if we have a multiple where clause?
Here is the StringMap table in CRM 2011


In that case what we have to do is add a String Concatenate Functoid or a Scripting Functoid for the Multiple Column and Multiple Value parameter with a separator.
I have used a Scripting Functoid.
select top 1 * from StringMap where Value + '|' +  AttributeName = Title|lucky_title






No comments:

Post a Comment