Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Which object to represent historical data ?
-
- 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 ?
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
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
-
- nuBuilder Team
- Posts: 4296
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
-
- 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 ?
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.
-
- 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 ?
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 !!!
-
- 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 ?
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.
-
- 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 ?
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
https://www.youtube.com/watch?v=Inr_HQyfE_Q
nuBuilderForte .... BIG Like !!!
-
- nuBuilder Team
- Posts: 4296
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Which object to represent historical data ?
Use the function nuIsIframe() to detect if the form is within an iframe.
-
- 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 ?
nuIsIframe() is not documented . Could you please provide me an example on how to use and where ?
Many thanks,
Yves
Many thanks,
Yves
-
- nuBuilder Team
- Posts: 4296
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Which object to represent historical data ?
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.
Usage: Code in the form's (iFrame) custom code:
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;
}
Code: Select all
if (nuIsIframe()) {
// code here...
}
-
- 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 ?
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
Many thanks for your reply,
Yves
Last edited by yvesf on Thu Jan 05, 2023 12:14 pm, edited 1 time in total.