Page 1 of 1

On Edit Form Load

Posted: 13 Aug 2019
by Office365Guy
We have added columns to a 'ProjectNumber' CSL. We then use the extra columns when a different field changes. This works fine if we select a 'ProjectNumber' then change the second field. It fails when we have saved the form, opened in edit, then change the second field before we change the 'ProjectNumber' CSL. If we then change the 'ProjectNumber' CSL and then the second field it works again. It's like the extra columns are not available when the form opens.

Please help.

Re: On Edit Form Load

Posted: 14 Aug 2019
by mnikitina
Hello Office365Guy,

Could you please provide the code and settings you are using in the form to troubleshoot the issue.

Some screenshots would be helpful also.

Thank you!

Re: On Edit Form Load

Posted: 19 Aug 2019
by Office365Guy
If we select a value with the ProjectNum CSL before change the ReportTo CSL, these work, if we just open the edit form and change the ReportTo CSL, these fail?

fd.field('SiteName').value(fd.field('ProjectNum').control('data').PLProjSiteName.Title);
fd.field('SiteAdd1').value(fd.field('ProjectNum').control('data')['PLSiteAdd1']);
fd.field('SiteAdd2').value(fd.field('ProjectNum').control('data')['PLSiteAdd2']);
fd.field('SiteCity').value(fd.field('ProjectNum').control('data')['PLSiteCity']);
fd.field('SiteState').value(fd.field('ProjectNum').control('data')['PLSiteState']);
fd.field('SiteZip').value(fd.field('ProjectNum').control('data')['PLSiteZip']);

fd.field('ReportTo').change(function(){
siteUpdate();
});

function siteUpdate() {
if (fd.field('ReportTo').value() == JobRT) {
fd.field('SiteName').readonly(false);
fd.field('SiteAdd1').readonly(false);
fd.field('SiteAdd2').readonly(false);
fd.field('SiteCity').readonly(false);
fd.field('SiteState').readonly(false);
fd.field('SiteZip').readonly(false);
fd.field('SiteName').value(fd.field('ProjectNum').control('data').PLProjSiteName.Title);
fd.field('SiteAdd1').value(fd.field('ProjectNum').control('data')['PLSiteAdd1']);
fd.field('SiteAdd2').value(fd.field('ProjectNum').control('data')['PLSiteAdd2']);
fd.field('SiteCity').value(fd.field('ProjectNum').control('data')['PLSiteCity']);
fd.field('SiteState').value(fd.field('ProjectNum').control('data')['PLSiteState']);
fd.field('SiteZip').value(fd.field('ProjectNum').control('data')['PLSiteZip']);
fd.field('SiteName').readonly(true);
fd.field('SiteAdd1').readonly(true);
fd.field('SiteAdd2').readonly(true);
fd.field('SiteCity').readonly(true);
fd.field('SiteState').readonly(true);
fd.field('SiteZip').readonly(true);
}
if (fd.field('ReportTo').value() == ShopRT) {
fd.field('SiteName').readonly(false);
fd.field('SiteAdd1').readonly(false);
fd.field('SiteAdd2').readonly(false);
fd.field('SiteCity').readonly(false);
fd.field('SiteState').readonly(false);
fd.field('SiteZip').readonly(false);
fd.field('SiteName').value("H&R Mechanical Contractors, Inc.");
fd.field('SiteAdd1').value("106 Demand Court");
fd.field('SiteAdd2').value("");
fd.field('SiteCity').value("Georgetown");
fd.field('SiteState').value("KY");
fd.field('SiteZip').value("40324");
fd.field('SiteName').readonly(true);
fd.field('SiteAdd1').readonly(true);
fd.field('SiteAdd2').readonly(true);
fd.field('SiteCity').readonly(true);
fd.field('SiteState').readonly(true);
fd.field('SiteZip').readonly(true);
}
if (fd.field('ReportTo').value() == OtherRT) {
fd.field('SiteName').readonly(false);
fd.field('SiteAdd1').readonly(false);
fd.field('SiteAdd2').readonly(false);
fd.field('SiteCity').readonly(false);
fd.field('SiteState').readonly(false);
fd.field('SiteZip').readonly(false);
}
}

Re: On Edit Form Load

Posted: 21 Aug 2019
by mnikitina
Office365Guy,

Thank you for the code.

Could you please clarify a few points for me:
- Are ProjectNum and ReportTo lookup fields?
- Are they connected cascading?
- How does it fail? Are field values not changes on ReportTo field change?

Could you please attach some screenshots for clarity.