Detach, Orphans...

Posted by Rollbase User on 06-Dec-2011 12:29

Why does Rollbase not show the "Detach" link on a Related Records List when Orphan Control is enabled for the Relationship? Also, why does Rollbase allow records to be orphaned by removing Lookup links? It seems to me the two situations above create an inconsistency... although, of course, I do not pretend to fully understand what you guys had/have in mind. That is, if Detach is not available because it would/could create orphans... then it seems like we would also not be able to "detach" by removing Lookup links. Also, what, if anything, does the "Dependent" property, related to the an Object, have to do with any of this? When I have set that property, in the past, I couldn't see any difference, at all, in the behavior of the app.

All Replies

Posted by Admin on 06-Dec-2011 12:52

"Dependent" object does not have own menu to list and manage records.

Posted by Admin on 06-Dec-2011 12:57

What does setting the "Dependent" property on an Object do? It doesn't seem to do anything, doesn't cause any sort of different behavior, when I set it.

Posted by Admin on 06-Dec-2011 13:06

Why does Rollbase not show the "Detach" link on a Related Records List when Orphan Control is enabled for the Relationship? What is/was the thinking behind this or was/is this a bug?

Posted by Admin on 06-Dec-2011 13:07

Also, why does Rollbase allow records to be orphaned by removing Lookup links? What is/was the thinking behind this or was/is this a bug?

Posted by Admin on 06-Dec-2011 17:30

Hi Mike,



Dependent property means the record cannot exist on its own and must be attached to a related record.



"Detach" link is not shown on a relationship with orphan control because if it was allowed, you would then get an orphan record each time "detach" is used. If you want this feature you need to disable orphan deletion control (i.e. enable orphans)



Regarding manual removal of records from lookup fields, customers have wanted a way to bypass this and this has been the safest way.



Hope this helps

Matt

Posted by Admin on 06-Dec-2011 18:28

Hi,



You can alternatively just remove the lookup fields in your New and Edit pages from your parent object. Thus the only way to attach is via the child object. I believe the intention here is to give the users the option to detach the records but since its just a field as well you can take it out from the page layout ^_^



For the page layout of the child object where the parent lookup is prevalent, make this field required to handle record orphaning. Since the field is required you won't have orphaned records on your child object since the users need to supply a value for every create.



Alternatively, you can add a trigger on the child object to handle the deletion of the said data. I use the Object Script trigger type and set it's timing to After Update then use the On Field Change dropdown to select your parent lookup field. In the formula body add logic to check if the said field is blank then use the rbv_api.deleteRecord('Your object's name', '{!id}') call.



This will delete all orphaned records

Posted by Admin on 07-Dec-2011 06:46

Thanks for all the replies. I "get" the work-arounds... just trying to understand how Rollbase "thinks," so as to not work around/against.



I still don't know what the Dependent property does. I understand what it "means," I just don't see any changes in behavior baseed on it being set... or not.

Posted by Admin on 07-Dec-2011 10:33

I think one of the changes I noticed could probably be the disappearance of the Attach Link from list views if an object is dependent.

This thread is closed