Page 1 of 1
Use of nulog
Posted: Wed Dec 01, 2021 11:40 pm
by yvesf
I use this nice solution for viewing the nulog. I am trying to implement it
https://github.com/nuBuilder/nuBuilder- ... y#-example. I don't know how to create the button like described. How can I do that ?
Add a Button Object to your form with the Label ? and an onclick handler. JavaScript: showNuLogInfo('example_nulog');
The parameter should be id and not example_nulog. Kev1n could you help me to solve that. Sound really nice but I don't find how to implement it. Thx
Re: Use of nulog
Posted: Thu Dec 02, 2021 5:49 am
by kev1n
Hi,
1. On your form, click "Add Object" in the Options Menu (CTRL+SHIFT+H)
2. As a label, enter e.g. ?
3. Type in any object Id.
4. Switch to the
Custom Code Tab
sc1.jpg
5. Event: onclick
6. JS code.
sc2.jpg
7. In the Input tab, chosse button.
Re: Use of nulog
Posted: Thu Dec 02, 2021 7:47 pm
by yvesf
thanks Kev1n very helpfull. Where should I put the related code :
Code: Select all
function showNuLogInfo(id) {
var nuLog = $('#' + id).val();
var obj = JSON.parse(nuLog);
var msg = getNuLogData(obj.added, 'Added', 'User') + getNuLogData(obj.added, 'Added', 'Time');
msg += getNuLogData(obj.viewed, 'Viewed', 'User') + getNuLogData(obj.viewed, 'Viewed', 'Time');
msg += getNuLogData(obj.edited, 'Edited', 'User') + getNuLogData(obj.edited, 'Edited', 'Time');
nuMessage([msg]);
$('#nuMessageDiv').css('text-align', 'left');
}
I have put it in the custom code at the form level and nothing happens.
Re: Use of nulog
Posted: Fri Dec 03, 2021 9:55 am
by yvesf
I have put all the scripts at the same place.
Capture.PNG
And created the button as explained.
Capture1.PNG
Nothing happens. It seems that the message box isn't attached to the button. What is wrong ? Many thanks, Yves
Re: Use of nulog
Posted: Fri Dec 03, 2021 9:58 am
by kev1n
Add the function showNuLogInfo() also under Custom Code. Also make sure there's a nulog object on your form as described in the article.
I tested the code on the
test platform and it worked right away.
You can inspect the objects, code there if that helps.
Re: Use of nulog
Posted: Fri Dec 03, 2021 10:37 am
by yvesf
I did the same think behind edit button instead of browse and edit button with the same result

Re: Use of nulog
Posted: Fri Dec 03, 2021 10:40 am
by kev1n
Do you see any error messages in the developer console (F12) ?
Re: Use of nulog
Posted: Fri Dec 03, 2021 11:10 am
by yvesf
Found my mistake. I haven't created the object mapped to the nulog field. Thanks Kev1n for having put the solution online which has helped me to find the solution. Great thanks.