Tried to follow most posts I saw, but... no dice. Text boxes not updating, but I can see the dataset has the changes saved to it

I am using some code on a form customization to add packs to a masterpack and when it finishes all the packs are added as expected, but none of the address fields are displaying the address or the ship to…

If I close the master pack and re-open it… the address loads into the appropriate textboxes.

Getting flustered at this point and don’t want to do something hacky, like close the form and re-open to see the changes.

I’ve tried this.oTrans.Refresh(), Update(), NotifyAll(), validatekeyfield(mytextbox), etc.

If anyone has any last tips they would be much appreciated.

Respectfully,

utah

jerry cant see GIF by HULU

1 Like


              //Get a Master Pack Adapter to add new packs

              MasterpackAdapter ma = new MasterpackAdapter(this.oTrans);

              ma.BOConnect();

 

      

              var test = ma.GetNewMasterpackDtl(15905);

 

              //CartonExists Check

              string status = ma.CheckShipStatus(123456, "Sales");

              bool test2 = ma.CartonExists(123456, "Sales");

             

              //Adding pack to master pack

              ma.MasterpackData.MasterPack[0]["RowMod"] = "U";

              var maDtl = ma.MasterpackData.MasterPackDtl[0]["RowMod"] = "A";

              ma.MasterpackData.MasterPackDtl[0]["DtlPackNum"] = 123456;                                        


              //GetShipDetails

              ma.GetShipDetails(mastPackNum,packNum, "Sales");

              ma.MasterpackData.MasterPack[0]["RowMod"] = "U";

              ma.Update();

              this.oTrans.Refresh();
		
              ma.Dispose();

 

}


                }

Try begin edit / end edit on your rows you modified.

OKay, I will try that.

The fields that aren’t showing the updates are these, both on the header and the detail.

getting a record not available error now.

Idk. Thank you for your suggestion :pray:

Is that the part that’s supposed to refresh the screen? (I’m still new at this)
Have you tried a GetByID at the end - to pull from the DB without having to refresh the screen? or is that crazy?

2 Likes

I tried it… I see that the address is there too…

It’s like if I clear the form and re-open it’s all perfect haha :sweat_smile:

so it’s gotta be something with notifying the form or somethign.

1 Like

@klincecum @jwphillips

I started doing some more debugging cause I wasn’t getting what I wanted trying to do everything the server trace was giving me so I did an after adapter method and popped up the adapter methods that were being called… That brought me to search ResetList() on here which got me to a post by none other than @Chris_Conn Order Release Method - #2 by Chris_Conn

I added that before my oTrans.Update() call like this and it worked! My form now displays the changes.

//this.ResetList(ResetListMode.AddRow, this.salesOrderData.Tables[0].Rows[num2]);
ma.ResetList(Ice.Lib.Adapters.ResetListMode.AddRow,ma.MasterpackData.MasterPack[0]);

ma.Update();

this.oTrans.Refresh();
	
ma.Dispose();

Maybe @Chris_Conn can explain what it is that ResetList is doing and what the reset list mode is for, or anyone else on here other than me… cause I have no clue… but it works… and I hate saying that and not knowing.

2 Likes

Just in case I ever go into biz for myself I gotta keep my cred up :rofl:

This code performs different tasks based on the value of mode. If mode is not set to ResetListMode.AddRow, it will find a row in the masterpackList table with a matching value for the “RowIdent” column. Once found, it stores the DataRow in listRow and breaks out of the loop.

If no rows are found, then listRow remains as null.

Next, it attempts to execute different operations based on the value of mode.

  • If mode is set to ResetListMode.AddRow, it will create a new DataRow with values from resetRow and store it in listRow. It then adds this newly created row to the table.

  • If mode is set to ResetListMode.DeleteRow, it will remove the listRow from the table.

  • If mode is set to ResetListMode.UpdateRow, it will update the values of listRow with values from resetRow. It also handles date time data type by checking its value and assigning it to the corresponding column in the row.

2 Likes

Yoooo haha after all that come to find out I think it was a caching problem :upside_down_face:

I feel like I wasn’t using it properly, though it worked. Thanks for taking the time to teach us man!

Essentially this ^^^

1 Like