Has anyone been able to make a frappe call from the javascript section of the Custom HTML Block similar to what was demoed during Frappeverse 2023 which was used to fetch user details? i’m looking to do somethig similar but i don’t know how to achieve this and there’s no documentation on how to do this. Any help will be appreciated.
Hi @flexy2ky:
Try this:
HTML section
<p> Hola! </p>
<div id="info">
<div class="lang"></div>
<div class="elvis"></div>
</div>
Javascript section:
let info = $(root_element).find("#info");
let lang = frappe.boot.lang
info.find(".lang").text(lang)
frappe.call({
method: 'frappe.ping',
callback: function(r) {
console.log("Calling Elvis!")
info.find(".elvis").text(r.message)
}
});
Hope this helps!
3 Likes
Thank!!! this absolutely helped!