Block - Sync the module type item in table with refer module

Scenario:
Here got an assumption:
We have a module call Object2.
And we have also a module call Object1, and the module inside got an table information call TableA.
Inside TableA has a module type information call Object2 and display as info: DocText in table, it’s refer an information in module: Object2.

Module: Object2
image
1st img


Module: Object1


2nd img

*As you can see, the display info: DocText of Object2 in TableA is different with Object2 in 1st img.
It’s happening when the refer module got adjust. The entries: BJC00009 & BJC00010 got adjusted the info: DocText to be other value.

Changing log:
BJC00009:

  • DocText: “BMWK XD” => “DOC TX1”

BJC00010:

  • DocText: “BMWK Test” => “DOC 123”

But the Object2 in Object1’s TableA didn’t change in immediately. So we need an activity to do the value updating in table.


Step:

  1. Let’s go to the studio side. In Activity, create a new activity call “Sync Object2 in table”.
    image
    3rd img

  2. Click “+” to create a form design.


    4th img

  3. Drag the table information: TableA in form


    5th img

  4. Enable Automation
    image
    6th img

  5. In automation, drag a tool: Condition

  • Key in the code:
    #Form#TableA.Count > 0
    image
    7th img
  1. Drag one more tool: For
  • Key in the code:
    #Form#TableA
  • In below the each, rename the looping value name as: item
    image
    8th img
  1. Drag one more tool: Actions
    image
    9th img

  2. Click “+ Add Action”, select Find
    Then click OK


    10th img

    In Module, select Object2
    Set a variable name for this find out object: Object2 Found
    In Filter, add a new condition. Select Formula, set: ID is #item#Object#Document ID
    Then click OK

    11st img

  3. Click “+ Add Action” again, select Set
    Then click OK


    12nd img

    In Variable, select item
    In Value, click Expand Property.
    Click + Add Value, select column field Object2 in TableA under the form (refer 8th img in 6.)
    In type formula here. # for hints, key in #Object2 Found (refer 11st img in 8.)
    Then click OK

    13rd img

  4. Click ✓ SAVE


    14th img

  5. Go to app side, lets try the result of it. #if not working please try to refresh then try again
    If the value is correct, may click ✓ OK to submit the changing


    15th img