cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to use Custom Entity Field to Store HTML scripts and handle Multi Language like Knowledge Base Article

Hi Experts,

 

I have a requirement on Knowledge article to integrate it with Portal but I am having some issues which I mentioned in another post. So, I won't be able to use the Knowledge article with the current license but I was thinking to create a Custom Entity and create a Multiline Text field to store the HTML content like how Web Page & Web Template Entity store. But I have to create a model-driven app, so that some specific users can add the post or announcement and different languages like Spanish and English.

So, can I handle that?

Also in the Form how can I add a Component to having an HTML and Design view for the end-user to add the post or announcement:
HTML ComponentHTML Component

 

Please help me with this. Any Help will be appreciable.

 

Thanks,

Amit

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi @hardikv @OOlashyn 

Thanks for all your response!

 

I have created one custom Entity called "Custom Knowledge Article" where I have added the "Content" multiline text field, language lookup field and some other fields.

While I was going through @hardikv links, meantime I had done some research on the form which is present in Web Page Entity and found that in that form the Rich Text control is nothing but Web Resouce. So, in my main information form, I have included one Web Resource and given the exact same properties as web page form (except some).

And the Rich text is working perfectly, the data is inserting perfectly with the correct HTML script. My form is working perfectly and I included that to my model-driven app.

 

Web Resource for Content HTML in  Custom KAWeb Resource for Content HTML in Custom KA

 

The form is getting the Rich Text:

Rick Tect in KA formRick Tect in KA form

 

I added a few data to the Entity from the form:

Custom KS entity storing data correctlyCustom KS entity storing data correctly

 

But I am facing one issue when trying to read the data using Liquid code. I am not able to understand why I am not able to fetch the data. The liquid code looks perfect. Below is the code for the same for a single record present in the Entity.(just for checking purpose):

 

{% assign KAGUID = entities.cre08_customknowledgearticle['a5e838r1-d0cc-ea11-a812-016d4sb148ga'] %} // this GUID is wrong but I have used correct one while doing my fecth

    {% if KAGUID %}
    {
    "KA_ID": "{{ KAGUID.cre08_customknowledgearticleid}}",
    "KA_Number": "{{ KAGUID.cre08_kanumber}}",
    "KA_Keyword": "{{ KAGUID.cre08_keyword}}",
    "KS_Desc": "{{ KAGUID.cre08_description}}",
    "KA_Content": "{{ KAGUID.cre08_content}}",
    "KA_Createdon": "{{ KAGUID.createdon}}"

    }
    {% else %}
        
        { "success" : false }

    {% endif %}
  

 

 My web template is in application/json MIME type.

I am getting below as output:

{ "success" : false }

 I am not able to understand where I am doing mistake.

 

Could you please help me to solve the issue? Any help will be appreciable.

Thanks,

Amit

View solution in original post

7 REPLIES 7
OOlashyn
Super User
Super User

Hi @Anonymous ,

 

There is no ootb editor component that you can add. However, there are a lot of PCF components that you can use for this purpose - for example, this one. Also, keep in mind that the multiline field has maximum length of 1,048,576 characters. 

 

Regarding handling content in different languages -  you will need to create and handle the logic for it by yourself. For example, adding lookup to Portal Language and then use liquid to get the portal language and fetch proper version, something like that.

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
Anonymous
Not applicable

Hi @OOlashyn 

Thanks for your response!

I went to the PCF link which you shared but I didn't get a clear idea on how to include that in form. what all are the steps that need to perform. Is there any proper blog or article on the same?

 

Thanks,

Amit

 

Hi @Anonymous

Please download zip file from below link and import that zip in Dynamics 365.

https://github.com/andz88/PCF.TinyMCE/blob/master/Release/TinyMCEComponent.zip

- Go to Settings in Dynamics 365

- Solutions

- Click on Import button and select downloaded zip file

- Publish all customization

 

Please refer below blog to add PCF control in the form. 

https://www.itaintboring.com/dynamics-crm/pcf-controls-now-i-have-my-first-pcf-control-too/

 

-----------------------------

If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

 

Anonymous
Not applicable

Hi @hardikv @OOlashyn 

Thanks for all your response!

 

I have created one custom Entity called "Custom Knowledge Article" where I have added the "Content" multiline text field, language lookup field and some other fields.

While I was going through @hardikv links, meantime I had done some research on the form which is present in Web Page Entity and found that in that form the Rich Text control is nothing but Web Resouce. So, in my main information form, I have included one Web Resource and given the exact same properties as web page form (except some).

And the Rich text is working perfectly, the data is inserting perfectly with the correct HTML script. My form is working perfectly and I included that to my model-driven app.

 

Web Resource for Content HTML in  Custom KAWeb Resource for Content HTML in Custom KA

 

The form is getting the Rich Text:

Rick Tect in KA formRick Tect in KA form

 

I added a few data to the Entity from the form:

Custom KS entity storing data correctlyCustom KS entity storing data correctly

 

But I am facing one issue when trying to read the data using Liquid code. I am not able to understand why I am not able to fetch the data. The liquid code looks perfect. Below is the code for the same for a single record present in the Entity.(just for checking purpose):

 

{% assign KAGUID = entities.cre08_customknowledgearticle['a5e838r1-d0cc-ea11-a812-016d4sb148ga'] %} // this GUID is wrong but I have used correct one while doing my fecth

    {% if KAGUID %}
    {
    "KA_ID": "{{ KAGUID.cre08_customknowledgearticleid}}",
    "KA_Number": "{{ KAGUID.cre08_kanumber}}",
    "KA_Keyword": "{{ KAGUID.cre08_keyword}}",
    "KS_Desc": "{{ KAGUID.cre08_description}}",
    "KA_Content": "{{ KAGUID.cre08_content}}",
    "KA_Createdon": "{{ KAGUID.createdon}}"

    }
    {% else %}
        
        { "success" : false }

    {% endif %}
  

 

 My web template is in application/json MIME type.

I am getting below as output:

{ "success" : false }

 I am not able to understand where I am doing mistake.

 

Could you please help me to solve the issue? Any help will be appreciable.

Thanks,

Amit

View solution in original post

Hi @Anonymous 

It seems that you have entered wrong entity name:

{% assign KAGUID = entities.cre08_customknowledgearticleid['a5e838r1-d0cc-ea11-a812-016d4sb148ga'] 

You have added cre08_customknowledgearticleid as entity name, but It look a like logical name of field. So, you should add there Logical Name of Entity.

 

It will be like this:

{% assign KAGUID = entities.cre08_customknowledgearticle['a5e838r1-d0cc-ea11-a812-016d4sb148ga'] 

 

-------------

If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

Hi @Anonymous 

 

Did you give entity permission for cre08_customknowledgearticle entity?

--------------------------
If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

Anonymous
Not applicable

Hi @hardikv 

Thanks for your response!

 

Yes, it was because of Entity permission was not given. It is resolved now. But there is some other issue for which I will create a new thread.

 

Thanks,

Amit

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,642)