Accessing Fields on QuickView Form through javaScript

QuickView form is template to view information about related entity record within a form for another entity record.

Sometimes you need to access data from QuickView form for performing business logic.

In order to get QuickView form in js you can use following syntax : 

Syntax : 
formContext.ui.quickForms.get(arg);

Following is the example how you can access field from QuickView Form : 

 getAttributeValueFromQuickViewForm: function(executionContext) {
    var formContext = executionContext.getFormContext();
    var quickViewControl = formContext.ui.quickForms.get("quickFormName");
    if (quickViewControl != undefined) {
        if (quickViewControl.isLoaded()) { //not necessary to use this condition
            quickViewControl.getControl("new_name").getAttribute().setValue("Abhishek Dhandare");
            //to get value used below syntax
            quickViewControl.getControl("new_type").getAttribute().getValue();

            //perform your logic here to set or access data from QuickView form
            return;
        } else {
            //in case quickView Form is not loaded call function again
            setTimeout(getAttributeValueFromQuickViewForm, 1000, executionContext);
        }
    } else {
        console.log("No Data to display in quick view control");
        return;
    }
}

Comments

Popular posts from this blog

ADF - (Part 2) Integrate Data From CRM to External system

ADF - (Part3) Integrate Data From CRM to External system Using Stored procedure