Here we will see how to get the list of controls on the Popup Screens and how to customize them. Just to be clear when I say popup screen I mean Screens like Item/Tax Details screen on O/E and P/O Transactions.
Normally when we have to do customization to Main Screens of Accpac for e.g. O/E Order Entry, Shipment Entry, and Invoice Entry etc… we can get the list and names of all the controls on the UI through Accpac SDK i.e. from Accpac UI Info.But for the Popup Screens like Item/Tax Details List and Names of the controls on the Popup Screen are not listed in Accpac SDK. So when it come to rare situations where one has to make some changes on the Popup screen people often get stuck as to where and how do I write my code without knowing the control name.
Here is the solution…
Let us take an example say if we have to change the Label of Item Number to Product Number on Item/tax Detail Screen of Order Entry.
For this you will need to customize the Order Entry OCX and do some debugging.
First thing one needs to do is find out the Name of the Popup Form, you will find a event in Order Entry Source “AccpacOE1100UICtrl1_OnPopupOpened” (refer below snippet). This event has various parameters I have explained each one below.
[Snip]
Private Sub AccpacOE1100UICtrl1_OnPopupOpened(ByVal strPopupName As String, PopupDSs As AccpacOE1100.ACCPACDSControls, PopupCtls As AccpacOE1100.ACCPACControls, strPopupCaption As String, icoPopup As stdole.Picture)
[Snip]
Here is the solution…
Let us take an example say if we have to change the Label of Item Number to Product Number on Item/tax Detail Screen of Order Entry.
For this you will need to customize the Order Entry OCX and do some debugging.
First thing one needs to do is find out the Name of the Popup Form, you will find a event in Order Entry Source “AccpacOE1100UICtrl1_OnPopupOpened” (refer below snippet). This event has various parameters I have explained each one below.
[Snip]
Private Sub AccpacOE1100UICtrl1_OnPopupOpened(ByVal strPopupName As String, PopupDSs As AccpacOE1100.ACCPACDSControls, PopupCtls As AccpacOE1100.ACCPACControls, strPopupCaption As String, icoPopup As stdole.Picture)
[Snip]
strPopupName – Indicates the popup screen name.
strPopupCaption – Indicates the caption name for this popup screen.
PopupCtls – Is used to get the field controls on this popup screen.
PopupDSs – Indicates the data source that will be bound with the popup screen.
icoPopup – Indicates the icon number used for the popup screen.
While in debug mode when you hit the Item/Tax button for a specific item following parameters information will be obtained.
strPopupName : “frmDetail”
strPopupCaption : “Items/Taxes – O/E Order Entry”
Now you have the form name and need to get the list of controls on our form “frmDetail” (i.e. Item/Tax popup screen) for this you will have to write a small piece of code in the AccpacOE1100UICtrl1_OnPopupOpened event.
PopupCtls.Count will give the number of controls present in the Popup screen. So while debugging programmer will came to know their are 114 controls present on the “Item/Tax” popup screen and using the above for loop the name of the controls popup screen and using the above for loop the name of the controls will be printed on the immediate window.
From above printed List user has identify what would be the name of his control (well anyone who know Accpac SDK should be able to figure out right name ), in our case the field would be “fecOEORDD_ItemNo” since we have to change the change the caption from the Item Number to Product ID.
So now that we have identified the name of the control that we want to change we just need to replace our above Code (Loop that prints control Names) with below code.
Besides this you can also use below properties to change Height, Width, Top and Left Alignment…
PopupCtls(“fecOEORDD_ItemNo “).Height
PopupCtls(“fecOEORDD_ItemNo “).Width
PopupCtls(“fecOEORDD_ItemNo “).Top
PopupCtls(“fecOEORDD_ItemNo “).Left
Below screen shot shows how our caption change would reflect “Product ID”.