MS Tech & Coffee

Thoughts of a .NET Developer turned into MS Dynamics architect turned into Power Platform Director turned into AI and Business Transformation Global Lead… all views are my own!

Hello guys,

Today, at this moment I am facing a problem and I thought it would be good to blog about it while I am trying to solve it.

Background: My requirement is to get the Short Name of a Contact in the following format: Title + First Letter of the Name + Surname. I.e: Mr M Trueba

Resolution:

  • Doesn’t seem to be too complicated… I would just need to get the first letter of the name..and there is magic method in SSRS called GetChar()
  • However…we are in a sandbox… http://msdn.microsoft.com/en-us/library/hh547428.aspx#BKMK_Allowed Can’t use that :S
  • Let’s try and see if I can separate it with FetchXML… hmm is not looking like it is possible.
  • It is possible to group by date, and that will give you the day,month or year only, however it is not possible to split the string in a FetchXML.
  • Unless… there is another method to retrieve the a specified number of characters rather than one character only… something like LEFT()Image
  • And there you go, that method will not give you any problem with the sanbox in CRM Online and will let you retrieve the first character of a string
  • Left(Fields!StringField.Value,1)
  • If your requirement is to retrieve a specific value in the middle of the string you could just use Left() and Substring()

This one was an easy one, but I think it was a great exercise for my head to put my thoughts here while I was solving it 😉 

You guys helped a lot! Hehehe

Cheers,

Mario

Leave a comment

I’m Mario

Welcome to MS Tech & Coffee, a project I started more than 8 years ago as a place where I could drop things that I was encountering in my journey as .NET developer in the UK. That journey has taken me to many places and now looking back I want to use this project to share some of my personal views on technology, AI, the Microsoft ecosystem and of course.. a bit of coffee!

Let’s connect