Home

Use Cases

Training

Release Notes

Delete DB records including linked records via ProCode

Delete DB records including linked records via ProCode

  • Description
  • Example Use Case:
  • How to use it

Description

In this How-To we would like to explain how you can develop an individual function using ProCode to delete an entry including all connected subentries together.

Example Use Case:

Given the following data structure:

  • Offer 4711
    • Position A
      • Property 1
      • Property 2
    • Position B
      • Property 3
      • Property 4

Now I want to delete the Position A from the offer including the connections from A to the properties 1 and 2

How to use it

  1. Choose root entry to delete
    1. Could be done via a panel header function in a grid
      1. Create a typescript function to get the selected entry
      2. Include this function as a menu action in grid
    2. Other way via a function in a detail screen
      1. Also create a typescript function to get the chosen entry
      2. Include this function e.g. in the ribbon of a detail screen
  2. Include an ABL Business task into a TS function
    1. Here will be described the general approach how to include an ABL Business Task into a TS function. For that you can use the code snippets provided by Build.One: b1-CallBackendAsync or b1-CallBackendSync)
      1. Here is an detailed example, where the ABL BusinessTask ProcessCustomParameterBT is called in a TS function. You can adapt these for the deleting approach
      2. And afterwards there are the code examples for the ABL Business task. Also here you can use the Build.One code snippets b1-LogicClass and b1-LogicParameter
        1. ProcessCustomParameterBT.cls
        2. ProcessCustomParameterParameter.cls
    2. The actual logic of deleting the entries must be implemented by you, follow these high-level steps:
      1. Find out or know all the tables which are connected to the entry you want to delete
      2. Know the key fields, how the different tables are connected
      3. Prepare a delete statement in ABL, which deletes the current entry and all connected ones
      4. Optional: Send message to frontend

Back to DocumentationDocumentation

Back to Home Page