Hello Community,
I have created a custom screen with three grid controls(each on a separate tab control) . The Main record is that of employee. The three related tables are for Employee Salary,Employee Deductions and Employee Allowances. The Link to parent record is the EmpID field which is the foreign key in the three child tables.
I set up the levels N for Employee, D for the three grids ;Employee;N,Salary;D,Deductions;D,Allowances;D(tried using DA ,it dint work)
I properly set up the DBNav property of the three grid controls(stored procedure and the parameters).
I am able to add data for the three tables using the screen.
My only problem is that, it is the only the grid i gave level 1 displaying data, the other two dont(yet i can view the data added in sql server mgt studio).
Here is some code
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load ' Load all the forms needed for this application 'Call LoadForm(fSL01001) ' Initialize the application as a Microsoft Dynamics SL Application Call ApplInit() ' Call Set Address for the tables that will have fields displayed on the scree, ' or that you would like customization manager to be able to use 'Call SetAddr(LEVEL0, "bxSLSample", bxSLSample, nxSLSample) Call SetAddr(LEVEL0, "bXPEmployees", bXPEmployees, nXPEmployees) Call SetAddr(LEVEL1, "bXEmpScales", bXEmpScales, nXEmpScales) Call SetAddr(LEVEL2, "bXEmpDeductions", bXEmpDeductions, nXEmpDeductions) Call SetAddr(LEVEL3, "bXEmpAllowances", bXEmpAllowances, nXEmpAllowances) ' Define the cursors that are used by the application ' This is an example for a table in the System Database 'Call SqlCursor(c1, LEVEL0 + SqlSystemDb) Call SqlCursorEx(CSR_XPEmployees, LEVEL0, "CSR_XPEmployees", "XPEmployees", "XPEmployees") Call SqlCursorEx(CSR_XEmpScales, LEVEL1, "CSR_XEmpScales", "XEmpScales", "XEmpScales") Call SqlCursorEx(CSR_XEmpDeductions, LEVEL2, "CSR_XEmpDeductions", "XEmpDeductions", "XEmpDeductions") Call SqlCursorEx(CSR_XEmpAllowances, LEVEL3, "CSR_XEmpAllowances", "XEmpAllowances", "XEmpAllowances") ' ' ' This is an example for a table in an Application Database 'Call SqlCursor(c1, LEVEL0 ) ' Call the screen init function Call ScreenInit() mHandle_salary = DetailSetup(CSR_XEmpScales, DslGrid3, bXEmpScales.AddressOf("LineNBR"), bXEmpScales, PNULL, PNULL, PNULL) mhandle_deduction = DetailSetup(CSR_XEmpDeductions, DslGrid1, bXEmpDeductions.AddressOf("LineNBR"), bXEmpDeductions, PNULL, PNULL, PNULL) mhandle_allowances = DetailSetup(CSR_XEmpAllowances, DslGrid2, bXEmpAllowances.AddressOf("LineNBR"), bXEmpAllowances, PNULL, PNULL, PNULL) End Sub Private Sub Form1_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed 'Standard Screen Exit Call Call ScreenExit("", "") End Sub Private Sub DslGrid3_LineGotFocusEvent(ByRef maintflg As Short, ByRef retval As Short) Handles DslGrid3.LineGotFocusEvent If maintflg = NEWROW Then bXEmpScales.EmpID = bXPEmployees.EmpID bXEmpScales.Createby = bpes.UserId bXEmpScales.prog_id = bpes.ComputerName bXEmpScales.DateCreated = bpes.Today End If End Sub Private Sub DslGrid1_LineGotFocusEvent(ByRef maintflg As Short, ByRef retval As Short) Handles DslGrid1.LineGotFocusEvent If maintflg = NEWROW Then bXEmpDeductions.EmpID = bXPEmployees.EmpID bXEmpDeductions.Createby = bpes.UserId bXEmpDeductions.prog_id = bpes.ComputerName bXEmpDeductions.DateCreated = bpes.Today End If End Sub Private Sub DslGrid2_LineGotFocusEvent(ByRef maintflg As Short, ByRef retval As Short) Handles DslGrid2.LineGotFocusEvent If maintflg = NEWROW Then bXEmpAllowances.EmpID = bXPEmployees.EmpID bXEmpAllowances.Createby = bpes.UserId bXEmpAllowances.DateCreated = bpes.Today bXEmpAllowances.prog_id = bpes.ComputerName End If End Sub Private Sub cEmpID_ChkEvent(ByRef ChkStrg As String, ByRef RetVal As Short) Handles cEmpID.ChkEvent RetVal = PVChkFetch1(cEmpID, CSR_XPEmployees, ChkStrg, bXPEmployees) 'Call DetailLoad(DslGrid1) this failed to work '' Call DetailLoad(DslGrid3) End Sub End Class
What happens is that if i hit F3 button and i select an EmpID, the salary grid data is displayed..the other two dont. The salary grid is the one with Level 1.
Any hints on why the other two grids not displaying data?
Ronald
*This post is locked for comments
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156