CA Service Management

 View Only
  • 1.  Add delete to custom table list

    Posted Sep 17, 2020 12:46 AM
    Hi, I've been trying to add a delete option to a custom table list on the same way it's done for cr_prptpl, so far I have been able to add the option itself on the menu and invoke a custom function which performs an ajax call with the following values

    SID=<auto-populated with cfgSID>+FID=<auto-generated with fid_generator()>+FACTORY=zmytable+WHERE_CLAUSE=id=<id from list>+OP=DELETE_RECORD_AJAX

    This returns an error with the not helpful message "ERROR", checking the schema I see cr_prptpl has a method delete_wc( object|nil, string, long ); I've added this to my custom table and get this error in sdm logs: mods\majic\wsp.mods:930 syntax error, unexpected YACC_STR at "long"

    Investigating, I found a definition for delete_wc as follows delete_wc(string, string, object|nil ) ; I've changed it for my table and sdm starts ok, but still the same error when attempting to delete from list.

    I'm guessing I need to add an specific definition of delete_wc to the methods, but I haven't found any information online, if someone knows how to do this, I'll highly appreciate the information.


  • 2.  RE: Add delete to custom table list

    Posted Sep 17, 2020 03:46 AM
    Hi Kevin.
    As you know, deleting of records, is a very specific thing, in my understanding it is an exceptional capability.
    The normal way to let records vanishing is to deactivate them.

    Without knowing the business background for this delete request and the pressure behind it, I suggest not to publish a solution if one is known.
    It will open the door to data inconsistency and chaos, as people don't be aware of what they do, sometimes....
    just my 2 cents.

    Kevin, start thinking about deactivating records. This might fulfill your requirement as well.
    And if you really have concerns regarding the number of records in your custom table, think about archiving and purge.
    kind regards.
    .....Michael


    ------------------------------
    Principal Services Consultant
    HCL Enterprise Studio
    Germany
    ------------------------------



  • 3.  RE: Add delete to custom table list

    Posted Sep 17, 2020 04:07 AM
    Hi Michael, thank you for your reply, I understand deleting records is indeed very specific, in this case this is a custom table with no relationships to any other and only managed by admins, so from our perspective there is no risk of inconsistency. Adding a field to deactivate the record is not ideal, since the table is used by third party processes and those will need to be updated to filter out the records marked inactive.

    I believe it would be interesting having the capability for those specific tables that us admins deemed necessary, it's already present for several base tables and it would be very convenient to be able to extend this functionality.