Topic: Filter a table that has already been opened

Hello all,

I am new to MVD and this is my first project so please keep this simple. I need to demo this to the client in a week or two.

The application keeps a record of service jobs on electronic equipment. The item is booked in recording its model, fault, serial number etc etc. I have a table grid which shows the list of jobs and I use the new record action on a button to add a new record.

Next to the "Serial Number" edit box field on the booked job form I have a button with the caption "Check History" on it. This button uses a action to open another form which has a table grid and I have attempted to have a filter on the action form which limits records displayed to previously entered records with the same serial number as the new job booked in. This allows the user to see previous service history of an item arriving for servicing.

I am having loads of trouble making this work. Because the table is already opened to add the new record, is there a limitation that I cannot open the same table in another form at the same time.

I hope that makes some kind of sense.

Thanks in advance,
David

Re: Filter a table that has already been opened

Hello,


Please attach your project (zip file without exe and dll)

Dmitry.

Re: Filter a table that has already been opened

Hi David, Dmitry,
Welcome to MVD - good choice!
There isn't any restriction on what you are trying to do and I'm sure Dmitry will be able to give you some neat alternative ways of achieving what you want.
But your scenario sounds a lot like something I've just finished.  So I've quickly hacked a copy of it and changed the labels so that it's easier for you to relate to. 
In my example, I don't bother having a separate button to show service history (it's one more thing to click!) and have it all on the same form which makes it very straightforward;  'open' service items are sorted to the top of the service history tablegrid and 'closed' items are then displayed below that.  If you prefer, you could use 2 tablegrids (again, all on the same form) with the 'open' service record in one grid and the 'closed' service records in the second grid.  If you need showing how that's done, just let me know.
All of this is without having to write any scripts etc so it keeps things nice and simple.
Good Luck and I hope this helps to point you in the right direction.
Derek

Post's attachments

Attachment icon david demo.zip 337.85 kb, 445 downloads since 2016-01-27 

Re: Filter a table that has already been opened

Gentlemen, thank you for the responses. I had to send the whole project to the Drive email address as the client has commercial sensitivity with the project. I hope that is ok.

Thank you Derek for the sample. I will be studying it over the next few days. I really appreciate it.

I got MVD late last year and am using version 2.2 and am wondering if I am best to now be using 2.3.

There is a lot to like about MVD and when I have a bit more experience I will write a post about it.

Thanks again, David.

Re: Filter a table that has already been opened

Derek,

your approach is that you record each item (eg a fridge) and its main details only once and then a service event is recorded for that item.

My application books the item each time it arrives for servicing and this involves recording the model and serial number etc although it is made easier with the use of drop down boxes. I like your approach and need to think further about my design and how the client will use it.

I am intending for the current application to go into service over the next month or so using MySQLite and then start the process of upgrading it to MySQL Community Edition for install in the second half of the year. I have never MySQL either. There are potentially 15 users with the data stored on a server but the likelihood of simultaneous edits of a record is negligible.

Thanks again for everything, David.

Re: Filter a table that has already been opened

Hi David,
In "strict" database design terms, you should look to only hold repeating data once (although we all know that rules are made to be broken - LOL!).  The approach that you were possibly thinking about is one that is more often seen in spreadsheets.
I was mindful that the first example I sent you earlier was very 'rough', but I was in a rush!  Now I have a bit more time so I've attached another example (slightly more polished!), to show you a different approach (but the principle is much the same);  this second example requires a small amount of script to do a couple of things "behind the scenes" to avoid the User having to 'click'.
BTW, it is the presence or absence of the 'dateout' that  automatically switches a record between the 'open' service and the 'closed' service tablegrids (but I'm sure you've already picked up on that).
Both this example and the one from earlier today will work okay with your current version of MVD.
Good Luck,
Derek.

Post's attachments

Attachment icon radsoftdemo.zip 342.16 kb, 471 downloads since 2016-01-27 

Re: Filter a table that has already been opened

Hello Derek,
thanks, I truly appreciate it. I was impressed with your first example but was not immediately able to understand how the filter worked but I see it has an items table field in the service table and I think that is the key to how this works. I have to go out on a job now but look forward to looking at your new example and I will report back to you later. I am in New Zealand.
Thanks and regards, David.