Step-by-step parent child copying method.

HBT
Silver 4
Silver 4

Previously published copying methods:

  1. Koichi_Tsuji : Copy parent record together with child records ; Action Only, No API, No workflow 
  2. TyAlevizos    : Copy row along with children: rebirth of mothra II 
  •  Add a column to the Parent Table, example: CopyID column name
  • Step 1 :   Create an Action with (Data: add a new row to another table using values  from this row )

                    Action Name: CopyXParentTableName0001-01                      
                    For a record of this table : ParentTableName                      
                    Do this : Data: add a new row to another table using values  from this row                      
                    Table to add to : ParentTableName      
                    In the Set these columns : set the relevant columns.
                   COPYID Column: [_THISROW].[ParentID]&"-"&CONTEXT("Device") 
                                   (You can replicate this with expressions like useremail().)

                       Prominence : Do NoT Display

  • Step 2 :   Create an Action with (Data: add a new row to another table using values  from this row )

                    Action Name: CopyXParentTableName0001-02                      
                     For a record of this table : ChildTableName                      
                     Do this : Data: add a new row to another table using values  from this row                      
                     Table to add to : ChildTableName
                      In the Set these columns : set the relevant columns.
                      Prominence : Do NoT Display

  • Step 3 :   Create an Action with (Data: execute an action on a set of rows )

                    Action Name: CopyXParentTableName0001-03                      
                    For a record of this table : ParentTableName                      
                    Do this : Data: execute an action on a set of rows                      
                    Referenced Table : ChildTableName
                    Referenced Rows : SELECT(ChildTableName[ChildID],[ParentID]= LEFT(INDEX( Select(
ParentTableName[CopyID],[CopyID]=CONCATENATE([_THISROW].[ID],"-",Context("Device")) ),1),8))

                    Referenced Action : CopyXParentTableName0001-02 

                    Prominence : Do NoT Display

  • Step 4 :   Create an Action with (Data: set the values of some columns in this row  ---To avoid duplication and to keep track of which ID it was copied from.---

                    Action Name: CopyXParentTableName0001-04                    
                     For a record of this table : ParentTableName                      
                     Do this : Data: set the values of some columns in this row                     
                    Set these columns : CopyID  =INDEX(Select(ParentTableName[ParentID],[ParentID]="CpID"&LEFT([_THISROW].[CopyID],8)),1)

                     Prominence : Do NoT Display

  • Step 5 :   Create an Action with (Data: execute an action on a set of rows )

                    Action Name: CopyXParentTableName0001-05                     
                    For a record of this table : ParentTableName                      
                    Do this : Data: execute an action on a set of rows                      
                    Referenced Table : ChildTableName
                    Referenced Rows : SELECT(ParentTableName[ID],[CopyID]=CONCATENATE([_THISROW].[ID],"-",Context("Device")))

                    Referenced Action : CopyXParentTableName0001-04

                    Prominence : Do NoT Display

  • Step 6 :   Create an Action with ( App: go to another view within this app ) --- If you want to edit the Copied Recording immediately

                    Action Name: CopyXParentTableName0001-06                    
                    For a record of this table : ParentTableName                      
                    Do this : If you want to fix the Copied Recording immediately                     
                    Referenced Table : LINKTOROW(MAXROW("ParentTableName","_ROWNUMBER"),"Parent_FormName")

                    Prominence : Do NoT Display

 

  • Step 7 :   Create an Action with ( Grouped: execute a sequence of actions)

                    Action Name: CopyXParentTableName0001-00                  
                    For a record of this table : ParentTableName                      
                    Do this : Grouped: execute a sequence of actions                    
                    Action:  CopyXParentTableName0001-01 , 

                                   CopyXParentTableName0001-03 , 

                                   CopyXParentTableName0001-05 ,

                                    CopyXParentTableName0001-06

                    Prominence :  Display İnline 

                   Attach Column : CopyID

4 1 539
1 REPLY 1

Hi @HBT 

I have followed this tutorial but I am stuck on action 05. Action 05 asks you to add action 04 to the referenced action list. It doesnt show up because action 05 is in the Parent Table and so is action 04. What have I missed here?

Top Labels in this Space