Fetching a URL from a custom field to integrate into HTML embed

Hi all,
Hope you are doing well
I’m encountering a bit of an issue - I want to be able to integrate a Vimeo embed for every doc in the Project Doctype .
I’ve got some custom embed dimensions and I want my users to have a single point of contact with vimeo links.

ERPNext: v13.30.0
Frappe Framework: v13.29.1

I have a custom field vimeo_url in which my users paste their Vimeo URL.
I need to be able to integrate it into my HTML custom field vimeo_embed

I have gathered from this thread that I needed to write a custom client script that would combine the HTML and the custom vimeo_url contents into the correct format for my embed.

I’ve set the autofill in vimeo_embed to vimeo_embed
And this is the script that I plagiarised from the previously stated issue.
It’s not working, would anyone have some time to help me out on this ? I’m sure it’s elementary once answered but I’m a quite new to JS. ^^

Have a nice day either way !

frappe.ui.form.on(‘Project’, {
refresh(frm) {
cur_frm.add_fetch(‘vimeo_link’, ‘vimeo_embed’);
var vimeo_link = frm.get_field(‘vimeo_link’);
vimeo_link.set_value(frm.doc.vimeo_link);
var vimeo_embed = frm.get_field(‘vimeo_embed’);
vimeo_embed.set_value(frm.doc.vimeo_embed);
},
vimeo_embed: function(frm) {
var vimeo_link = frm.get_field(‘vimeo_link’);
var vimeo_embed;
vimeo_embed = ‘’;
vimeo_embed.set_value(frm.doc.vimeo_embed);
}
});

Hi,

long time ago…
did you ever get this up and running? I also need something like that.

br
Andreas

Hi:

Try this:
frm.set_df_property(“your_html_field”, “options”, html_content)

Hope this helps.