I have added button on every field with this code in forms custom code (below). I want this button to open a new launch form where there will be all the fields displayed I need from a SQL query with ID passed as WHERE clause.
as I understand, I need to create global hashcookie somehow.
I have set this code to open form ID 6448cef8823183b but it says access is denied, even tho I have turned on every access group there is for this detailed_search form.
Every bit of help will be appreciated as this is the last step to complete this project.
Code: Select all
// No action when clicking a cell
function nuSelectBrowse(e) {
return false;
}
function createButton(target, pk, label, title, openAction) {
let btn = $('<button type="submit" style="height:21px; border: none; vertical-align: top; background-color: #378bd5; transform: translateY(-10%); color:white">'+ label +'</button>');
$(target).html(btn).attr('title', nuTranslate(title));
btn.on('click', function() {
openAction(pk);
});
}
function addButons(column, label, title, openAction) {
$("[data-nu-column='" + column + "']").each(function(index) {
var pk = $(this).attr('data-nu-primary-key');
if (typeof pk !== "undefined") {
createButton(this, pk, label, title, openAction);
}
})
}
function openBrowseForm(pk) {
nuForm('6448cef8823183b', '', '', '', '2'); // Filter the Browse form with the pk
}
// Add an edit and browse button
// Icon list: https://fontawesome.com/v5/search?m=free
addButons(0, '<i class="fas fa-search-plus"></i>', 'სრული დეტალების გახსნა', openBrowseForm);