Hello I am trying to add two fields (clientname and SSN) from a custom table to an existing grid in Cash Account Transaction Screen.
The fields are read only.
there are several problems with my code.
When I add the VBA_Mextend code to the Form_Display I can add the lines in the grid and it let me choose the name and ssn based on the clientid (User field in catran table). But when I click Save the last line is erased.
If I have click on the line below the last line and then click save then the batch will save with all the line correctly.
Private Sub Form1_Display()
Dim Handle As Integer
Handle = GetGridHandle("Spread1")
serr1 = VBA_Mextend(Handle, bxSBSCustom, LenB(bxSBSCustom))
End Sub
I thought that I should add the code to the Update1 event. But it still erases the last line and plus resets the name and ssn on all lines to the name and ssn on the first line.
Private Sub Update1_OnUpdate(Level As Integer, InsertFlg As Integer, retval As Integer)
Dim MaintFlag As Integer
Dim Handle As Integer
Dim RowNum As Integer
Dim tempclientid As String
tempclientid = GetObjectValue("xuser1")
Handle = GetGridHandle("Spread1")
RowNum = MGetRowNum(Handle)
serr = MFirst(Handle, MaintFlag)
Do While serr = 0
Call SqlFetch1(CSR, "xSBSCustom_All" + SParm(tempclientid), bxSBSCustom, LenB(bxSBSCustom))
Call MUpdate(Handle)
serr = MNext(Handle, MaintFlag)
Loop
Call msetrownum(Handle, RowNum)
Call MDisplay(Handle)
End Sub
*This post is locked for comments
Hi,
This question is best posed in a support case where we could obtain all of your code/files and further troubleshoot.
Community Member
136
Mohamed Amine Mahmoudi
102
Super User 2025 Season 1
REUser
8