Welcome to the nuBuilder Forums!

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

Which object to represent historical data ?

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

Which object to represent historical data ?

Unread post by yvesf »

Hello,


I have an application with 2 forms : invoice and customer.
When I create my invoice I have a lookup field customer in which I retrieve the name, address, email. I would be interested to retrieve, at the moment I choose the customer on the edit form the list of all previous invoices for this customer. Is it possible to do that and how can you do that ? Display object is able to present only 1 record not all historical invoices for this customer.
If someone could help here. Many thx,

Yves
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Which object to represent historical data ?

Unread post by kev1n »

Use a Run object (iFrame)
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Which object to represent historical data ?

Unread post by yvesf »

How can I disable the add button in the related iFrame ? If I use iFrame to view the historical data, I need to be able to remove the button that allows me to change the historical data. I have tried nuHideHolders(0,1) which is working everywhere and therefore I cannot even add a new record.
gerese
Posts: 132
Joined: Sun Dec 16, 2018 6:13 pm
Location: România
Has thanked: 30 times
Been thanked: 4 times

Re: Which object to represent historical data ?

Unread post by gerese »

Try this in JS for different situations:

Code: Select all

$('.nuActionButton').hide();
$('#nuSearchField').hide();
$('#nuActionHolder').hide();  
$('#nuBreadcrumbHolder').hide(); 
$('#nuTabHolder').hide(); 

$('#nuBrowseFooter').hide();

$('#nuAddButton').remove();
$('#nuSearchButton').remove();
$('#nuPrintButton').remove();
nuBuilderForte .... BIG Like !!!
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Which object to represent historical data ?

Unread post by yvesf »

Thanks, it helps except the fact that if I hide for example the add button, I can't do that from the iframe but also everywhere. The browse form behavior is defined once for the form and hiding elements in a form will impact everywhere where this form is used. Consequently, I will not able to add new records for this form.
gerese
Posts: 132
Joined: Sun Dec 16, 2018 6:13 pm
Location: România
Has thanked: 30 times
Been thanked: 4 times

Re: Which object to represent historical data ?

Unread post by gerese »

In the IFrame you have a form whose buttons can be hidden from the editform separately from the main form, maybe this video can help you
https://www.youtube.com/watch?v=Inr_HQyfE_Q
nuBuilderForte .... BIG Like !!!
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Which object to represent historical data ?

Unread post by kev1n »

Use the function nuIsIframe() to detect if the form is within an iframe.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Which object to represent historical data ?

Unread post by yvesf »

nuIsIframe() is not documented . Could you please provide me an example on how to use and where ?
Many thanks,

Yves
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Which object to represent historical data ?

Unread post by kev1n »

Looking at the source code, it returns a boolean (true, false).

Long explanation, for those who want to learn more:

This function checks whether the current window is an iframe or not. It does this by checking if the parent window has a different nuDocumentID than the current window, and if the parent window has a defined nuDocumentID value.

If the parent window has a different nuDocumentID value and it is defined, then the current window must be an iframe. In this case, the function will return true. Otherwise, if the parent window's nuDocumentID is the same as the current window's nuDocumentID or if the parent window's nuDocumentID is not defined, then the current window is not an iframe and the function will return false.

The parent.window object refers to the parent window of the current window, and window refers to the current window. nuDocumentID is a variable that is used to store a unique identifier for the document.

Code: Select all

function nuIsIframe() {

	return parent.window.nuDocumentID != window.nuDocumentID && parent.window.nuDocumentID !== undefined;

}
Usage: Code in the form's (iFrame) custom code:

Code: Select all

if (nuIsIframe()) {
 // code here...
}
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Which object to represent historical data ?

Unread post by yvesf »

Thanks for this explanation. My browse form appears in 2 iFrame only : in first one I need the buttons to add, in the historical one I need to avoid any interaction with the list. I have also to disable the double click to open a record. How can I do that ? how can I identify the parent form of an iFrame ?
Many thanks for your reply,

Yves
Last edited by yvesf on Thu Jan 05, 2023 12:14 pm, edited 1 time in total.
Post Reply