Question
· Jun 12, 2017

Populate not working for relationship

Here's my issue. I've been using Sample.* globals and packages mapped to another development namespace to realize unit tests. So when I ran it, I notice that I forgot to start a transaction in order to be able rollback it to it's original data.

I assumed that I should use transactions since I was manipulating it's data but I didn't want it to be persisted.

Now I've lost all their default data. That's ok, or so I though... since I supposedly should run %Populate on the Sample.Company to have all data back (their integrity regarding the lost ones isn't relevant). However I notice that even though I could populate data back to Sample.Company, Sample.Employee wasn't being populated.

I even tried deleting all the data from all relevant classes using %DeleteExtent and tried repopulating it, but without success. And according to the documentation, the class Sample.Employee should be populate automatically and used as relationship for Sample.Company, that's if the Populate method from Sample.Company is called.

EDIT: Yikes! It seems it's a by-design decision. Which means that I would need to populate data manually. Hooking the populate utility to OnPopulate or manually opening the parent object and associating it's related children.

 

Discussion (1)1
Log in or sign up to continue