TOPIC: POS
#237
miroslavt

POS 4 Years, 3 Months ago
Hi,
First, I find error in EuroNumberContol. There is no font, size and weight parameters.
Ok, after writing litle POS application, i want to speed up data entry. I use Access control with Browse control for master-detail relation. In Access I use startNew, and after printing receipt .Access.On_New().
1. In Access form there is two fields, rcp_num and date, filed from Rule_, so I want to skip that fields and get focus on Browse window, automaticly insert empty record
2. In Browse there is 3 fields, barcode, qty and price. After enter barcode, qty and price is filed from Rule_. How I can bypass qty and price field and automatic go in next (blank) record (simulating presing key TAB twice)?
 
 
#238
Re:POS 4 Years, 3 Months ago
Hello,

1. AccessControl sends a message called "Access_AfterNewRecord" to its Controller when a new record is started in the AccessControl. When your controller gets this message, you could call the AddRecord method of BrowseControl and then the Edit method of BrowseControl to start editing. You need to pass the column, row and amt arguments to the Edit method. I believe amt should be 1 (move 1 cell at a time when editing...). If you want to look at the definition of the Edit method, you will actually find it in ListControl since it is redirected there.

2. I have not tested this, but you might be able to define a "Browse_CellEdit" method in your controller, which is a message sent from the BrowseControl. Your method should have parameters for col, row, and record. Return true to allow editing the column, or false to not allow editing. You should be able to use this message to "skip" over fields.

Another thing you could try is protecting the fields you don't want the user to enter. You could use BrowseControl's protectField option to do this, or define a rule called Rule_yourfieldnamehere__protect and return true to protect it, false not to protect it. The name of the rule is the field name with "__protect" suffix.

Hope that helps.
 
 
Jeff Ferguson
Suneido Software
 
#239
Re:POS 4 Years, 3 Months ago
2. I used this:
Code:


Browse_AfterEdit( col, row, data, valid?, record)
    {
    if(col is 1 and record.Member?('Browse_NewRecord') is true)
{
record._browse.AddRecord(Object())
record._browse.Edit(1, row+1, 1, canMoveRows: false)
}
    }


and this work, but in
1. I try this:
Code:


Access_NewRecord()
    {
    if(.Member?('Access'))
{
browse = .Access.GetControl('kasa_id')
browse.AddRecord(Object())
browse.Edit(1, 1, 1, canMoveRows: false)
}
    }


but without sucess. Why?
 
 
#240
miroslavt

Re:POS 4 Years, 3 Months ago
Hello,
For test, i put Button "Novo" on Access form, and this code:
Code:

On_Novo()
{
if(.Member?('Access'))
{
browse = .Access.GetControl('kasa_id')
browse.AddRecord(Object())
browse.Edit(1, 0, 1, canMoveRows: false)
}
}


When I click on button "Novo", it working (new record is addeded in details, and i got focus on first field (barcode).
But when a call On_Novo from Access_NewRecord(), that not work. Why?
 
 
#241
Re:POS 4 Years, 3 Months ago
The reason it is not working in Access_NewRecord is because that message gets sent from AccessControl before Access sets the focus to the first edit field. A new message has recently been added to AccessControl called Access_AfterNewRecord. I tested using this message and it works. If your version of AccessControl does not send this message, you can add it at the very end of AccessControl's On_New method. It should pass .data to the controller.

One other minor thing, you should pass Record() instead of Object() to browse's AddRecord method since browse expects it to behave like a record.
 
 
Jeff Ferguson
Suneido Software
 
#243
Re:POS 4 Years, 3 Months ago
Helo,
Yes, I have sept. 2005 version, beacuse a new one didnt work on win 98.
Now work, thnks for help.