Database sqlite, Jam.py Version 7
I am trying to set the Financial Year Start and End Dates automatically when a new FY is created.
On a working v5 project, in the Client Module I could set a "Read Only" field through the code. However i am not able to do that in v7. (The same code doesn't work in the new v7 project)
In the code, financial_year ,
start_date and
end_date are Read Only fields.
function on_edit_form_created(item) {
var curr_yr = new Date().getFullYear();
var nxt_yr = curr_yr+1;
item.financial_year.value = curr_yr.toString() + "-" + nxt_yr.toString();
item.start_date.value = new Date(curr_yr, 3,1);
item.end_date.value = new Date(nxt_yr, 2, 31, 23,59,59);
}
This worked fine on v5 and I could set the fields which were set as Read Only while the Item Field was created in the builder. On v7 the fields don't get committed/saved.
Am I missing something?