Simplicty and flexibility!


Running in Table view - exceute function only works on 1st/top record


Started by Simon B
Search
You will need to Sign In to be able to add or comment on the forum!

Running in Table view - exceute function only works on 1st/top record

I've Customised the top menu, i've replaced Recordsave with:

Execute function/derivation: SetValue("daterec",current date)+RecordSave( )

The above 

works in form view from the menu, 

works in form view using the F8 shortcut , 

works in form on a button.

works in table from the menu, on the FIRST record

works in table view using the F8 shortcut on the FIRST record.

BUT

If in table view you select any record other than the 1st record (top line), selecting execute from the menu or using F8 doesn't work.

 i've confirmed this happens in datease 8.5.x and 8.2.x and bug repeatable on any form.


Written by Simon B 09/07/15 at 11:16:31 Dataease [{8}]FIVE

Re:Running in Table view - exceute function only works on 1st/top record

Firstly... Plenty of points for ingenuity ;-)

I knew you could do this intellectually but never really thought about doing it i.e. replace F8 etc. 

Slight problem of course that the Toolbar Save is not affected and the toolbar can't be programmed (very clever...).

Most of the problems you have here is due to GUI design which is the one big thing that hold DE back and where we are moving away from.

If you can do it in the GUI you should be able to do it as a function too is our "mantra" but it isn't like that ... yet!

The second GUI problem you have is that the table view is not the same as a multi-record object (Form with multiple records or subform).

The tableview was re-implemented by some Microsoft crazed person in 7.x and is a Windows object rather than a DataEase table view.

Secondly.

The F8 works, i.e. it saves all the changes in the tableview but it always put the date into the first row. Just try to fill the table up and scroll down. It doesn't put the date into the first record but the first row.

If you have done your homework you would know that all Set Functions can be told which of the objects with the same name (all objects in a multiple record view has the same name as they are clones) you want to change.

Your code instruct DataEase to always put date into the first object on screen, and that is what it does. Try with time and you will see that it change for each F8.

So you need to tell whcih record you want to change.

SetValue("daterec#4",current date)+RecordSave( )

Will put the date into daterec clone number 4.

So if this was a TableView created by you by doing a multi-record form, problem would be solved. You could use GetCurrent("RowNumber") put into a SetVar() on mouseover or click on the record in OML and you would be sorted.

However, as there is no events on anything in the GUI Tableview you can't really program it.

And to be honest, that is what it was intended to be. A quick fixed view for viewing data without programming. There is ways to style it, but that is very much it.

YOu cannot have a button or anything in a table view like this so just forget about it if you want to do programming. 

YOu have all the possibilities to make your own table view that can do almost anything.




Written by DataEase 09/07/15 at 13:46:14 Dataease [{8}]FIVE

Re:Re:Running in Table view - exceute function only works on 1st/top record

Hi and thanks for your quick reply.

Not sure why you think tableview was re-implemented by some Microsoft crazed person in 7.x and is a Windows object rather than a DataEase table view.  Tableview has been here since at least v6.x and never went away to be re-implemented, it's the same as it always was.

You said F8 works. I did say the 1st row works (i.e. the 1st record on the screen in table view (View > Table),

but all the other rows containing all the other records don't.  i.e. if I change order 1 by bob then save, order 6 by tim then save, then order 12 by john then save, then ONLY order 1; the 1st order at the very top (Bob's), will have the date updated.  The dates on all the other orders I changed are wrongly not updated.

It would seem I have to reinvent the wheel again and create a multi record form to replace my table view.

It was never possible for dataease to show 2 different views of the same form without closing one and reopening another.  all fine but there was never a way of passing the current record being viewed on to the next form, I get the feeling this may now be possible where it wasn't before, using GetCurrent("RowNumber").

Looks like I have some playing to do to learn how to do a multi view form and then closing it, opening a normal form, and passing on the record number and getting it to view that record number.  And the same back to multiview again lol.

Was so much easier using the features built in to the old dataease, but I get where you're coming from, antthing old is no longer supported, and everything from 8 on is now done a different way.  I get ditching the old stuff, just used to having a grace period.

I use table view for goods in.

They see table view, find the order and flag received as YES then hit f8 to save. You can book lots in quickly this way. If you need more info press F5 (set on my end to View>Form) so they can see other info quickly.


And now it's home time, tomorrow is a new day and I shall be experimenting in reinventing the table view wheel :D


Written by Simon B 09/07/15 at 15:19:42 Dataease [{8}]FIVE

Re:Re:Re:Running in Table view - exceute function only works on 1st/top record

Sometimes you make me wonder Simon. If I had as little confidence in the people making my software as you have in us, I wouldn't use the software ;-)

I can assure you that we don't guess or answer things according to some obscure belief system, we actually know how this thing works and doesn't work. We know when things was changed and how.There is no magic or wizzardry ;-)

The Tableview has been in DataEase since for ever, but it was always a non-programmable feature and you are right it was in a way even less configurable in DFW 5.x and 6.x, but it was RE-IMLEMENTED in DataEase 7 and if you take a closer look you will realize that it is quite different to DataEase 6.x

You F8 doesn't update all the rows, it simply update the first row. SetValue() only update on object pr. call.

You can use it to update all the rows but then you need to run a loop. 

We have planned to do SetValue*ObjectName*","XX") and it will then update all matching objects, SetState() will hide/show etc all matching objects.

All the things you try to do can be done, and you don't have to re-invent any wheels, but you are quite stubborn wanting to walk in a straight line, when there is an obstacle in front of you. You need to walk around the obstacles, no point spinning in front of them.

DataEase can open as many sessions of the form as you like, and you can have as many different forms on top of the same table as you like.

You base your assumption on a lot of old "truths" which hamper you in trying to achieve what you want.

I suspect that you deep down don't think it work so when it doesn't (because you do it wrong), you immediately think it is the product which doesn't work.

I can say with hand on heart that there is not one problem you have had so far that didn't work, but it didn't work for you.

If you start believing that it does work, but you do something wrong then you will get it to work because you know why it doesn't work and that you can do something about.


Written by DataEase 09/07/15 at 21:14:07 Dataease [{8}]FIVE

Re:Re:Re:Re:Running in Table view - exceute function only works on 1st/top record

So much for being positive and ready to start today reinventing what i already had in table view in a multi view form.

Thank you for your positive reply.

I can say with hand on heart that there is not one problem you have had so far that didn't work, but it didn't work for you.

OK then, so make table view work since i've done it wrong in table view . Oh you can't, because I'm right.

If you start believing that it does work, but you do something wrong then you will get it to work because you know why it doesn't work and that you can do something about.

That's the point, I HAVE done it right, it works completely, except when i click VIEW > TABLE.

Not my fault you wrote new code than ignores the fact i'm viewing record 6 (using built in table view written by dateease not my own table view) but doesn't update RECORD 6 !

I was rather pleased i'd got SetValue("daterec",current date)+RecordSave( ) to work.

I suspected you'd say the reason it didn't work in table view was because it's something old so no longer supported and was ready to reinvent the table view my own way and not using the software built in, I wasn't expecting the reply i got.  You say i'm stubbon and i don't have to reinvent any wheels.

What do you call making my own form from scratch, that looks just like the table view hard coded into dataease?

Sounds very much like i'm re creating what is already hard coded in, i.e. reinventing the wheel.


End rant, off to try to figure this mess out since you clearly aren't interested.


Written by Simon B 10/07/15 at 08:15:27 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Running in Table view - exceute function only works on 1st/top record

If you play hard, you have to be able to take it as well as you give it.

This is not a blame game, and nobody benefit from being destructive or un-constructive. 

I think you need to re-read your posts if you think they come across as positive.... (I know that you deep down are, but you style can have a tendency to rub people up the wrong way).

Still, my reply was not to slag you off but to try to change your mindset.

DataEase like the EU is not one person. If you think that the present team made all the functionalities in DataEase from day one (you don't of course) than you would be sorely mistaken.

We took over a "badly damaged ship in perilous waters" and it takes time and effort to fix this ship and get it into safe waters.

It is now in safe waters, but there is still a lot of repairs that needs doing and we need to focus our resources.

I didn't say that you don't get everything wrong, what I said is that the stuff you do get wrong isn't ALWAYS a bug (there has been cases where you found bugs, like with SetColor) but most of the time it isn't but you subconsciously believe that it might be and that thwarts your efforts to get it right.

We are the first to put our hands up and say that something is wrong and not as it should be, it being old functionality for which we are not responsible or new where we got the wrong end of the stick.

One problem is of course when we say that something we didn't do is "crap" we get told that we slag the old team off rather than take responsibility... ;-)

If we make something flexible and programmable it is not DataEasy...

So you see, it is a fine edge to balance on.

In our replies there is very often a "mixed" message. Stay away from that ,and use that instead!

That is well intentioned. What you try to do can't be done with the standard table view, but you can get it 100% the way you want if you create your own table view. 

Instead of re-defining only F8 you also need to re-define View as Form and View as Table to open different documents on the same table. 

One Multi Record form (tableview) and one Single Record form (Form View). 

You can use SelectionFilter or open related to get the correct data.

In the MultiRecord view you can use SetValue("Field#NN" etc to set things in the correct row (by help of GetCurrent("RowNumber") etc.

It is a little work, but what you want to do is "special handling" and could never be part of a DataEase repertoire. 

There is only two ways.

DataEasey. We find the middle ground and make a fixed way of doing things (Table View).

Or ProgramEasy - You use the now very exstensive library of functions and combine them into your own recipe so it is 100% to your taste.

The big difference between 85. (and DG3) and 7.2 and earlier is that now you CAN do the latter, when before there would have been a final gorge that you would not be able to cross.

Good look, and we do care, but some times hard love is necessary ;-)


Written by DataEase 11/07/15 at 10:37:18 Dataease [{8}]FIVE

Re:Re:Re:Re:Re:Re:Running in Table view - exceute function only works on 1st/top record

OK fresh start, table new is another thing to bite the dust as that's all it does, view, so I'm making an attack on recreating it.  So i'm starting simple.  One step at a time.  So first i'm approaching the multi record form to replace my table view.

In the MultiRecord view you can use SetValue("Field#NN" etc to set things in the correct row (by help of GetCurrent("RowNumber") etc.

I now have a multi record form that's correct, and a button that executes: SetValue("daterec#2",current date)  .

Obviously this just updates record 2.  But so far so good, I have a multi record form, and a button that updates a specific record, it works as coded, no matter what record i press my button on it just updates record 2 on my multi record form. 

So, now to replace "#2" with the '#current record the cursor is on'.  You know where this is going lol.

No instructions in the help on this, so I created a new field called derived: GetCurrent("RecordNumber") , I have to get the current record some how I guess, so this field does it.  testgetrec shows/holds the current record number in the multi record form.  All still working as it should.

Changing my button to now say SetValue("daterec#testgetrec",current date)  doesn't work.  I didn't expect it to, but I couldn't find any instructions on how to replace a hard coded record number #2 with '#current record number' and this was my best guess given the limited help on new functions, and probably the easiest way of showing what i'm trying to get.

So my question is, how do i replace the 2 in SetValue("daterec#2",current date)  with the current record i'm pressing the button on?  I know the record number, i have a field holding that info, but I don't know how to pass that to setvalue...#....


Written by Simon B 13/07/15 at 13:47:18 Dataease [{8}]FIVE

Custome TableView/FormView Toggle, fun with LabelExecDQL, SetClass, Custom Menu, Custom Toolbar, MoveObject etc...

Since we made you cry over the weekend, and your "challenge" is an interesting one that give us plenty of opportunity to confuse you and everyone else even further we couldn't stop ourselves from putting aside some time and make a sample/solution/challenge based on your problem.

I think you will find all the answers to your problems in the sample, but equally you will find 1000 new questions...he,he.

Have a look and see if it get you a little further along the path to "enlightenment".

All the best!

We published the sample on the blog so just follow the link:

http://www.dataease.com/DG3_BlogList/?ParentID=0000000255&field1=0000000255


Written by DataEase 13/07/15 at 19:09:21 Dataease [{8}]FIVE

Re:Custome TableView/FormView Toggle, fun with LabelExecDQL, SetClass, Custom Menu, Custom Toolbar, MoveObject etc...

Thank you firstly.  Having an example to work off helps masssively.

I managed to get the saving corrrect record in table view sussed pretty quick, having a temporary variable with the exact same name as a field confused me as I didn't realise the variable was being referred to at first.  Regardless I sussed it :)  .

Form view to table view I'm still trying to make sense of.  The majority does but I'm playing around with the code to try and get it to appear how the hard coded table view works.

From table view to form view works spot on.  Select record 5, go to form view and do whatever, save, then back to table view.

This is where I get a little stuck, after returning from form view to table view, in your demo table view now only shows FROM the record I had clicked on; record 5.  Records 1 to 4 have been filtered out and are no longer shown, I have to click the clear form button to show all the records in table view again.

After playing I can make it like a proper table view again and show all records when I return from form view (just like had coded table view does), but as i've had to reopen table view after closing it to show form view, I aren't sure how to highlight the correct record in table view.

You avoided this in your demo with the filter as the record that was shown in form view becomes the 1st record on screen in table view, so the cursor sits on the 1st field of the 1st record.   I suspect I need to use setfocus but there's a lot going on in the demo and I can't figure out how to fire setfocus on the customer number variable that's already stored, when form view is reopened.


Written by Simon B 15/07/15 at 10:55:41 Dataease [{8}]FIVE
DG3_ForumList