ModifyDataDefinition
This function is used to modify the existing dataclass.
Public Function ModifyDataDefinition(ByVal DataDefId As Long,ByVal DataDefName As String, ByVal DataDefComment As String, ByRef Unused As String, ByVal FieldCount As Long, ByRef FieldList() As Byte) As Long
Parameters
In/out |
Name |
Data type |
Description |
In |
DataDefld |
Long |
Index of dataclass which is being modified |
In |
DataDefName |
String |
Name of the dataclass |
In |
DataDefComment |
String |
Comment of the dataclass |
In/Out |
Unused |
String |
Useful info In case of action dataclass |
In |
FieldCount |
Long |
No of fields of dataclass |
In/Out |
FieldList |
Byte[TagDataDefField] |
List of all the fields of the dataclass returned as a byte array |
Description
This function is called on both local and shared cabinet. It is called when dataclaas is modified form desktop for local cabinet and from admin for shared cabinet. This function instead of just changing properties of dataclass it takes can also be used for changing the fieldlist .
In the case of action data class Unused parameter contains the indexes of the two folders associated with actionitem, blank document Id,and the coordinator, all concatenated with “@”.
Return value
Name |
Description |
1 |
In case of success |
-2 |
Invalid operation in read only cabinet |
-3 |
Cabinet not connected |
-201 |
Insufficient rights for the current operation |
Example
Dim DataDefId As Long
Dim DataDefName As String
Dim DataDefComment As String
Dim Unused As String
Dim FieldCount As Long
Dim FieldList() As Byte
Dim FieldInfo(5) As TagDataDefField
Dim lRetVal As Long
Dim gPDb As PanDb.pdbCls
Set gPDb = New PanDb.pdbCls
DataDefId = 7
DataDefName = “MyDataClass”
DataDefComment = “for temporary purpose”
Unused = “”
FieldCount = 5
FieldInfo(0).IndexFlag = “D”
FieldInfo(0).IndexId = 419
FieldInfo(0).Name = “Field1”
FieldInfo(0).Type = 8
FieldInfo(0).UsefulInfoFlag = “N”
.
.
.
.
similarly for other fields
ReDim FieldList((FieldCount + UBound(FieldInfo) + 1) * Len(FieldInfo(0)) - 1)
Call CopyMemory(FieldList(0),FieldInfo,Len(FieldInfo))
lRetVal=gPDb.ModifyDataDefinition(DataDefId,DataDefName,DataDefComment,Unused,FieldCount,FieldList)
if lRetVal <> NG_SUCCESS Then
MsgBox gPDb.ErrDescription, vbInformation
Screen.MousePointer = vbNormal
Endif