Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Use of nulog

Questions related to using nuBuilder Forte.
Post Reply
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Use of nulog

Unread post 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
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Use of nulog

Unread post 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.
You do not have the required permissions to view the files attached to this post.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Use of nulog

Unread post 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.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Use of nulog

Unread post 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
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Use of nulog

Unread post 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.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Use of nulog

Unread post by yvesf »

I did the same think behind edit button instead of browse and edit button with the same result :-(
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Use of nulog

Unread post by kev1n »

Do you see any error messages in the developer console (F12) ?
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Use of nulog

Unread post 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.
Post Reply