1 (edited by amphibian 2024-06-05 20:59:04)

Topic: choose from catalogue

hey everyone, i‘m new to mvd and i love this tool already. :-) however, i need help with a project. i would like to have a table that can be used as a „catalogue“, consisting of a large amount of records (like text modules/boilerplates). on a form A, i enter different fields and would like to fill the rest of it with the entries of the „catalogue“. for doing this, a new form should open up showing all possible catalogue entries within a tablegrid.

can anyone help me pls.
would this also be doable with records containing child records?

thx a lot in advance

Re: choose from catalogue

Hi,
Welcome to MVD.
There are quite a few ways of doing what you've asked about.
Have a look at one option (see attached) that uses 'vanilla' MVD.  And within 'standard' MVD there are a number of variations on how to do this (and that's even before you (optionally) venture into writing bits of code).
In the attached example, simply enter a part no', a part description or a supplier (the 'search' feature is incremental) and the tablegrid displays matching rows.  Double click on the required row to fill in the relevant fields.
With any future questions, if you can include your project (delete the .exe file and then zip up the remaining files), it makes it a lot easier to give more focused suggestions.
Please note that MVD is no longer being actively developed although its feature set is rich and caters for most requirements. 
Support continues to be offered through the Forum.
Regards,
Derek.

Post's attachments

Attachment icon amphibian.zip 453.35 kb, 41 downloads since 2024-06-05 

3 (edited by amphibian 2024-06-05 21:05:14)

Re: choose from catalogue

hey derek, thx a lot for your response and the attached example. that's not exactly what i am looking for, i attached an example of my project. when creating a new main entry, i want to choose the records from the tablegrid of the catalogue form to be filled into the red fields in the main entry and saved to the main table by clicking the button.

thx for your support!

Post's attachments

Attachment icon amphibian.zip 336.5 kb, 38 downloads since 2024-06-05 

Re: choose from catalogue

Hi,
Thanks for the project - it makes things a bit clearer now.
Just a couple of questions before offering any suggestions;
1.  when creating or maintaining a 'main' record, once you select entries from the 'catalogue' table into your 'main' record, do you then ever make any manual adjustments to 'main_add.memo1' and 'main_add.memo2' or is it always exactly as copied from the 'catalogue' table (the reason for asking is that you don't have a relationship between the 'catalogue' and 'main' tables).
2.  does 'catalogue.field1' always get copied into 'main.cataolgue1' and 'catalogue.field2'. into 'main.catalogue2' or can 'catalogue.field1'. ever go into 'main.catalogue2' and vice versa?
3.  do 'main.catalogue1' and 'main.catalogue2' always get taken from the same row in the 'catalogue' table?  Or, for example, could you select the 'catalogue.field1' value from row 7 in the 'catalogue' table and the 'catalogue.field2' value from row 12 in the 'catalogue' table.  In other words, can you 'mix and match' or do 'catalogue.field1' values and 'catalogue.field2' values always come as pairs?
None of the above presents any problems to MVD, I just want to get a better understanding of how you see it working.
Regards,
Derek.

5 (edited by amphibian 2024-06-06 15:03:40)

Re: choose from catalogue

hey derek, thx for your reply! regarding your questions pls see following requirements in red.


1.  when creating or maintaining a 'main' record, once you select entries from the 'catalogue' table into your 'main' record, do you then ever make any manual adjustments to 'main_add.memo1' and 'main_add.memo2' or is it always exactly as copied from the 'catalogue' table (the reason for asking is that you don't have a relationship between the 'catalogue' and 'main' tables). --> yes, entering main records, i want to make manual adjustements to every field, also to the two ones from the catalogue. therefore, i am not using relations and comboboxes.


2.  does 'catalogue.field1' always get copied into 'main.cataolgue1' and 'catalogue.field2'. into 'main.catalogue2' or can 'catalogue.field1'. ever go into 'main.catalogue2' and vice versa? --> no, they strictly go the the first mentioned fields, no exchange here


3.  do 'main.catalogue1' and 'main.catalogue2' always get taken from the same row in the 'catalogue' table?  Or, for example, could you select the 'catalogue.field1' value from row 7 in the 'catalogue' table and the 'catalogue.field2' value from row 12 in the 'catalogue' table.  In other words, can you 'mix and match' or do 'catalogue.field1' values and 'catalogue.field2' values always come as pairs? --> no mix and match here, catalogue.field1 and 2 are always from the same row


many thanks in advance for your kind help! :-)

Re: choose from catalogue

Hi,
So I'm guessing something like the attached.
I've reduced the number of forms but only to make it faster to enter data (mainly by putting the catalogue tablegrid on the 'main_add' form which saves you having to repeatedly open up and close a second form).
I've added search options for the tablegrids on 'main_show' and 'main_add' - once you've got more rows of data added, you're almost certain to need them.  In both cases, the searches are 'fuzzy' and look across all fields rather than the user having to work out which search field might relative to what).
Lastly, once the 'standard' catalogue entries have been copied to the 'main' table, they can then be manually changed, added to etc.
Hope this gets you progressing.
Regards,
Derek.

Post's attachments

Attachment icon copy both from tablegrid.zip 348.03 kb, 54 downloads since 2024-06-06 

7 (edited by amphibian 2024-06-06 18:10:03)

Re: choose from catalogue

hey derek, that's exactly what i was searching for, many thanks! :-) however, trying to reproduce the script in my own application, it does not work. do i have to change some properties of the tablegrid or the fields? many thanks in advance!

Re: choose from catalogue

okay, got it. i had to set the event for the procedure on tablegrid1.

Re: choose from catalogue

Hi,
Please have a look at the attached screenshot.
Anything on a form in MVD is called an 'object'.; an 'object' can be a text box, a combobox, a tablegrid, the form itself etc etc.
Each 'object' can have a number of 'events' associated with it;  each of these 'events' can have a procedure written against it.
In your example, the 'object 'is the 'tablegrid' (gbu.tablegrid1) and the 'event' against which you want something to happen is 'OnCellClick;
What you need to do is to create an empty 'procedure' in which you can write some code and you can't just create this empty procedure by typing directly into the script. 
Instead, an empty procedure is created by selecting the 'event' (in this case 'OnCellClick' and then double-clicking. Once you've done this, go to the 'script' tab and you will see the empty procedure that has been created.
Note that if you double click on 'event', MVD will automatically create the empty procedure using a default name (a combination of the form name, the 'object' name and the 'event' name (in your example gbu_TableGrid1_OnCellClick).  However, you do not have to use the default 'procedure' name and can simply type in your own name and then double-click (and there are reasons when it is appropriate to do this).
Regards,
Derek.

Post's attachments

Attachment icon screenshot01.jpg 104.31 kb, 12 downloads since 2024-06-06 

Re: choose from catalogue

thank you so much for the explanation and your kind support, derek! :-)