When we create orders in CRM, they are sent over to GP. When they go over to GP they are printed as invoices and we need to know who to hand them to. I would like the initials of the user who created the order to be sent over.
I would therefore like a calculated field on an order entity that takes the created by field and turns "John Smith" into "JS" and "Adam Jones" into AJ etc. I can then use these initials in my mapping over to GP. Taking the full name uses too many characters in GP hence my need for just initials.
Thanks
*This post is locked for comments
You can use normal text field instead of calculated field, then by using javascript code you fill it by first letter of each word in a string ( Use Full Name):
First you need to get the value of created by:
var createdby =Xrm.Page.getAttribute("createdby").getValue();
Then you can get the first letter of each word in a string by :
var matches = createdby.match(/\b(\w)/g);
var initial = matches.join('');
Then set the field value by :
Xrm.Page.getAttribute("new_field").setValue(initial);
How are you handling collisions? Such as, if you have Wayne Walton and Will Wheaton in the CRM system, having both of them listed as WW would be an issue.
My suggestion would be to update the User record with an Initials area and manually choose everyone's initials. Then update your GP integration to look up the Initials field instead of the full name field.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156