Page 1 of 1
Migration issues - Pro to Forte
Posted: Thu Mar 04, 2021 12:10 pm
by vario
Two questions to begin:
1) I would like to customise subform WHERE clause so only records matching a date range are retrieved (rather than everything matching the PK). In Pro the SQL is on the Subform tab, but can't find it in Forte.
2) In Pro I used nuLoadEdit() to position the cursor at the first empty row (new record) of the subform. How do I do this in Forte?
Neil.
Re: Migration issues - Pro to Forte
Posted: Thu Mar 04, 2021 1:36 pm
by kev1n
Hi,
1) Click the 3 dots, then Form Properties and modify the SQL in the Tab Browse
form_properties.png
2) JavaScript under the Custom Code Tab of your Form:
Code: Select all
if(nuFormType() == 'edit'){
// Your code here...
}
Re: Migration issues - Pro to Forte
Posted: Thu Mar 04, 2021 2:08 pm
by kev1n
vario wrote: to position the cursor at the first empty row (new record) of the subform. How do I do this in Forte?
Code: Select all
function setSubformCellFocus(subform, id, row) {
if (row === undefined) {
var r = nuSubformObject(subform).rows.length - 1;
} else {
var r = row;
}
$('#' + subform + nuPad3(r) + id).focus();
}
if(nuFormType() == 'edit'){
// Replace accform with the Subform ID and slf_zzzzsys_form_idcode with the Object Id
setSubformCellFocus('accform', 'slf_zzzzsys_form_idcode');
}
Re: Migration issues - Pro to Forte
Posted: Thu Mar 04, 2021 2:14 pm
by vario
Thanks for the reply.
One problem - there is no Browse tab on the subform. I have directly modified sfo_browse_sql in zzzzsys_form which so far seems to work but a user-friendly way would be good!
Re: Migration issues - Pro to Forte
Posted: Thu Mar 04, 2021 2:23 pm
by kev1n
It shouldn't be like that, it's a bug.
The workaround is to set the form type to "Edit". Then the Browse Tab becomes visible and the SQL can be edited. Afterwards, the Form Type can be changed back to Subform.
Re: Migration issues - Pro to Forte
Posted: Fri Mar 05, 2021 9:00 am
by kev1n
That fix is now on Github.