Filtered Link field in Webform

HI all,
I have created a custom web form for student applicant. I have added program field there.
Also my program doctype is website generator. It has a ‘show in website’ field.
My aim is to show only programs which has show in website =1 value.

I have written code in registration.js webform file and is shown below:

frappe.ui.form.on("Registration", "onload", function(frm) {
    cur_frm.set_query("program", function() {
        return {
            "filters": {
               "show_in_website": 1
            }
        };
    });
});

Can anyone help me to solve this issue?
Thank you

1 Like

Up ^
any one can help

using v11 frappe new api for forms
https://frappe.io/docs/user/en/guides/portal-development/web-forms
on after load call manually made api to get data with your custom logic or condtions
and put the result by set value to option of link
all credits to my friend @Ahmad_ZaQout

Would you have example of how you acheived this? It will help me to do the same thing. Thank you in advance.