Drop down controls are data aware controls. It displays the choices for selection. Say for e.g.; Document Type under I/C Transfers screen displays a choice for document types i.e.; Transfer, Transit Transfer and Transit Receipt. These choices are referred as presentation items and are stored in database.
Say if you have a requirement where you want to restrict certain presentation items for certain users or you do not want a particular presentation item to appear in the list then you can achieve this with a simple customization without affecting the database structure.
This blog provides technical guidelines for customizing the behavior of drop-down controls.
– Transit Transfer and Transit Receipt in GreyMatrix for Sage 300 ERP –
Let’s take an example of I/C Transfer screen. Here we want to remove “Transfer” presentation item (choice) from Document Type drop down.
Customize I/C Transfer screen and follow below code snippet:
Define the custom fields in general declaration section:
<SNIP>
‘Custom fields control for removing the options
Private WithEvents customFecDocType As AccpacCustomField
‘Custom presentation string
Private CustomPresentationStr_DocType As IAccpacCustomFieldPresentsStrings
</SNIP>
‘Implement the option removing code in OnUIAppOpened sub procedure
<SNIP>
Private Sub AccpacIC3410UICtrl1_OnUIAppOpened ()
On Error Go To ErrorHandler
‘Removing the option from control
Set customFecDocType = New AccpacCustomField
‘Initialize the custom field with the document type field
customFecDocType.InitFromField dsICTREH.Fields.FieldByID(“15”)
With customFecDocType
Set CustomPresentationStr_DocType = .PresentationStrings
‘remove the option which you need to remove from combo box “transfer”
CustomPresentationStr_DocType.RemoveByValue 1
‘set defualt value to “transfer” CustomPresentationStr_DocType.SetFieldValue 1
End With ‘with customFecDocType
‘set doc type control with the custom control in which we have removed the option
Set afecDoctype.AccpacField = customFecDocType
‘Removing the option from control
ErrorHandler:
ErrorHandler (“AccpacIC3410UICtrl1_OnUIAppOpened”)
End Sub
</SNIP>
After implementing the customization; “Transfer” option will be removed from Document Type drop down.
Also Read :
1. Requisition Approvals in Sage 300 ERP
2. Manufacturers Item Number in Sage 300 ERP
3. GL Clearing Report in Sage 300 ERP
4. Quick Shipment feature for Sage 300 ERP
5. Clear Sales History from Account Receivable Module in Sage 300 ERP