My current understanding of AwareIM is ... limited, but growing.
If two Business Objects have a Parent/Child relationship where the child records must have a parent, does the process of importing child records automatically create the requisite parent record?
I've been out of the computer world for 16 years. My last serious development environment (1989-2006) was Magic. In magic terms, I'm looking for "link / write" functionality.
Also, this is my first entry in this forum. If there is a better place to ask questions such as this, please let me know.
Parent Child functionality
Re: Parent Child functionality
Welcome Tom.
How are you "Importing" the child records? The child record has 3 columns that indicate: 1) Who the Parent is. 2) What is the primary key (THE ID) of the parent, and optionally the (virtual) name of the field in the parent BO that is used to access the child records. Easiest if you create a parent and child in Aware, add a couple of records in both and look at the data in SQL so you will understand what is there.
Bruce
How are you "Importing" the child records? The child record has 3 columns that indicate: 1) Who the Parent is. 2) What is the primary key (THE ID) of the parent, and optionally the (virtual) name of the field in the parent BO that is used to access the child records. Easiest if you create a parent and child in Aware, add a couple of records in both and look at the data in SQL so you will understand what is there.
Bruce
Re: Parent Child functionality
This is the place and welcome.
No.
I am not sure this will work but you might try adding a rule to the Child BO to create and Parent. The rule would look something like:
If Child IS NEW Then
CREATE Parent
INSERT Child IN Parent.ChildField
There is also an IMPORT RELATIONSHIPS action that you might want to investigate.
Bob
-
- Posts: 1356
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Parent Child functionality
There is a CREATE IF NOT FOUND flag for the IMPORT action. If you create your import file to have a relationship to the parent then it will create that record
If Mega Corp doesn't exist and you use
It should create that record. You might get duplicates if there are 17 employees that work for Mega Corp as the commit won't happen until later, in which case IN BATCHES OF will help.
Code: Select all
Employee.obCompany.Name, Employee.StaffNo, Employee.Name
"Mega Corp", 12345, "Jones, Steve"
Code: Select all
IMPORT Employee FROM 'c:/mydocuments/importfile.csv' CREATE IF NOT FOUND