Thursday 27 March 2014

CRM 2011/2013 - SSRS Report Drill Through

iif(
 (
  (iif(Fields!customeridEntityName.Value is nothing, 0, 1) +
    iif(Parameters!CRM_URL.Value is nothing, 0, iif(Parameters!CRM_URL.Value = "",0,1))) <> 2),
   System.DBNull.Value,
   iif(Fields!customeridEntityName.Value = "account",
     Parameters!CRM_URL.Value & "?OTC=1&ID={"& Fields!customerid.Value.ToString() &"}",
   iif(Fields!customeridEntityName.Value = "contact",
      Parameters!CRM_URL.Value & "?OTC=2&ID={"& Fields!customerid.Value.ToString() &"}",
      System.DBNull.Value)
   )
)