app.getRecordId() not working right
There are two functions called getRecordId() in the client side code... One is in layouts/v7/resources/application.js and the other is in resources/app.js
The function in app.js is correct in that it determines if the view is Detail or Edit and returns the correct result.
In application.js however, the function is wrong. It will only work when in Detail View. But this version is being called when I use app.getRecordId() in my custom module's Edit.js class.
I suggest re-writing the function thus:
getRecordId: function () {
if(_view == "Edit"){
el = jQuery('[name="record"]')
} else if(_view == "Detail") {
el = jQuery('#recordId')
}
if (el.length) {
return el.val();
}
return false;
},