Uniface User Forum

 View Only
  • 1.  Restricted delete constraints

    PARTNER
    Posted 04-25-2022 09:03
    Does anyone have an intelligent/sneaky way of telling at run time whether the relationship to an inner entity is cascade or restricted delete? 
    I'd like to write a script which loops the inner entities and tests for any linked entries, before trying to do a remocc. However, some of them will be cascade delete, and some restricted. It should only try the remocc if there are no restricted items, but should cheerfully cascade the cascade items. 

    I have a manually maintained filter at the moment, but having missed an entity or two, it's putting '0139' errors in the log files. It should simply not be deleting the item. 
    I suppose, thinking about it, I could trap the 0139 error and ignore it, but it will still be trying to execute the remocc ad I'd prefer if it didn't. 

    Regards, 
    Iain

    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------


  • 2.  RE: Restricted delete constraints

    Posted 04-25-2022 11:09
    Edited by Gianni Sandigliano 04-25-2022 12:32

    Hi Iain,

    the best way I know is to maintain a (reduced) version of your application model sources available at runtime, and build over it to support your needs.

    Probably something could also be done on the "analyze schema" output saved as "runtime repository" or during components compilation entities relationships are read and saved but, without knowing officially the structure of those objects, RocketUniface Labs should help you about it.

    I agree about trapping errors at runtime is definitively too late, as you already focused in your initial post.

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------