Adding fields to Page

Created a new page use the Page - API. Trying to add a link field to the page. Used page.add_field() but that adds the field like a filter.

How can I add it like in the form view or like in dialog view?

Hey @rtdany10 I am facing the same issue. How did you manage to solve it? :slight_smile:

@rtdany10 The add_field function accepts a field data object and a parent DOM object to add the field inside. If the parent DOM is not provided, then the default page form is used instead…

You can do something like the following…

new frappe.ui.Page({
    title: '',
    make_page: function() {
        let form = $('<form>');
        this.body.append(form);
        this.add_field({
            ....
        }, form)
    }
});

Best regards…