0

Unlink composition records

Would love if there was a way to unlink composition records without deleting the entire thing or changing the table to not be a composition just to unlink. 

5 replies

null
    • Jorg
    • 5 yrs ago
    • Official response
    • Reported - view

    Hi Sarah, 

    in the subtable you can use a button with the following formula:

     

    'myMaintable reference field'  := 0

     

    Kind regards, Jörg

    • SECOS Group
    • quartz_cap
    • 5 yrs ago
    • Reported - view

    Hi Jörg

     

    Thanks for the reply

     

    Would still like to see something integrated as part of the system so I don't need to add another button to composition tables for the occasional error. 

    • UKenGB
    • 2 yrs ago
    • Reported - view

    I agree something needs to be incorporated to allow unlinking from the parent. Adding a button is not really an acceptable solution as when viewing the child/subtable from a parent, that parent's link field is hidden, but any button for use to cut the link would still be visible, even though the field on which it is supposed to operate (i.e. set to 0 as above) is not actually visible.

     

    It might be ok if we could determine the context (i.e. current table) and then hide the 'cutlink' button, but not currently possible to do that.

    • John_Halls
    • 2 yrs ago
    • Reported - view

    Once unlinked with a button, how are you going to re-assign a parent to this record?

    The behaviour of Composition, when set to Yes, is designed as such for a well-established reason. Either composition is No and a child record can exist without a parent, or it's Yes, and a child record should never exist without a parent (or it becomes an orphan and the integrity of the database can become compromised). There is no halfway house.

      • UKenGB
      • 1 yr ago
      • Reported - view

      Coming back to this as I still find it a PIA when I have inadvertently created the wrong link and I simply need to delete the link (i.e. set its ref field to 0) and link to another record.

      The 'Composition' setting does not prevent a child record being created without a parent. What it does do is ensure children are deleted with the parent. This is a handy feature, but sometimes it is needed to link a child to a different parent. In that case there is no requirement to create an orphan first. One just needs to be able to bring up the list of other parents and select a new one. So exactly the same operation as when first selecting a parent, but having done that, the interface does not allow selecting a different parent which can be a valid requirement.

      I am quite capable of mistakenly linking to the wrong parent, but there are also times when I simply need to change parent. In the case of a 'Company' and 'Employee' relationship, it is quite possible for an Employee to switch jobs, to a different Company. Currently you have to DELETE the Employee record and create a new one linked to the new Company, or, temporarily turn 'Composition' OFF, make the change then set it back on again and changing the database structure to accommodate basic data changes is bad practice. It should be possible to simply select a different parent.

      I realise in the above scenario, it may be desirable to create a new Employee record at the new Company, but that does not affect the requirement in many database schema to be able to select a different parent even when 'Composition' is on. There is NO valid reason why this should not be allowed and indeed the database can easily handle it. It is only the Ninox interface that prevents this and it is an undesirable restriction. Changing the parent does NOT affect the integrity of the database and should be allowed.

Content aside

  • 1 yr agoLast active
  • 5Replies
  • 1389Views
  • 2 Following