Integrate a browse into a "getfield" of 2nd Browse
Moderator: Rathinagiri
Integrate a browse into a "getfield" of 2nd Browse
Hi All,
In clipper 5.3b and xHarbour we have the following command to integrate a browse into a get:
@ <nTop>, <nLeft>, <nBottom>, <nRight>
GET <idVar>
TBROWSE <oBrowse>
[MESSAGE <cMessage>]
[WHEN <lPreExpression>]
[VALID <lPostExpression>]
[SEND <msg>]
[GUISEND <guimsg>]
Is some thing similar available in HMG ?
A fairly simple case:
In case a user is entering details of an invoice stored in the dbf invoicedetails.dbf in the format:
Item qty rate amount
wherein the Names and other details of the items being billed are stored in a dbf called say "itmmaster". With the above command in clipper / xharbour it was easy to integrate a TBrowse object showing ItemNames from the "itmmaster" into the invoicedetails "itemfield", and after user selection of itemname from the itmmaster browse object one could store the item code into the invoicedetail itemfield.
How can this be achieved in HMG browse. Pls guide me.
It is important that the ItmNames browse must be visible both while adding new entries or while editing existing entries.
Warm regards,
Jayadev
In clipper 5.3b and xHarbour we have the following command to integrate a browse into a get:
@ <nTop>, <nLeft>, <nBottom>, <nRight>
GET <idVar>
TBROWSE <oBrowse>
[MESSAGE <cMessage>]
[WHEN <lPreExpression>]
[VALID <lPostExpression>]
[SEND <msg>]
[GUISEND <guimsg>]
Is some thing similar available in HMG ?
A fairly simple case:
In case a user is entering details of an invoice stored in the dbf invoicedetails.dbf in the format:
Item qty rate amount
wherein the Names and other details of the items being billed are stored in a dbf called say "itmmaster". With the above command in clipper / xharbour it was easy to integrate a TBrowse object showing ItemNames from the "itmmaster" into the invoicedetails "itemfield", and after user selection of itemname from the itmmaster browse object one could store the item code into the invoicedetail itemfield.
How can this be achieved in HMG browse. Pls guide me.
It is important that the ItmNames browse must be visible both while adding new entries or while editing existing entries.
Warm regards,
Jayadev
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Integrate a browse into a "getfield" of 2nd Browse
In this case, I would rather use a Grid control with 'cell navigation on' and 'inplaceedit'. The result would be a two dimensional array, which can be stored in the dbf while pressing 'Save' button.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Integrate a browse into a "getfield" of 2nd Browse
Hello Jayadev,
Rathi is correct. Grid is a better control, IMHO. However there are different opinion for this also
I tried same thing when I started HMG. I hope this will be helpful viewtopic.php?f=15&t=256 (and go to Page 3, if you want immediate solution, otherwise start from page 1).
Please note that, Grid control has tremendous improvement after this project. And ON CHANGE event for grid also changed.
With best regards.
Sudip
Rathi is correct. Grid is a better control, IMHO. However there are different opinion for this also

I tried same thing when I started HMG. I hope this will be helpful viewtopic.php?f=15&t=256 (and go to Page 3, if you want immediate solution, otherwise start from page 1).

Please note that, Grid control has tremendous improvement after this project. And ON CHANGE event for grid also changed.
With best regards.
Sudip
With best regards,
Sudip
Sudip
Re: Integrate a browse into a "getfield" of 2nd Browse
Dear Rathinagiri / Sudip,
Many thanks for your guidance. I have also gone thru Sudip's one2many demo. Excellent program I must say. But I have my reservations. Both the Grid Control and the Combo box use an "array" to control the display and not the "database".
Consider a case where a customer uses an item master of about 3000- 4000 items and also assume that an equal number of sales invoices are also made in a year. Also assume that the whole system is multiuser (5-10 users) located at different geographical locations.
In such a scenario it is difficult to create an array each time a user wants to add or edit an item in an invoice. This Mr. Swapan had also pointed out in his query to Mr. Sudip. Further the items and their rates are subject to change. So we cannot have one array at start up of the invoice module which can be displayed for the duration the user is in the invoice updation module. Such big character arrays will also eat the memory.
To my mind, what comes as a solution (with my little knowledge) is:
1. Create a browse (tbrowse) for the itemmaster database and hide it.
2. Create another browse (tbrowse) for invoice database, when the user is on the selection of item (during add or edit) show the browse as per point one, store the item code in browse 2 with suitable display for the item name in browse 2
3. Integration of the browse 1 with browse 2 can be through the valid clause of the browse 2 item selection column.
With my limited knowledge of HMG I am not able to program the whole process.
May be one of the GURUs here will help me.
I have always written programs which are "codeless", ie. the user does not have to remember any code say for example that of an item or of a spare part. The user always selects from a list and hence THIS INTEGRATION OF ONE BROWSE INTO ANOTHER IS VERY IMPORTANT for my programs. Is it possible ?
Warm regards,
Jayadev.
Many thanks for your guidance. I have also gone thru Sudip's one2many demo. Excellent program I must say. But I have my reservations. Both the Grid Control and the Combo box use an "array" to control the display and not the "database".
Consider a case where a customer uses an item master of about 3000- 4000 items and also assume that an equal number of sales invoices are also made in a year. Also assume that the whole system is multiuser (5-10 users) located at different geographical locations.
In such a scenario it is difficult to create an array each time a user wants to add or edit an item in an invoice. This Mr. Swapan had also pointed out in his query to Mr. Sudip. Further the items and their rates are subject to change. So we cannot have one array at start up of the invoice module which can be displayed for the duration the user is in the invoice updation module. Such big character arrays will also eat the memory.
To my mind, what comes as a solution (with my little knowledge) is:
1. Create a browse (tbrowse) for the itemmaster database and hide it.
2. Create another browse (tbrowse) for invoice database, when the user is on the selection of item (during add or edit) show the browse as per point one, store the item code in browse 2 with suitable display for the item name in browse 2
3. Integration of the browse 1 with browse 2 can be through the valid clause of the browse 2 item selection column.
With my limited knowledge of HMG I am not able to program the whole process.
May be one of the GURUs here will help me.
I have always written programs which are "codeless", ie. the user does not have to remember any code say for example that of an item or of a spare part. The user always selects from a list and hence THIS INTEGRATION OF ONE BROWSE INTO ANOTHER IS VERY IMPORTANT for my programs. Is it possible ?
Warm regards,
Jayadev.
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Integrate a browse into a "getfield" of 2nd Browse
In that case, we can use SQL based tables (my choice is MySQL).
The item name/code/rate can be retrieved by a query at the time of adding the item to the invoice, so that, the recent updated data is captured. Once added, the line data can be added to a grid. Once, the line by line entry is over, the invoice can be saved in full.
If the number of items are more, I won't prefer browse or even combo box. I would let the user start typing name/code or through a bar code reader (Do we have any specific codes for Bar codes in HMG?). After that we can search for the item in the master file.
The item name/code/rate can be retrieved by a query at the time of adding the item to the invoice, so that, the recent updated data is captured. Once added, the line data can be added to a grid. Once, the line by line entry is over, the invoice can be saved in full.
If the number of items are more, I won't prefer browse or even combo box. I would let the user start typing name/code or through a bar code reader (Do we have any specific codes for Bar codes in HMG?). After that we can search for the item in the master file.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Integrate a browse into a "getfield" of 2nd Browse
Hi,
This is for a Footwear manufacturer and retailer. In their POS software they use hand held Barcode Scanner or manually type the code. As they have more than 5000 items each item has different sizes
I used grid in that software (and it runs ok).
There is another point. Canceling a change (Add or Modify) in a Grid is Easier than Browse. Again IMHO, using Browse is difficult for MySql. RDD for MySql is not fully complete (ref viewtopic.php?f=5&t=446).
I got some tips regarding browse from MOL. Please, check previous posts about browse.
With best regards.
Sudip
I agree with Rathi. I already have this type of application developed with another software tool.rathinagiri wrote:In that case, we can use SQL based tables (my choice is MySQL).
The item name/code/rate can be retrieved by a query at the time of adding the item to the invoice, so that, the recent updated data is captured. Once added, the line data can be added to a grid. Once, the line by line entry is over, the invoice can be saved in full.
If the number of items are more, I won't prefer browse or even combo box. I would let the user start typing name/code or through a bar code reader (Do we have any specific codes for Bar codes in HMG?). After that we can search for the item in the master file.


There is another point. Canceling a change (Add or Modify) in a Grid is Easier than Browse. Again IMHO, using Browse is difficult for MySql. RDD for MySql is not fully complete (ref viewtopic.php?f=5&t=446).
I got some tips regarding browse from MOL. Please, check previous posts about browse.
With best regards.
Sudip
With best regards,
Sudip
Sudip
Re: Integrate a browse into a "getfield" of 2nd Browse
OKrathinagiri wrote:In that case, we can use SQL based tables (my choice is MySQL).
Could u elaborate on this further, say we run a query "select itmName,ItmCode,ItmRate from ItmMast", where do you save the result ? in an array, and show the user in a combobox, wherein as the user types in the itemname, the itemnames below scroll and he selects the correct item ?, is this what you intended ? Am I understanding correctly.rathinagiri wrote: The item name/code/rate can be retrieved by a query at the time of adding the item to the invoice, so that, the recent updated data is captured. Once added, the line data can be added to a grid. Once, the line by line entry is over, the invoice can be saved in full.
After we search the items (from whatever little he has entered), the user will have to be shown all the matches from the master, again in an array thru combo-box I suppose.rathinagiri wrote: If the number of items are more, I won't prefer browse or even combo box. I would let the user start typing name/code or through a bar code reader (Do we have any specific codes for Bar codes in HMG?). After that we can search for the item in the master file
Why do you not recommend browse ? Any specific reason, are they slow ?
Warm regards,
Jayadev
Re: Integrate a browse into a "getfield" of 2nd Browse
You published the results of the user query( after he typed the query) in the grid I presume.I agree with Rathi. I already have this type of application developed with another software tool.This is for a Footwear manufacturer and retailer. In their POS software they use hand held Barcode Scanner or manually type the code. As they have more than 5000 items each item has different sizes
I used grid in that software (and it runs ok).
Or are you saying that the invoice itself be treated as a grid with the itemname being one of the "items" ? I am a bit confused.
[qoute]
There is another point. Canceling a change (Add or Modify) in a Grid is Easier than Browse. Again IMHO, using Browse is difficult for MySql. RDD for MySql is not fully complete (ref viewtopic.php?f=5&t=446).
[/qoute]
You can use OTC's Mediator for MYSQL, excellent tool, it is free for MYSQL and your commands do not change as far as the databases are concerned. You use them with regular clipper syntax.
[qoute]
I got some tips regarding browse from MOL. Please, check previous posts about browse.
[/quote]
Shall check your posts, and revert.
Thank you and Rathinagiri for all the interest shown.
Warm regards,
Jayadev
Re: Integrate a browse into a "getfield" of 2nd Browse
Hi Jayadev,

I want to get ideas from others
Regarding my existing software, it uses grid. That grid is a container class, but detailed discussion this is beyond the scope of this forum
I didn't use SQL in that software
Regarding OTC's Mediator for MySql, can you please send the url ?
Regards.
Sudip
I am very happy to discuss with you. Hope that I shall get many ideas from youjayadevu wrote:You published the results of the user query( after he typed the query) in the grid I presume.
Or are you saying that the invoice itself be treated as a grid with the itemname being one of the "items" ? I am a bit confused.
...
...
You can use OTC's Mediator for MYSQL, excellent tool, it is free for MYSQL and your commands do not change as far as the databases are concerned. You use them with regular clipper syntax.

I want to get ideas from others

Regarding my existing software, it uses grid. That grid is a container class, but detailed discussion this is beyond the scope of this forum


Regarding OTC's Mediator for MySql, can you please send the url ?

Regards.
Sudip
With best regards,
Sudip
Sudip
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Integrate a browse into a "getfield" of 2nd Browse
Yes. You are grasping perfectly.Could u elaborate on this further, say we run a query "select itmName,ItmCode,ItmRate from ItmMast", where do you save the result ? in an array, and show the user in a combobox, wherein as the user types in the itemname, the itemnames below scroll and he selects the correct item ?, is this what you intended ? Am I understanding correctly.
On second thinking, I had got this. The first priority here is 1. Network Resources (You said the systems are location-wise apart.) 2. Whether there are Frequent updation to the master files (at least the name of the item.)?
In the case of LAN, it is easy to retrieve the list of items in an array (when the user starts typing) and show in a combo box. The rate and other particulars can be retrieved once the item is selected on the control's lostfocus event.
In the case of Internet based database, it would be easy to download the master data in an array and update the same in frequent intervals. This would be both for Grid based or Browse based controls.
Now, IMHO in-place edit in Browse control is the first priority to Roberto. Soon, it would come.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.