moveRandom

About moveRandom

moveRandom moves an object from its current class to a target class.

Syntax

moveRandom source-class to target-class {
key{
(field1| field1@unit) = "str1" fd
(field2| field1@unit) = "str2" fd
...
(fieldN) = "strN" fd
[objectPtr pointer-name{
class=class-name fd
(field1| field1@unit) = "str1" fd
(field2| field1@unit) = "str2" fd
...
(fieldN) = "strN" fd
}]
}
[objectPtr pointer-name{
class=class-name fd
(field1| field1@unit) = "str1" fd
(field2| field1@unit) = "str2" fd
...
(fieldN) = "strN" fd
}]
[permGrantGroups{
(add|remove)= ®""group-name®"" | all fd
}]
.............
[permGrantUsers{
(add|remove)= ®""user-name®"" fd
}]
..........
(field1| field1@unit) = "str1" fd
(field2| field1@unit) = "str2" fd
...
(fieldN) = "strN" fd
}

Explanation

moveRandom source-class to target-class {

For source-class, supply the name of the class containing the object you want to move. For target-class, supply the name of the class to which you want to move the object.

key{
(field1| field1@unit) = "str1" fd
(field2| field1@unit) = "str2" fd
...
(fieldN) = "strN" fd
}

You must uniquely identify a single object to move. Therefore, you must provide the primary keys in the key statement.

[objectPtr pointer-name {
class = class-name fd
(field1| field1@unit) = "str1" fd
(field2| field2@unit) = "str2" fd
...
(fieldN| fieldN@unit) = "strN" fd}]
...
}

If the object primary keys include pointers, use one or more objectPtr statement to indicate values of these keys.

[objectPtr pointer-name {
class = class-name fd
(field1| field1@unit) = "str1" fd
(field2| field2@unit) = "str2" fd
...
(fieldN| fieldN@unit) = "strN" fd}]
...
}]

If the target class includes required pointers, use one or more objectPtr statements to provide values for these pointers. For class name, specify the class name pointing to the object.

[permGrantGroups{
(add|remove)= ®""group-name®"" | all fd
}]
.............

Use the permGrant Groups statement to change permissions on the object. If necessary.

[permGrantUsers{
(add|remove)= ®""user-name®"" | all fd
}]
.............

Use the permGrant Users statement to change permissions on the object. If necessary.

field1| field1@unit) = "str1" fd
(field2| field1@unit) = "str2" fd
...
(fieldN) = "strN" fd
}

Use the remaining fields to specify values for class properties that are required by the target class.

Example

This example moves an object in the manufacturers class (i_man_clas_table) to the distributors class (i_dst_cls_table). The distributors class requires two additional property values, namely as, the manufacturer code (i_dst_man_code) and the manufacturer code ID (i_dst_man_code_id). You must supply these values outside the key statement.

moveRandom i_man_cls_table to i_dst_cls_table {
key {
i_man_man_code= ®""AAC®"";
}
i_dst_man_code = ®""KJF®"";
i_dst_man_code_id = ®""122456789®"";
}