I have a request to display the Use Code of the current designation on the designation details page in BBIS.
I have a part that will correctly display the use code of a designation, but I am having trouble detecting what the "current" designation is.
In BBEC, this would be the current context. What is the analagous concept in BBIS?
My code is below, with the relevant line in bold.
Private Sub InitializeForm()
'Instead of a hard-coded GUID, I want to say something like Me.CurrentContextID.
'What's the magic word for that in BBIS?
Dim useCode As String = UseCodeFromDesignationID(New Guid("95A150D2-B714-4BE7-8199-D3FFB6CCB9FE"))
If 0 < useCode.Length Then
lblDesigUseCode.Text = CONST_CAPTION + useCode
lblDesigUseCode.Text = ""
Private Function UseCodeFromDesignationID(ByVal designationID As Guid) As String
Dim recordID As String = designationID.ToString()
'URL needs to be pointed at the "service hosting the current site", ditto for database
Dim svc As New AppFxWebServiceProvider(Me.API.Settings.AppFxUrl, Me.API.Settings.AppFxDatabase)
'Return the designation use code
Dim result As String = ViewForms.Designation.DesignationUseCodeDisplay.LoadData(svc, recordID).USE_CODE.Trim()
If result IsNot Nothing Then
If (0 = result.Length) Or ("None" = result) Then
Return "No designation use code was found"
Catch ex As Exception
Return "Error retrieving recognition for recordID " + recordID + " (" + ex.Message + ")"