Preventing Users From Removing Links Between Object Types
This topic describes how to configure Siebel CRM Desktop so that the user cannot remove a link that occurs between object types, such as removing an industry link from an account.
To prevent users from removing links between object types
Do all the steps described in Controlling Access to Object Types, with the following differences:
Replace the code you use in Making Object Types Read-Only with the following code:
base_security.call(this, ctx, item_ex, {"delete_filter": link_check_function});
This code uses the delete_filter parameter when Siebel CRM Desktop calls the base_security function.
In Making Object Types Read-Only, use the following code:
if (link.link_to == "object_type") { access.create = true; access.remove = false; }
where:
link
is a required parameter that contains information about the link that Siebel CRM Desktop examines. This information identifies the object that provides the link source, the object that provides the link destination, the tag that Siebel CRM Desktop uses for the link, and other information.object_type identifies the type of object where Siebel CRM Desktop applies the logic that you specify in this
if
statement.access.create
is an optional parameter that you can set to one of the following values:true. Allows the user to create a link between two object types.
false. Prohibits the user from creating a link between two object types.
access.remove
is an optional parameter that you can set to one of the following values:true. Allows the user to remove a link between two object types.
false. Prohibits the user from removing a link between two object types.
For example, the following code allows the user to create a link between an industry and the object where you are defining link access, but not to remove this link:
if (link.link_to == "Industry") { access.create = true; access.remove = false; }
Siebel CRM Desktop uses access.create and access.remove to create or remove a link instead of the and_value and or_value described in Controlling Access to Object Types. It does this because and_value and or_value only allow you to specify a single true or false value that determines if the user can modify or delete an object. A link allows you to set a true or false value that determines if the user can create a link, and a separate true or false value that determines if the user can remove a link. For example, Siebel CRM Desktop creates a link if the user uses the autocomplete control to pick an account in an opportunity form, and it deletes this link if the user subsequently deletes this account.
Siebel CRM Desktop enables or disables buttons in the MVG dialog box depending on the access that you specify. For example, if you disallow the user from adding new associations, then Siebel CRM Desktop disables the Add button in the MVG dialog box.
Note that you can configure Siebel CRM Desktop to control access to object types and prevent users from removing links between object types. To do this, do the work described in Controlling Access to Object Types, create a copy of this work, and then modify this copy to prevent users from removing links between object types.
(Optional) Use the following code to specify the type of link:
if (link.link_to == "Industry" && link.tag == "link_type") { access.create = true; access.remove = false; }
where:
link_type specifies the type of link.
Types of Links You Can Specify
You can
use one of the following values when you specify the type of link
in the if (link.link_to
statement:
direct. Siebel CRM Desktop applies the logic that you specify in this
if
statement only on direct links. A direct link is a type of link that possesses a one-to-one relationship between one object type and another object type. A link between one account and one opportunity is an example of a direct link. The function that resides in the business_logic.js file determines the type of link. The add_direct_link function specifies a direct link.mvg. Siebel CRM Desktop applies the logic that you specify in this
if
statement only on MVG links. An MVG link is a type of link that possesses a one-to-many relationship between one object type and another object type. A link between one opportunity and many contacts is an example of an MVG link. The function that resides in the business_logic.js file determines the type of link. The add_mvg_link function specifies a direct link.
For example, the following code allows the user to create a direct link between an industry and the object where you are customizing link access, but not to remove this link:
if (link.link_to == "Industry" && link.tag == "direct")
{
access.create = true;
access.remove = false;
}