DictTable.Deleteactiontype(Int32) Method

Definition

Retrieves the type of a delete action for a table.

public:
 virtual int Deleteactiontype(int cnt);
public virtual int Deleteactiontype (int cnt);
abstract member Deleteactiontype : int -> int
override this.Deleteactiontype : int -> int
Public Overridable Function Deleteactiontype (cnt As Integer) As Integer

Parameters

cnt
Int32

The one-based index to the list of the delete actions for the table. The list is in AOT order.

Returns

An integer that represents the type of the delete action of the table that is specified by the cnt parameter. It can be one of the values in the following table.

0 None
1 Cascade
2 Restricted
3 Cascade + Restricted

Remarks

The following example shows the retrieval of the type of delete actions for a table.

DictTable dt, dt2; 
str       strDelActType; 
int       i, nDelActType; 
dt = new DictTable(tablenum(CustTable)); 
if (dt) 
{ 
    for (i=1; i <= dt.deleteActionCnt(); i++) 
    { 
        dt2 = new DictTable(dt.deleteActionTableId(i)); 
        if (dt2) 
        { 
            nDelActType = dt.deleteActionType(i); 
            switch (nDelActType) 
            { 
               case 0: 
                strDelActType = "None"; 
                break; 
               case 1: 
                strDelActType = "Cascade"; 
                break; 
               case 2: 
                strDelActType = "Restricted"; 
                break; 
               case 3: 
                strDelActType = "Cascade + Restricted"; 
                break; 
            } 
            print strfmt("Delete action table: %1 Type: %2", 
                         dt2.name(), 
                         strDelActType); 
        } 
    } 
}

Applies to