Using #LD-notation
#LD notation is used for displaying language-dependent information. #LD notation is mainly used in process tracking and processing notification, but it can also be used in scripts that are stored in the script library.
Syntax
Value=#LD[<language>|<language code>](<key>,{<Parameter>}*)#
where:
<language>|<language code> |
(Optional) Language or language code for the output. |
<Key> |
Basis string with place holder. The place holder syntax corresponds to a format place holder in VB.Net ({0} to {9}) |
<Parameter> |
Parameter for replacing the place holder (comma delimited) |
Table 90: Using #LD-notation
Templates |
DialogColumn.Template
DialogColumn.CustomTemplate |
Formats |
DialogColumn.FormatScript
DialogColumn.CustomFormatScript |
Task definitions |
DialogMethod.MethodScript |
Process generating scripts |
Job.GenCondition
Job.PreCode
Job.ServerDetectScript
JobChain.GenCondition
JobChain.PreCode |
Process tracking |
Job.ProcessDisplay (mapped to DialogProcessStep.DisplayName)
JobChain.ProcessDisplay (mapped to DialogProcessChain.DisplayName)
JobEventgen.ProcessDisplay (mapped to DialogProcess.DisplayName) |
Process handling notification |
Job.NotifyAddress
Job.NotifyAddressSuccess
Job.NotifyBody
Job.NotifyBodySuccess
Job.NotifySender
Job.NotifySenderSuccess
Job.NotifySubject
JobRunParameter.ValueTemplate (only in the MailComponent process component) |
Insert values |
DialogObject.InsertValues
DialogTable.InsertValues
DialogSheet.InsertValues
QBMTreeResult.InsertValuesScript |
Selection scripts |
DialogTable.SelectScript
DialogObject.SelectScript |
Using #LD notation in process tracking
For language-dependent representation of process information, a relevant template must be defined to display the captions in the active languages.
The captions for language-dependent text are entered in DialogMultiLanguage when the script is compiled. A key (column Entrykey), the language and the translation (column EntryValue) are entered into the table. The key should be in the corresponding default language. If a language caption has not been entered, the key is used as the display text. Use the Language Editor to add translations for the captions in other languages.
Example: Formulating language-dependent process information
A change is made to an identity. The language-dependent process information could be formulated as follows:
-
Value template for the process information on the Update event
Value = #LD("Change of properties of identity {0}.", $InternalName$)#
-
Templates for the display texts in the DialogMultiLanguage table
Change of properties of identity {0}. |
English - United States [en-US] |
Change of properties of identity {0}. |
Change of properties of identity {0}. |
German - Germany [de-DE] |
Änderung der Daten der Person {0}. |
With InternalName = UserA, the following display texts are produced in the process view.
English - United States [en-US] |
Change of properties of identity UserA. |
German - Germany [de-DE] |
Änderung der Daten der Person UserA. |
Example of specifying the language or language code
#LD notation supports the specification of a language or language code. This is particularly useful in cases where users need to receive system messages in their preferred language.
Examples
-
Output in the default language:
Value = #LD("Test: {0}", <parameter>)#
Value = #LD[""]("Test: {0}", <parameter>)#
-
Output always in English
Value = #LD["en-US"]("Test: {0}", <parameter>)#
Value = #LD["english"]("Test: {0}", <parameter>)#
-
Using a variable:
Dim lang As String = "en-US"
Value = #LD[lang]("Test: {0}", <parameter>)#
You do not need to enter the language in square brackets, it is optional. However, it is important that the language statement is a String expression. If the language is not specified or the resulting String expression is empty or Nothing, the language currently set for the application is used for translation.
Displaying messages in the user interface
IMPORTANT: You should never use the VB.Net Msgbox and Inputbox functions on servers. Use the VID_Write2Log, RaiseMessage, or AppData.Instance.RaiseMessage functions.
For examples of One Identity Manager Service log file output, see the script examples on the installation medium in the QBM\dvd\AddOn\SDK\ScriptSamples directory.
NOTE: References to VI.DialogEngine and other libraries that use System.Windows.Forms cannot be used in scripts anymore.
Various options are provided for displaying messages in the user interface that can be used in task definitions.
-
You can use the Msgbox function to display messages that are displayed when tasks are run.
Syntax:
MsgBox("<Message>" [, "<Title>"] [, <MsgBoxButtons>] [, <MsgBoxIcon>][, <MsgBoxDefaultButton>]) returns DialogBoxResult
Example:
If MsgBox(#LD("Do you want to create a copy of '{0}'?", Base.Display)#, #LD("CAUTION")#, MsgBoxButtons.YesNo, MsgBoxIcon.Question) <> DialogBoxResult.Yes Then
End If
-
To display a wait dialog, use BusyBlock() functionality.
Syntax:
Using BusyBlock()
' do something
End Using
-
Use the QBM_ShowFormDialog script to open a form in a modal dialog. Pass the name of the form definition in the logicalFormName parameter.
Syntax:
QBM_ShowFormDialog(<logicalFormName> [, <IEntity>] [, <title>] [, <parameter]) returns object
Example:
QBM_ShowFormDialog("QER_ITShop_MoveBoardDialog", Entity)
-
Use the VID_InputBox script to supply a form with an input field that opens in a modal dialog.
-
To navigate to a specific form, use the OpenObject() method provided by the VI.UI.Base.ScriptingSupport.IEntityEditorService interface. In the SheetName parameter, pass the name of the form to navigate to.
Syntax:
Dim srv = Session.Services.Get(Of VI.UI.Base.ScriptingSupport.IEntityEditorService)()
If Not srv Is Nothing Then
srv.OpenObject(<IEntity>, "<SheetName>")
End If
Example:
Dim srv = Session.Services.Get(Of VI.UI.Base.ScriptingSupport.IEntityEditorService)()
If Not srv Is Nothing Then
srv.OpenObject(Entity, "QER_Structure_Create_QERAssign_Wizard")
End If