Hi,
I have a custom entity that needs to hold a URL to a pdf document in sharepoint.
The entity has a field that holds the document name that is used in the path.
The URL will be created in the following format: "sharepoint path/" + [Custom Entity Field] + ".PDF"
Can this be done by using a business process flow or do I need a plugin for this type of thing?
*This post is locked for comments
Very nice post. Quick question though. What if the string I need to concatenate has double quotes in it? How can I isolate those?
Thanks! That makes perfect sense.
This can be achieve in multiple ways so you can choose what fits your need best. You can use the workflows to set the desired field value. In the example below I created a sync workflow which is fired when the account record is created or the account name is updated and used that to populate the website field using slugs and string concatenation.
This will update the account field on the server whenever the account name is updated or new account is created. This will trigger on data import and SDK endpoints too. However on the client the change is not immediately visible .
In order to achieve that you can use client API to do the same on the client. See example here - https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/clientapi-form-context
In short on change on the account name -> get the field value and set the desired field after decorating with the sharepoint substrings.
Hello,
As suggested above calculated field will be the best options for you. You don't need to write any code , just to make sure you are concatenate correct fields.
Check here for more details -
Sounds to me like a calculated text field will get you exactly what you need. Go to the entity, and create a new field:
Data Type - Single Line of Text
Field Type - Calculated
Format - URL
On the Calculated field menu, you can build your URL piece by piece.
Field = CONCAT(<sharepoint path>, <Document Name>, ".PDF")
That should build it out for you just fine. You can use values from fields on the entity, or by typing in a manual value (like ".PDF") to build the string. Make sure your manually entered string is in quotes.
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