Hi,
I am trying to get a field value from Quick View form and need to set that value in a field in the main form. In the main form properties I have added this js in event library and in Event Handlers added sdk.formOnLoad to load this form onLoad.
I didnt do any event handlers in the fields where the value should set from quickview.
I am new to javascript, I am getting this error now "Web resource method does not exist: formOnLoad"
I have to mention that field types are dates.
Thanks for your help
var Sdk = window.Sdk || {};
(function () {
'use strict';
// Code to run in the form OnLoad event
this.formOnLoad = function (executionContext)
{
var formContext = executionContext.getFormContext();
formContext.getAttribute("startdate").addOnChange(getAttributeValue);
}
function getAttributeValue(executionContext){
var formContext = executionContext.getFormContext();
var quickViewControl = formContext.ui.quickForms.get("Opp_Opp_Product_QuickViewForm");
if(quickViewControl != undefined){
if(quickViewControl.isLoaded()){
var oppProdStartDate = quickViewControl.getControl("pde_start_date_dat").getAttribute().getValue();
alert(oppProdStartDate);
formContext.getControl("startdate").getAttribute().setValue(oppProdStartDate);
} else {
// Wait for some time and check again
setTimeout(getAttributeValue, 10, executionContext);
}
} else {
formContext.getAttribute("startdate").setValue("No value");
return;
}
}
}).call(Sdk);