Jump to content

Recommended Posts

  • Newbies
Posted
Hello everyone. 
I have two related tables. One main table and another with delivery note records.

 

In the main table, I have a field where I enter the delivery note number and I receive all the records from the related table.
In the main table, I have 5 fields, and in them I want to receive the related data from the related table. 
For example: Item 1 (main table) I retrieve Item 1 data from the related table, Item 2 in main table, get the Item 2 data of the related table. 
If, for example, I have 6 records corresponding to the same delivery note, 
when I retrieve the data in the main table in the Item1 field, the data is correct, but in the Item 2 field, I receive nothing. 
I only get the first line of the related field. Can you help me retrieve the rest of the related fields?

Thanks in advance por your help.

Regards,

Javier

Posted

I don't understand your question, especially this part:

1 hour ago, abrilgustems said:

I have a field where I enter the delivery note number and I receive all the records from the related table.

It seems you have a parent-child relationship, with DeliveryNotes being the child table. In such arrangement, there should be a foreign key field in the child table holding the parent record's unique ID value. There should be no fields in the parent table that refer to the parent's children. To display the parent's children on the parent layout you would use a portal.

This is the standard practice for a parent-child relationship. If you have some sort of a special requirement that isn't covered by this then please explain in more detail. For example, if you wish to isolate a specific child record, you could click on it in the portal (thereby setting a global field or variable to its unique ID) and then use a 2nd relationship or a filtered one-row portal to display it.
 

P.S. Please use the standard font when posting.

P.P.S Please update your profile to reflect your version and OS so that we know what you can use.

  • Like 1
  • Newbies
Posted (edited)

Hi !!!

Thank you for answer.

I Tried with the portal and it works, but I need to bring the data to fields in the main table with a autoenter calculation formula.

I've created fields in the main table with the fruit size:

- Item 1

- Item 2

- Item 3

- Item 4

The tables are linked by the DELIVERYNUMBER field, so when I write de number in the main table, I recover the data of the secundary table in each field (item1, item2, item3)

In the fields (item1, ....) I created in each field an auto-enter value with a calculated value:

Item 1:    Case ( MAC AEROBOTICS VISTA::Calibre = "<65" ; MAC AEROBOTICS VISTA::Kilos; "")

Item 2:   Case ( MAC AEROBOTICS VISTA::Calibre = "66-78" ; MAC AEROBOTICS VISTA::Kilos; "")

etc...

The problem is that I can only recover the first data of the related field. In Item 2 field, I cannot recover anything.

Sorry for my english. I hope that I can explain, and once again: thank you very much for your altruist help.

Regards,
Javier

Edited by abrilgustems
Posted
1 hour ago, abrilgustems said:

I need to bring the data to fields in the main table with a autoenter calculation formula.

I am afraid I still don't see why you would need such thing so I am not sure what would be the best way to do it.

You can make a calculation refer to a child record other than the first one by using the GetNthRecord()function. But that would have to be an unstored calculation, not auto-enter. And I still don't see why it would be needed. And what will you do if there are more than 4 items?

It looks like you are trying to fix the wrong solution to a problem instead of finding the right one.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.