Announcements
Greetings !
Background: I am working on D365 Marketing form that would be hosted in an external website. My customers' website has their pages displayed in native languages based on Country.
Requirement: I need to create the marketing form in the below 4 languages
website.com/en-IN
website.com/fr-FR
website.com/de-DE
website.com/ar-AE
Do I have to create the D365 Marketing form from the scratch 4 times or is there a easier way to replicate my form 4 times and then change the labels of each of the D365 Marketing form in the respective language?
In my form, I have two options sets that are dependent on each other and have about 130 combinations and this is the primary reason why I would like to avoid manually creating the same form 4 times.
What is the best approach to achieve this?
Thanks,
Shyam
Hi Shyam,
It is very glad that my answer could help you.
Regards,
Clofly
Hi Clofly,
I was able to create the template, configure the dependent option sets and have them replicated on multiple forms.
Thank you for the idea.
Regards,
Shyam
Hi Clofly,
This is an excellent idea, I'll try this over the weekend and let you know.
Thanks
Shyam
Hi Shyam,
Thanks for sharing this new feature, actually I have never experienced it.
I created two option set fields and follow steps from your guidance, now I reproduced your issue.
As a solution, we could set association in form template, then the association will be reusable for all new form records.
(My testing two option set fields are: Continent and Country)
The parent node will be set by default.
Regards,
Clofly
Hi Clofly,
I have used the out of box feature to associate the two option sets, there is no issue in performance at run time. The issue is only during the design time while associating the two option sets.
I am not familiar with coding/JS so I try to use the out of box features wherever possible.
Following are the steps used for associating the option sets
1) Select the Child Optionset and from properties choose Filter by option to select the parent Optionset. Then Click on the Set up relationship button
2) I have associated "Internet" and "Radio" to its associated child optionsets
3) Once you execute the form you could see the optionsets behave as per our association.
4) Parent Option Set Radio was associated to Radio Station, so we see only that option
5) Parent Optionset "Internet" was associated with the below 3 Child Optionsets, so we see only those options listed
Regards,
Shyam
Hi Shyam,
Could you share me how did you add those two associated option sets?
It the performance is slow, you could switch to JavaScript.
Regards,
Clofly
Hi Clofly,
I tried this and was able to replicate my forms, but the association established between two option sets I have (category - 7 values) and (sub-category 131 values) is not established after creating copies using template.
The association between Category option set and Sub-Category option set took quiet a lot of time and it was pretty slow. is there a way to have the relation between Category, Sub-Category carry forward from one form to another when it is copied?
Like instead of seeing only the related subcategory, I get to see the complete list of 131 values in the new form. any way to avoid manually associating these categories over and again for each form?
Thanks,
Shyam
Hi Shyam,
You could copy HTML source code of the first form, then save it as a form template.
After saved the template, active it.
Now we can re-use the form and change labels of each form to different languages.
(There is a "Language" field, but it is only used to help users to filter the template gallery based on this value to make it easier to find the right template.)
Regards,
Clofly
Hi Clofly,
How do we make copy of a form? I don't see an option in my system.
This is how my menu looks when I select a form in Marketing form view
This is how my menu looks like when I open a form
In both the cases I do not see a "Save As" button
Thanks,
Shyam
Hi Shyam,
You could create 3 copies of the first marketing form, then change fields label to corresponding language for each form.
e.g:
By default, there are already 3 form fields: First Name, Last Name and E-mail.
In second form, we can just change their label to different language.
Live result
1 English
2 French
Another solution is to translate label text by javascript.
In marketing form, field label is rendered in Label tag, so our javascript function process is below:
1. Fire our custom function after form is loaded. (Check how to use Marketing form API here.)
2. Detect browser language of user by navigator.language function.(This table listed all possible return result in its Code column.)
3. Create multiple arrays to save translation text, each array is for one language.
4. Change label text to corresponding language by switch statement.
You could add code(jQury version) below to your marketing page to test whether it could work for you.(Change your browser language to French to test.)
MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function (event) { // detect browser language var currentLanguage = navigator.language.toLowerCase(); // Create an array to save translation text, each array is for one language var frTranslation = ['Prénom', 'Nom de famille', 'Courriel']; /** * add other translation text * var deTranslation = ['', '', '']; .... */ // Field label is rendered in Label element. var totalLabel = $('label').length; switch (currentLanguage) { case 'fr': case 'fr-fr': case 'fr-ca': for (var i = 0; i < totalLabel; i ) { $('label').eq(i).text(frTranslation[i]); } break; case 'de': case 'de-de': case 'de-ch': break; default: break; } });
Regards,
Clofly
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator