Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem adding records to tableframe

Status
Not open for further replies.

tminifie

Programmer
Sep 22, 2006
1
Hi
I'm working on a Inventory/Sales order system and I am having difficulty adding multiple records to a tableframe. Below is an example of the result that I am getting.

Sales Order Form
Order Lot Cut Description UpDn Grade Cnt Price
1234 1234 109 Export Ribs Up CAB 10
5678 5678 109 Export Ribs Up CAB 7
8916 5678 109 Export Ribs Up CAB

The idea here is that the user fills in the "Cut"(109 in this example), the "Description" is defaulted, the user fills in the "UpDn", the user fills in the "Grade" and the user fills in the "Cnt". In this example the user filled in 20 under "Cnt". I have code in the changeValue() of the "Cnt" field. The code essentially checks inventory to see if there is enough product in this case "109 Export Ribs" to satisfy the order of amount of 20. In this case there was only 10 cartons remaining under "Order" 1234 so you see 10 under "Cnt" above taken from "Order" 1234. Then on the next line you see that "Order" 5678 has 7 under "Cnt". That leaves us with 3 more Cartons to fill the Sales Order. "Order" 8916 has 3 cartons remaining but you don't see 3 under "Cnt" above. That is the bug I'm trying to resolve. I see 3 under "Cnt" field for a split second but the focus moves to the "Price" field on the first record and the "Cnt" field goes blank on the third record. I'm using uiSalesItm.attach(SALESITM)
uiSalesItm.action(DataNextRecord)
to move and insert a new record in the tableframe. When I attempt to walk through my code with the debugger I get the following error message:

Warning: record already locked in this session

I don't know if the action(DataNextRecord) method is the right approach???

Any suggestions would be appreciated.

Thanks
Todd



 
Basically, you want to do some quickie error correction to change Cnt to the remaining amount in stock when the user types a number that's too high?

I think I'd add 2 calculated fields to the table:
"StockQty" which is set to the amount in the stock table
"ShipQty" which is set to the lower of Cnt and StockQty

This processing would be done when the record is submitted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top