Hi Stuart,
The DrillDownByFormNumber is a legacy compatibility method provided to assist where old version 6 breakout scripts are converted to version 7 plugins. We generally don't use that, and I think there is only a handful of places where it is still used in our code which we have not got to converting yet.
Instead, we use the SetDrillDown method when populating the cells in a grid, which uses the SY_Forms.Classname to provide the form to load.
For instance, in sales order entry, when we display a sales order line, we set the drill down for the PartNo column like so:
- Code: Select all
grdLines.SetDrillDown("PartNo", Row, "JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm", SalesOrderLine.InventoryID)
The grid will then handle the double right click and load the inventory maintenance form for the provided InventoryID.
The DrillDownByFormNumber method simply maps the old version 6 form numbers to the SY_Forms.Classname:
- Code: Select all
Public Sub DrillDownByFormNumber(ByVal DrillDownID As String, ByVal LegacyFormNo As Integer, Optional NewRecord As Boolean = False)
Dim className As String = Nothing
Select Case LegacyFormNo
Case 100
className = "JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm"
Case 101
className = "JiwaFinancials.Jiwa.JiwaStockTransferUI.MainForm"
Case 108
className = "JiwaFinancials.Jiwa.JiwaBOAllocUI.frmBOAllocation"
Case 124
className = "JiwaFinancials.Jiwa.JiwaStockTakeUI.frmMain"
Case 140
className = "JiwaFinancials.Jiwa.JiwaWhouseTransferUI.WarehouseTransferOut"
Case 141
className = "JiwaFinancials.Jiwa.JiwaWhouseTransferUI.WarehouseTransferIn"
Case 200
className = "JiwaFinancials.Jiwa.JiwaDebtorsUI.frmDebtor"
Case 300
className = "JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm"
Case 301
className = "JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BackToBackSalesOrderEntryForm"
Case 302
className = "JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.CreditNoteForm"
Case 400
className = "JiwaFinancials.Jiwa.JiwaPurchaseOrdersUI.PurchaseOrders"
Case 401
className = "JiwaFinancials.Jiwa.JiwaPurchaseOrdersUI.BackToBackPurchaseOrders"
Case 410
className = "JiwaFinancials.Jiwa.JiwaInvReceivalUI.MainForm"
Case 411
className = "JiwaFinancials.Jiwa.JiwaPurchaseInvoicesUI.MainForm"
Case 421
className = "JiwaFinancials.Jiwa.JiwaLandedCostUI.BookIn.BookIn"
Case 450
className = "JiwaFinancials.Jiwa.JiwaSalesUI.SalesQuote.SalesQuoteEntryForm"
Case 500
className = "JiwaFinancials.Jiwa.JiwaGeneralLedgerUI.MainForm"
Case 510
className = "JiwaFinancials.Jiwa.JiwaJournalSetsUI.MainForm"
Case 530
className = "JiwaFinancials.Jiwa.JiwaBankRecUI.MainForm"
Case 550
className = "JiwaFinancials.Jiwa.JiwaCashBookUI.frmCashBookReceipts"
Case 551
className = "JiwaFinancials.Jiwa.JiwaCashBookUI.frmCashBookPayments"
Case 800
className = "JiwaFinancials.Jiwa.JiwaCreditorsUI.frmCreditor"
Case 801
className = "JiwaFinancials.Jiwa.JiwaCreditorChqPayUI.CreditorChqPay"
Case 803
className = "JiwaFinancials.Jiwa.JiwaCRBatchTXUI.CreditorTransactions"
Case 804
className = "JiwaFinancials.Jiwa.JiwaCRBatchTXUI.CreditorDebitAdjustment"
Case 806
className = "JiwaFinancials.Jiwa.JiwaCRBatchTXUI.CreditorPayment"
Case 808
className = "JiwaFinancials.Jiwa.JiwaCRBatchTXUI.CreditorCreditAdjustment"
Case 900
className = "JiwaFinancials.Jiwa.JiwaContactsUI.frmContact"
Case 1240
className = "JiwaFinancials.Jiwa.JiwaJobCostingUI.MainForm"
Case 398
className = "JiwaFinancials.Jiwa.JiwaPriceSchemesUI.frmPriceScheme"
Case 203
className = "JiwaFinancials.Jiwa.JiwaDebtorBatchTransUI.DebtorReceipt"
Case 204
className = "JiwaFinancials.Jiwa.JiwaDebtorBatchTransUI.DebtorCreditAdjustment"
Case 206
className = "JiwaFinancials.Jiwa.JiwaDebtorBatchTransUI.DebtorInvoice"
Case 207
className = "JiwaFinancials.Jiwa.JiwaDebtorBatchTransUI.DebtorDebitAdjustment"
Case 1000
className = "JiwaFinancials.Jiwa.JiwaServiceManagerUI.Jobs"
Case 1290
className = "JiwaFinancials.Jiwa.JiwaJobCostingUI.CostEntry"
Case 1400
className = "JiwaFinancials.Jiwa.JiwaBillOfMaterialsUI.BillMaintenance.BillMaintenance"
Case 1401
className = "JiwaFinancials.Jiwa.JiwaBillOfMaterialsUI.WorkOrder.WorkOrder"
Case 1504
className = "JiwaFinancials.Jiwa.JiwaSupplierReturnsUI.Credit.Credit"
End Select
If className Is Nothing Then
Throw New Exception("Legacy FormNo " & LegacyFormNo & " is not known.")
End If
Dim form As JiwaApplication.IJiwaForm = FormFactory.CreateForm(className)
If NewRecord Then
form.DrillDownID = DrillDownID
form.Start()
form.NewRecord()
Else
form.DrillDownID = DrillDownID
form.Start()
' form.ReadRecord(DrillDownID)
End If
End Sub
Mike