- 
                            
                                
                            
                            Tracy Lamb
                         - PowerBuilder
 - Monday, 26 September 2022 10:51 PM UTC
 
My again... this is still giving me trouble I didn't notice before...
When I drag/drop from one SalesOrder to another, I have to change the sales_order in the database, and assign a new line number. After that, I update both the current dw and the source dw. But for some reason the updates aren't happening... WorkOrders don't move to new SalesOrder. On the screen, everything seems to have worked just fine. If I close both SalesOrder windows and re-open them, the original WorkOrders are still there (ie: They didn't move). Must be something wrong with my logic... but I can't figure it out.
CHOOSE CASE drag_dw
	CASE this
                ... Do stuff
		this.Drag(End!)
	CASE ELSE
//		 Move the Work Order from the source Sales Order to this one...
		ll_DragRow = drag_dw.GetSelectedRow( 0 )
		ll_DropRow = this.RowCount() + 1
		drag_dw.RowsCopy( ll_DragRow, ll_DragRow, Primary!, this, ll_DropRow, Primary! )
		
		this.SetItem( ll_DropRow, "sales_order", il_FormID )
		//	Add line_nbr to new row
		this.SetItem( ll_DropRow,"line_nbr", ll_DropRow)
		this.SetItemStatus( ll_DropRow, 0, Primary!, DataModified! )
		this.SelectRow(0, FALSE)
		this.ScrollToRow(ll_DropRow)
		this.SelectRow(ll_DropRow, TRUE)
//		 Renumber the lines on the Source DW
		drag_dw.RowsDiscard( ll_DragRow, ll_DragRow, Primary! )
		ll_LastRow = drag_dw.RowCount()
		ll_ThisRow = ll_DragRow
		do while ll_ThisRow <= ll_LastRow
			drag_dw.SetItem( ll_ThisRow, "line_nbr", ll_ThisRow )
			ll_ThisRow ++
		loop
		drag_dw.SelectRow(0, FALSE)
		drag_dw.Drag(End!)
END CHOOSE
this.Update(TRUE,TRUE)
drag_dw.Update(TRUE,TRUE)
Any help is greatly appreciated.
~~~Tracy
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.