XRM-OSS / Xrm-Html-Templating

Custom XRM HTML Template Editor
MIT License
6 stars 3 forks source link

Unable to see RecordUrl #6

Closed gabriele-silvagni closed 5 years ago

gabriele-silvagni commented 5 years ago

Hi Florian,

First of all: thank you for this great tool!

I have created a HTML template which includes a RecordUrl. The RecordUrl points to the regardingobjectid of the email, which is a quote. What i am trying to do is to include the dynamic link of the related quote into the email. I am using the same sintax you used in your video example (see below the code):

${{RecordUrl(Value("regardingobjectid"),{linkText:"link"})}}

Unfortunately the link does not appear on the email. What am I missing?

Regards, Gabriele

DigitalFlow commented 5 years ago

Hi Gabriele,

did you copy-paste the RecordUrl call into your template? The editor will normally paste as HTML when you directly copy from a website, so functions can get broken because invisible tags are inserted. Can you try by pasting the RecordUrl call again, but by right clicking and using "Paste as text"? The other option is to simply type in the call yourself.

If it still does not work, please enable plugin tracing inside your system settings and send me the trace of the XTL email creation plugin, it logs in detail what it is doing and where errors occured.

Edit: Another possible issue if you are using the managed solution, is that the secure configuration of the "Apply XTL placeholders" SDK step is missing an organization url. The CRM does not provide a possibility to retrieve the organization url from within the backend, which is why we need it there. It looks like this inside the secure config: { "organizationUrl": "https://server/Org/" }.

Kind Regards, Florian

gabriele-silvagni commented 5 years ago

Hi Florian,

Following your suggestions, I activated the tracing and found the following error:

Xrm.Oss.XTL.Templating.XTLProcessor: Create of email (Insert HTML Template)

Processing handler RecordUrl
Exception while processing token RecordUrl(Value("regardingobjectid"),{linkText:"link"}), replacing by empty string. Message: GetRecordUrl can't find the Organization Url inside the plugin step secure configuration. Please add it.
Replacing token with ''

I inserted my org URL into the secure config you and it worked. Thank you for your kind assistance!

Gabriele

DigitalFlow commented 5 years ago

Hi @gabriele-silvagni,

thanks for your feedback, I'm glad it's working now. I'll edit the ReadMe to include setting the organizationUrl initially until I find a way of automating it.

Kind Regards, Florian