ER Generic Server EKL Functions for UX Openings

ER generic server functions for UX-specific openings are used to customize the actions performed on the server within ER Generic Server Openings.

For dimension attributes in ux_init_new_modify and ux_init_edit_properties_modify openings, the SetAttributeValue function is also available. For more information, see ER Generic Server EKL Functions.

For more information, see Installation and Setup | 3DEXPERIENCE Platform | 3DEXPERIENCE Configuration and Customization | Data Setup | Data Setup | List of Resource Set IDs | Infrastructure Business Logics | ER Generic Server Openings | UX Openings.

This page discusses:

HasAttributeProperty

This method allows you to know whether a property exists for an object's attribute.

Signature

ThisObject.HasAttributeProperty(attributeName: String, propertyName: String): Boolean

Argument

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read
propertyName String The name of the property. You must put a string in quotes. Local Read

HasAttributeProperty EKL Script

ThisObject.HasAttributeProperty("PLMEntity.V_description","ReadOnly")

SetUIAttributeVisible

This method lets you specify whether an attribute is visible or not in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.SetUIAttributeVisible(attributeName:String, valueToSet: Boolean): Integer(0/-1)

Arguments

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read
valueToSet Boolean The visibility of the attribute:
  • true if the attribute is visible.
  • false if it is not visible.
- Local Read

SetUIAttributeVisible EKL Script

ThisObject.SetUIAttributeVisible("PLMEntity.V_description", true)

SetUIAttributeReadOnly

This method lets you specify whether an attribute is read-only or editable in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.SetUIAttributeReadOnly(attributeName: String, valueToSet: Boolean) : Integer(0/-1)

Arguments

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must:
  • Put a string in quotes.
  • Use the full name of the attribute with its extension, in the extension.attribute_name format.

    For example, "PLMEntity.V_description".

Local Read
valueToSet Boolean The visibility of the attribute:
  • true if the attribute is read-only.
  • false if it is editable.
- Local Read

SetUIAttributeReadOnly EKL Script

ThisObject.SetUIAttributeReadOnly("PLMEntity.V_description", false)

SetUIAttributeAuthorizedValue

This method lets you specify the authorized values for attributes in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.SetUIAttributeAuthorizedValue(attributeName: String, authorizedValues: List(String)) : Integer(0/-1)

Arguments

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attributes. You must put a string in quotes. Local Read
authorizedValues List(string) The list of authorized values. You must put each string in quotes, separated by a comma. Local Read

SetUIAttributeReadOnly EKL Script

ThisObject.SetUIAttributeAuthorizedValue("PLMEntity.V_description", List("alpha","beta","gamma"))

SetUIAttributeNotificationMessageAndSeverity

This method allows you to define the severity and the content of the message displayed to users for an attribute in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.SetUIAttributeNotificationMessageAndSeverity(attributeName: String, Severity: Integer, Message: String) : Integer(0/-1)

Arguments

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read
Severity Integer The severity of the message:
  • 1: The message is an error. Users cannot submit the changes until the error is fixed.

    For example:

    Note: Error messages are displayed inline instead of a popup.

  • 2: The message is a warning. Users can submit the changes.

    For example:

  • 3: The message is an information. Users can submit the changes.

    For example:

  • 0: No messages are displayed. Any previous severity code for the current attribute is reset to 0.
- Local Read
Message String The message is displayed to users. You must put a string in quotes. Local Read

SetUIAttributeNotificationMessageAndSeverity EKL Script

ThisObject.SetUIAttributeNotificationMessageAndSeverity("PLMEntity.V_description", 1, "You cannot use this character in the description: %")

IsUIAttributeVisible

This method allows you to know whether an attribute is visible or not in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.IsUIAttributeVisible(attributeName: String): Boolean

Argument

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read

IsUIAttributeVisible EKL Script

ThisObject.IsUIAttributeVisible("PLMEntity.V_description")

IsUIAttributeReadOnly

This method allows you to know whether an attribute is read-only or editable in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.IsUIAttributeReadOnly(attributeName: String) : Boolean

Argument

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read

IsUIAttributeReadOnly EKL Script

ThisObject.IsUIAttributeReadOnly("PLMEntity.V_description")

GetUIAttributeAuthorizedValue

This method allows you to retrieve the authorized values defined for attributes in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.GetUIAttributeAuthorizedValue(attributeName: String) : List(String)

Argument

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read

GetUIAttributeAuthorizedValue EKL Script

ThisObject.GetUIAttributeAuthorizedValue("PLMEntity.V_description")

GetUIAttributeNotificationSeverity

This method allows you to retrieve the severity assigned to a message displayed to users for an attribute in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.GetUIAttributeNotificationSeverity(attributeName: String): Integer

Argument

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read

This method returns an integer corresponding to the severity of the message:

  • 1: The message is an error. Users cannot submit the changes until the error is fixed.

    For example:

    Note: Error messages are displayed inline instead of a popup.

  • 2: The message is a warning. Users can submit the changes.

    For example:

  • 3: The message is an information. Users can submit the changes.

    For example:

  • 0: No messages are displayed. Any previous severity code for the current attribute is reset to 0.

GetUIAttributeNotificationSeverity EKL Script

ThisObject.GetUIAttributeNotificationSeverity("PLMEntity.V_description")

GetUIAttributeNotificationMessage

This method allows you to retrieve the content of the message displayed to users for an attribute in the New... and Insert New... dialog boxes, and in the Properties tab of the Information panel.

Signature

ThisObject.GetUIAttributeNotificationMessage(attributeName: String): String

Argument

Argument Type Required/Optional Description Comment Execution Profile
attributeName String The name of the attribute. You must put a string in quotes. Local Read

GetUIAttributeNotificationSeverity EKL Script

ThisObject.GetUIAttributeNotificationMessage("PLMEntity.V_description")

IsAttributeInitialized

The IsAttributeInitialized EKL method returns "true" if the specified attribute (or basic) has been set a value (initialized), "false" otherwise.

The goal is to provide a way for the UX script author to determine if an attribute (or basic) has been initialized or not, and therefor if he can use its value. It is strongly recommend to test the attribute initialization before using or retrieving its value.

Some attributes and basics are initialized by default and their value can be different than empty string ("") or zero (0).

Note:

This method can only be used in UX Openings. Otherwise it raises an exception.

Depending on the UX opening, on user filtered attributes, an attribute or basic value may be initialized or not.

Signature

IsAttributeInitialized(AttributeName : String) : Boolean

Argument

String Type Required or Optional Description Comment Execution Profile
AttributeName String Required The attribute (or basic) name to check. - Local Read

IsAttributeInitialized

Let SGRefStrg (String)
if (ThisObject.IsAttributeInitialized("PLMSGReference.SGRefStrg"))
{
 Set SGRefStrg = ThisObject.GetAttributeString("PLMSGReference.SGRefStrg")
 …
}

SetAttributeValue

The SetAttributeValue EKL method defines the value of the given attribute. You can only set one free attribute. Otherwise all protected attribute modifications raise an exception.

Signature

SetAttributeValue(attributeName:String, attributeValue:ObjectType) : VoidType

Argument

String Required/Optional Comment Execution Profile
attributeName (String) Name of the attribute to specify. Local Read
attributeValue (ObjectType) Value of the attribute to specify. Local Read

SetAttributeValue

Let stringListValue (List)
Let integerListValue (List)

//simple attributes
ThisObject.SetAttributeValue("attrLength", "23.15 MM")
ThisObject.SetAttributeValue("attrReal", "03.00")
ThisObject.SetAttributeValue("PLMSGReference.SGRefStrg","this is a test")
ThisObject.SetAttributeValue("PLMSGReference.SGRefIntg", 12)
ThisObject.SetAttributeValue("PLMSGReference.SGRefDble", 1.2)

//multivalued attributes
stringListValue->Append("this")
stringListValue->Append("is")
stringListValue->Append("my")
stringListValue->Append("test")
ThisObject.SetAttributeValue("PLMSGReference.SGRefStrgLst", stringListValue)

integerListValue ->Append(1)
integerListValue ->Append(2)
integerListValue ->Append(3)
ThisObject.SetAttributeValue("PLMSGReference.SGRefIntgLst", integerListValue)

You can also set the values with their unit using the following format:

Let length_value(LENGTH)
Let inputs(Number_inputs) /* new extension type */
Let inputvalue(String)
Let inputunit(String)

length_value = (ThisObject.GetAttributeValue("attrLength") : LENGTH)
set inputs = length_value
if (inputs <> NULL) {
  inputvalue = inputs.inputvalue()
  inputunit = inputs.inputunit()
  Trace(1, "inputvalue: # inputunit:#", inputvalue, inputunit)
  /* displays: inputvalue: 23.15 inputunit: MM */
}

length_value = 2m
set inputs = length_value
if (inputs == NULL) {
  Trace(1, "Volatile values don’t support inputvalue/inputunit")
}

Let dimensionList (List)
…
dimensionList->Append("21.0975 KM")
dimensionList->Append("42.1950 KM")
ThisObject.SetAttributeValue("PLMCKESample2Reference.M_LENGTH",dimensionList)

HasSameValuesForMultipleObjects

This method lets you check if an attribute has the same value for all the selected objects that are displayed in the Properties tab of the Information panel. This method is only applicable for UX openings business logics in case of multiselection.

Signature

ThisObject.HasSameValuesForMultipleObjects(attributeName: String): Boolean

Argument

String Type Required or Optional Description Comment Execution Profile
AttributeName String Required The name of the attribute. You must put a string in quote. Local Read

HasSameValuesForMultipleObjects

ThisObject.HasSameValuesForMultipleObjects("PLMEntity.V_description"