Hello, I'm attempting to add some custom fields to Inventory Status Inquiry / Costs form. I'm following the following article that I found which I think should work.
http://dynamicserppros.com/adding-additional-user-fields-microsoft-dynamics-sl-screen/
I added the extension table, module and added code to the code behind. But when I save I get a message that the VBA would not compile. Also when attempting to add controls on the form the extended fields are not available to bind the controls.
I'm new to SL and not sure what I've done wrong so I'm attaching my code.
Please help me get this modification working or point me in the right direction.
Table:
CREATE TABLE [dbo].[xInventoryExt](
[User9] [float] NOT NULL,
[User10] [float] NOT NULL,
[User11] [float] NOT NULL,
[User12] [float] NOT NULL,
[User13] [int] NOT NULL,
[User14] [int] NOT NULL,
[User15] [int] NOT NULL,
[User16] [int] NOT NULL,
[InvtID] [char](30) NOT NULL,
[tstamp] [timestamp] NOT NULL,
CONSTRAINT [xInventoryExt0] PRIMARY KEY CLUSTERED
(
[InvtID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Module:
Type xInventoryExt
User9 As Double
User10 As Double
User11 As Double
User12 As Double
User13 As Integer
User14 As Integer
User15 As Integer
User16 As Integer
InvtID As String
End Type
Public bxInventoryExt As xInventoryExt, nxInventoryExt As xInventoryExt
Costs code behind:
Private Sub f1022002_Display()
End Sub
Private Sub f1022002_Load()
Call VBA_SetInventoryCosts("bxInventoryExt", bxInventoryExt, LenB(bxInventoryExt))
Call SqlCursorEx(cursor_xInventoryExt, NOLEVEL, "cursor_xInventoryExt", "xInventoryExt", "xInventoryExt")
End Sub
Private Sub cInvtID_Chk(ChkStrg As String, retval As Integer)
Dim sqlStatement As String
sqlStatement = "Select * from xInventoryExt Where InvtID = " & SParm(ChkStrg)
serr1 = SqlFetch1(cursor_xInventoryExt, sqlStatement, bxInventoryExt, LenB(bxInventoryExt))
If serr1 = NOTFOUND Then
bxInventoryExt = nxInventoryExt
bxInventoryExt.InvtID = ChkStrg
End If
Call DispFields("", "")
End Sub
Private Sub Update1_OnUpdate(level As Integer, InsertFlg As Integer, retval As Integer)
Dim InvtID As String
Dim SqlStr As String
InvtID = GetObjectValue("cInvtID")
If level = 0 Then
SqlStr = "Select * from xInventoryExt where InvtID = " & SParm(InvtID)
serri = SqlFetch1(CSR_XVendorExt, SqlStr, bxInventoryExtLookup, LenB(bxInventoryExtLookup))
If serr1 = 0 Then
Call SUpdate1(CSR_xInventoryExt, "xInventoryExt", bxInventoryExt, LenB(bxInventoryExt))
Else
bxInventoryExt.InvtID = InvtID
Call SInsert1(cursor_xInventoryExt, "xInventoryExt", bxInventoryExt, LenB(bxInventoryExt))
End If
End If
End Sub
*This post is locked for comments