Save data to UD100 and UD100A from a form

It's Vantage 8.03.409C 



---In vantage@yahoogroups.com, <jckinneman@...> wrote:

<humor> Must be due to all the missing semi-colons... <humor>

If you are on E9, you can use the Add UD child wizard to write most of the code and then adjust as needed.


Jim Kinneman

Encompass Solutions.



---In vantage@yahoogroups.com, <kirianno@...> wrote:

Hello,


I have added fields on LotNumberEntry that are the same as some fields I added to UD100 and UD100A. They are hooked up to the UD100 Adapter and I can bring data in FROM the UD100 and UD100A just fine. I'm using the Update method but the data never saves BACK to UD100. Can anyone tell me why?


Here is my 'Save' button click event.


 Dim UD100Adapter as UD100Adapter = New UD100Adapter(oTrans)
        UD100Adapter.BOConnect() 
       
            If (UD100Adapter.GetaNewUD100())
                Dim irowCount as Integer = UD100Adapter.UD100Data.UD100.Rows.Count
                Dim edvUD100Row as DataRow = UD100Adapter.UD100Data.UD100.Rows(irowCount-1)
                edvUD100Row.BeginEdit()
                edvUD100Row("Key1") = txtDetailJobNum.text
                edvUD100Row("Key2") = txtDetailLotNum.text           
                edvUD100Row("Key3") = String.Empty
                edvUD100Row("Key4") = String.Empty
                edvUD100Row("Key5") = String.Empty
                edvUD100Row.EndEdit()
                edvUD100Row.AcceptChanges()
                UD100Adapter.Update()
               
                    If (UD100Adapter.GetaNewUD100a(txtDetailJobNum.Text, txtDetailLotNum.text, String.Empty, String.Empty, String.Empty ))
                    Dim irowCountA as Integer = UD100Adapter.UD100Data.UD100A.Rows.Count     
                    Dim edvUD100ARow as DataRow = UD100Adapter.UD100Data.UD100A.Rows(irowCountA-1)
                    edvUD100ARow.BeginEdit()
                    edvUD100ARow("ChildKey1") = ucbDefectCodes.value
                    edvUD100ARow("ChildKey2") = txtCoreOut.text
                    edvUD100ARow("ChildKey3") = String.Empty
                    edvUD100ARow("ChildKey4") = String.Empty
                    edvUD100ARow("ChildKey5") = String.Empty
                    edvUD100ARow.EndEdit()
                    edvUD100ARow.AcceptChanges()
                   
                    UD100Adapter.Update()
                    End If
            End If
            UD100Adapter.Dispose()

Hello,


I have added fields on LotNumberEntry that are the same as some fields I added to UD100 and UD100A. They are hooked up to the UD100 Adapter and I can bring data in FROM the UD100 and UD100A just fine. I'm using the Update method but the data never saves BACK to UD100. Can anyone tell me why?


Here is my 'Save' button click event.


 Dim UD100Adapter as UD100Adapter = New UD100Adapter(oTrans)
        UD100Adapter.BOConnect() 
       
            If (UD100Adapter.GetaNewUD100())
                Dim irowCount as Integer = UD100Adapter.UD100Data.UD100.Rows.Count
                Dim edvUD100Row as DataRow = UD100Adapter.UD100Data.UD100.Rows(irowCount-1)
                edvUD100Row.BeginEdit()
                edvUD100Row("Key1") = txtDetailJobNum.text
                edvUD100Row("Key2") = txtDetailLotNum.text           
                edvUD100Row("Key3") = String.Empty
                edvUD100Row("Key4") = String.Empty
                edvUD100Row("Key5") = String.Empty
                edvUD100Row.EndEdit()
                edvUD100Row.AcceptChanges()
                UD100Adapter.Update()
               
                    If (UD100Adapter.GetaNewUD100a(txtDetailJobNum.Text, txtDetailLotNum.text, String.Empty, String.Empty, String.Empty ))
                    Dim irowCountA as Integer = UD100Adapter.UD100Data.UD100A.Rows.Count     
                    Dim edvUD100ARow as DataRow = UD100Adapter.UD100Data.UD100A.Rows(irowCountA-1)
                    edvUD100ARow.BeginEdit()
                    edvUD100ARow("ChildKey1") = ucbDefectCodes.value
                    edvUD100ARow("ChildKey2") = txtCoreOut.text
                    edvUD100ARow("ChildKey3") = String.Empty
                    edvUD100ARow("ChildKey4") = String.Empty
                    edvUD100ARow("ChildKey5") = String.Empty
                    edvUD100ARow.EndEdit()
                    edvUD100ARow.AcceptChanges()
                   
                    UD100Adapter.Update()
                    End If
            End If
            UD100Adapter.Dispose()

<humor> Must be due to all the missing semi-colons... <humor>

If you are on E9, you can use the Add UD child wizard to write most of the code and then adjust as needed.


Jim Kinneman

Encompass Solutions.



---In vantage@yahoogroups.com, <kirianno@...> wrote:

Hello,


I have added fields on LotNumberEntry that are the same as some fields I added to UD100 and UD100A. They are hooked up to the UD100 Adapter and I can bring data in FROM the UD100 and UD100A just fine. I'm using the Update method but the data never saves BACK to UD100. Can anyone tell me why?


Here is my 'Save' button click event.


 Dim UD100Adapter as UD100Adapter = New UD100Adapter(oTrans)
        UD100Adapter.BOConnect() 
       
            If (UD100Adapter.GetaNewUD100())
                Dim irowCount as Integer = UD100Adapter.UD100Data.UD100.Rows.Count
                Dim edvUD100Row as DataRow = UD100Adapter.UD100Data.UD100.Rows(irowCount-1)
                edvUD100Row.BeginEdit()
                edvUD100Row("Key1") = txtDetailJobNum.text
                edvUD100Row("Key2") = txtDetailLotNum.text           
                edvUD100Row("Key3") = String.Empty
                edvUD100Row("Key4") = String.Empty
                edvUD100Row("Key5") = String.Empty
                edvUD100Row.EndEdit()
                edvUD100Row.AcceptChanges()
                UD100Adapter.Update()
               
                    If (UD100Adapter.GetaNewUD100a(txtDetailJobNum.Text, txtDetailLotNum.text, String.Empty, String.Empty, String.Empty ))
                    Dim irowCountA as Integer = UD100Adapter.UD100Data.UD100A.Rows.Count     
                    Dim edvUD100ARow as DataRow = UD100Adapter.UD100Data.UD100A.Rows(irowCountA-1)
                    edvUD100ARow.BeginEdit()
                    edvUD100ARow("ChildKey1") = ucbDefectCodes.value
                    edvUD100ARow("ChildKey2") = txtCoreOut.text
                    edvUD100ARow("ChildKey3") = String.Empty
                    edvUD100ARow("ChildKey4") = String.Empty
                    edvUD100ARow("ChildKey5") = String.Empty
                    edvUD100ARow.EndEdit()
                    edvUD100ARow.AcceptChanges()
                   
                    UD100Adapter.Update()
                    End If
            End If
            UD100Adapter.Dispose()