Simplicty and flexibility!


subform+MemoEXECDQL


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

subform+MemoEXECDQL

Dear all,

I've a subform with a button on each record with a OML event click as follows :

act := SetValue(concat("DQLNr1#",row.value),"510")+Wait(0.1)+MemoExecDQL(DQL1,codigo.value,quantidade.value,encomenda_cliente,"","").

Unfortunately I can't execute it and a "EXITING DUE EXCEPTION" is displayed every time I click any button.

DQLNr1 and DQL1 are fields defined on each record of subform's records ( defined in the table ) .

Can anybody help on it ?

Thanks

Afonso


Written by afonso santos 25/03/20 at 23:26:47 Dataease [{8}]FIVE

Re:subform MemoEXECDQL

Hi Afonso.

There is a couple of things to clear up here.

OML and "Normal" Dataease fields work quite differently.

Here I fear that you have ended up in a muddle.

I will explain what has gone wrong but maybe show you the best way of doing this in OML first.

In OML you have access to the command any which will resolve all your problems.

act := MemoExecDQL(any ExecDQLTableYouUse with DQLNr=510 DQL,codigo.value,quantidade.value,encomenda_cliente,"","") .

This is just pure Dataease OML/DQL and there is no magic. you lookup the DQL with a standard ANY with a WIth . The one above is just an example you obviously have to use the correct table name and field name where you have stored your DQL's.

If you where to us the method you are trying to use you should not use fields in the subform but fields in the main form. You only use them to quickly download the correct DQL and execute it so you only need one DQLNr and One DQL(Memo) on a form to use this feature.

act := SetValue(DQLNr,"510")+Wait(0.1)+MemoExecDQL(DQL,codigo.value,quantidade.value,encomenda_cliente,"","").

If you where to use it the way you try to use it I think you would have to do it this way.

act := SetValue(concat("DQLNr1#",row.value),"510")+Wait(0.1)+MemoExecDQL(DQL1.value,codigo.value,quantidade.value,encomenda_cliente,"","").

But anyhow, just do it the first way and all these problems will disappear.


Written by DataEase 27/03/20 at 14:29:18 Dataease [{8}]FIVE

Re:Re:subform MemoEXECDQL

Hi,

Tks for the answer.

"act := MemoExecDQL(any ExecDQLTableYouUse with DQLNr=510 DQL,codigo.value,quantidade.value,encomenda_cliente,"","") .

This is just pure Dataease OML/DQL and there is no magic. you lookup the DQL with a standard ANY with a WIth . The one above is just an example you obviously have to use the correct table name and field name where you have stored your DQL's.

If you where to us the method you are trying to use you should not use fields in the subform but fields in the main form. You only use them to quickly download the correct DQL and execute it so you only need one DQLNr and One DQL(Memo) on a form to use this feature."

I tried to use the statement as shown but the DQL was not executed.

ExecDQLTableYouUse = t_execucaoDQL

In the main form - v_ENCOMENDAS_DOS_CLIENTES - I've two fields DQL + DQLNr among others

In the sub form named t_encomendas_cliente - I've two fields DQL1 + DQLNr1 and of course codigo, quantidade and encomenda_cliente fields, among others.

Fact :

act := MemoExecDQL(any t_execucaoDQL with DQL_Nr = 510 DQL, codigo.value, quantidade.value, encomenda_cliente.value ,"","").

I get an error because DQL field belongs to main form ( obviously )

Then I tried the sentence  v_ENCOMENDAS_DOS_CLIENTES_LOG.Record1.DQL but without sucess.

What's wrong ?

Tks

Afonso


Written by afonso santos 27/03/20 at 23:57:26 Dataease [{8}]FIVE

Re:Re:Re:subform MemoEXECDQL

As I don't have your application I can't point specifically what you do wrong but based on your reply I think you are still on the "wong page".

any t_execucaoDQL with DQL_Nr = 510 DQL

this is a database query and has nothing to do with any fields you have in your form or your subform. THis is pure "DQL".

MemoExecDQL will execute the return of the any statement and not whatever is stored in any field in the current form.

I.e. this will work without you having any DQL or DQL_NR fields in the current form/table. 

any t_execucaoDQL with DQL_Nr = 510 DQL

DQL_NR is the key in table t_execucaoDQL
DQL is the corresponding memo field in t_execucaoDQL

If you get a problem here it is either because either of these fields are not it that table or because DQL_NR is ex. text 

THen it need to be.
any t_execucaoDQL with DQL_Nr = "510" DQL

So if you get an error it has nothing to do with the fields but simply with your syntax.


Written by DataEase 28/03/20 at 14:26:30 Dataease [{8}]FIVE

Re:Re:Re:Re:subform MemoEXECDQL

Download: MemoExecDQL.pdf

I understood all the explanation.

Attached please find a sketch with the problem.

I don't get an error message ; the problem is that after clicking the button in the subform, nothing is done ( the DQL code is not executed ) even for a simple sentence like  " Message "Hello" window .!! It seems that the function into t_execucaoDQL is not "called".

Thanks for you help


Written by afonso santos 28/03/20 at 20:08:46 Dataease [{8}]FIVE
DG3_ForumList