Batch prompt pop up configuration using script

Hi

I want to set filtering of Batch unacknowledged prompts based on Units. Can anybody help me how we can set the option shown in attachment using script? This option will be set in edit mode of graphics.

This will be a dynamo. Unit name will be available on dynamo form. 


Thanks in advance. Quick response is highly appreciated.

Thanks and BR

Bhushan

  • You have to have the Use Current Context check box selected, and then you will need to have script set the Object.CurrentContext to what you want.

    For example: If your wanted to filter based on TEST_UNIT on an object named DVBPrompts you would need the below code when the picture opened or when a button is clicked to show the prompts ActiveX control

    DVBPrompts.CurrentContext = ps_UnitName4.CurrentValue

    where dynamo variable name ps_UnitName4 would be set to "TEST_UNIT" for the Unit
  • In reply to Matt Stoner:

    Hi Matt,

    Thanks for the reply. I have already tried this solution.
    But there is one issue for BatchActivex while switching between two graphics having BatchActivex.
    Issue is: Batch prompt is unable to filter the messages based on CurrentContext.
    more information:
    To dynamise CurrentContext property of activex, DVBPrompts.ConnectionState should be Set to "connected" and when switch between two graphics having the batch ActiveX will not update the ConnectionState and as a result we can't set CurrentContext dynamically.

    So instead of using CurrentContext, Can i set the option shown in previous attachment using Script? i.e first field in Filters tab to be set when OK button on dynamo is pressed.

    Thanks in advance
    Bhushan

  • In reply to Mantri_Bhushan:

    We use this current context all the time, you just add the suggested logic below the DVBCtrlPromptsListX.ConnectControl logic in the DVBCtrlPromptsListX_OnConnectedToAccess() Event

        DVBCtrlPromptsListX.CurrentContext = ps_UnitName4.CurrentValue.Caption

    Then we also have connection logic on the button to show the prompts list to connect again in case it isn't:

        If DVBCtrlPromptsListX.ConnectionState <> "CONNECTED" Then
            On Error Resume Next 'Resume if batch executive is not running
            DVBCtrlPromptsListX.ConnectControl
        End If

        If DVBCtrlPromptsListX.ConnectionState = "CONNECTED" Then
            DVBCtrlPromptsListX.CurrentContext = ps_UnitName4.CurrentValue
            If DVBCtrlPromptsListX.ExecutiveNode = "" Then
                Dim BatchExecutive As String
                BatchExecutive = frsReadValue("DVSYS.THISUSER/BATCH_SERVER.A_CV")
                If BatchExecutive <> "" Then
                    DVBCtrlPromptsListX.DisconnectControl
                    DVBCtrlPromptsListX.ExecutiveNode = BatchExecutive
                    DVBCtrlPromptsListX.ConnectControl (30000)
                Else
                    MsgBox "Batch Executive Not Defined for this NODE"
                End If
            End If
        Else
            MsgBox "Communication with Batch Executive Server failed.", vbCritical
        End If


    where DVBCtrlPromptsListX is the ActiveX Prompts object name and ps_UnitName4 is named in above comment