Properties Initialization (compute_edit_properties_init)

An opening ID is an entry point used to customize business logic. compute_edit_properties_init lets you customize the properties displayed in the Properties or Instance tab of the Information panel and define messages displayed to users.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

See Also
About UX Openings

General Information

This opening ID is a compute opening. For more information about the specificities of a compute opening, see Compute Openings.

It is triggered when a user opens the Information panel.

The Properties or Instance tab of the Information panel are displayed according to the changes defined in the script.

Definition Description
PLM Opening ID compute_edit_properties_init
Customization intent Not applicable
Execution context Server

In case of multiselection, the business logic is executed once for all the selected objects if:

  • All the selected objects are the same type and the business rule is deployed for this type.
  • The business logic is deployed for only one of the selected object types.
  • The business logic is deployed for at least two selected object types.
If the business logic is not deployed for any of the selected object types, the business logic is not executed.
Recommendation: Check that the script is appropriate for both single selection and multiselection of different object types (possibly common or different attributes, with the same or different values).
For more information, see About UX Openings.

Context Object Parameters

Parameter Name Type Read or Write Comments
numberOfObjects Attribute Read The number of objects on which the script is run.

In this example, the Description attribute value is updated to "number of selected objects: <N>", where <N> is an integer corresponding to the number of objects selected by the user:

Let numberOfObjects(Integer)

Trace(1,"Inside UX prop_modify BL")
numberOfObjects  = Parameters->GetAttributeObject("numberOfObjects")
ThisObject.SetAttributeString( "PLMEntity.V_description",  "number of selected object: " + numberOfObjects)

Examples

This example shows how to make the Description property read-only:

Trace(1,"Inside compute_edit_properties_init")

if (ThisObject.HasAttributeProperty("PLMEntity.V_description","ReadOnly") == true){
	ThisObject.SetUIAttributeReadOnly("PLMEntity.V_description", true)
}

This example shows how to remove the Description property from the Properties tab:

Trace(1,"Inside compute_edit_properties_init")


if (ThisObject.HasAttributeProperty("PLMEntity.V_description","Visibility") == true){
	ThisObject.SetUIAttributeVisible("PLMEntity.V_description", false)
}

This example shows how to restrict the Description property to a list of authorized values ("alpha", "beta", and "gamma"):

Let authvalueForDesc(List)

Trace(1,"Inside compute_edit_properties_init")



if (ThisObject.HasAttributeProperty("PLMEntity.V_description","AuthorizedValues") == true){
		authvalueForDesc.Append("alpha")
		authvalueForDesc.Append("beta")
		authvalueForDesc.Append("gamma")
		ThisObject.SetUIAttributeAuthorizedValue("PLMEntity.V_description", authvalueForDesc)
}