Record Changing Events on Popupdss

Hi,

I'm trying to custom PO Receipt Screen, I wanted to get the datasource of the popup detail line. I have set a datasource for popup using popupdss given. When I test it only trigger when events is On Record Changed, while on Changing it does not trigger anything. Has any one ever develop on this popupdss and how should it works?Thanks in advance

  • 0

    For some reason I'm thinking that you might need to test outside of the VB IDE.  Try adding a message box in OnRecordChanging, compile and run it outside of the IDE.

  • 0 in reply to Django

    Dear Django,

    I did a testing and put a simple msgbox on record changed/Changing it does not fired up.The only time it fired up is when I close the F9 Screen it fired the on record changed.

  • 0 in reply to microtek

    This is what I did for a PO Receipt screen.  Basically I have a dsDetail for the regular detail lines and when the user presses F9 I change the data source that my dsDetail is pointing to. When the screen is closed, I point it back to the regular dsPORCPL.

    I have not upgraded this code since 5.6 so something might have broken in the mean time.  Hopefully it helps.

    Private Sub AccpacUI_OnPopupClosed(ByVal strPopupName As String)
        
        If strPopupName = "DetailEntryZoom" Then
            Set dsPopupDetail = Nothing
            Set dsDetail = AccpacUI.UIDSControls("dsPORCPL")
        End If

    End Sub

    Private Sub AccpacUI_OnPopupOpened(ByVal strPopupName As String, PopupDSs As AccpacPO1310.ACCPACDSControls, PopupCtls As AccpacPO1310.ACCPACControls, strPopupCaption As String, icoPopup As stdole.Picture)

        If strPopupName = "DetailEntryZoom" Then
            Set dsDetail = Nothing
            Set dsPopupDetail = PopupDSs.Item("dsPORCPL")
        End If
        
    End Sub

    I have this code:

    Private Sub dsDetail_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)
        If eReason = RSN_REFRESH Then Exit Sub
        
        If eReason = RSN_FIELDCHANGE Then
            '*****************************************************************
            'Programmer: Duplicate any logic here in dsPopupDetail events, too
            '*****************************************************************

    And I have this code with a note for me for when I forget that this won't work properly when debugging. :)

    Private Sub dsPopupDetail_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)
        If eReason = RSN_REFRESH Then Exit Sub
        
        If eReason = RSN_FIELDCHANGE Then
            '****************************************************************
            'Programmer: Duplicate any logic here in dsDetail events, too
            'Programmer: THESE EVENTS DO NOT GET TRIGGERED WHEN DEBUGGING
            '****************************************************************

  • 0 in reply to Django

    Dear Django,

    Thanks for your guidance and help, now it works well.