This content has been marked as final. Show 12 replies
Somewhere to start would be to write a Forms procedure containing the code and call it from KEY-ENTQRY and KEY-EXEQRY so:
(and if you have buttons to do the queries then the same sort of thing would apply)
Edited by: spilgrim on Apr 12, 2012 11:16 AM
A better way would be to use calculated item for that.
-Create a calculated item of type formula in your block, as formula put something like
-Create a calculated item of type Summary which does a sum over the formerly created item.
CASE WHEN :CONDITION_ITEM='Yes' THEN 1 ELSE 0 END
-Create a function in your form which does something like:
-Create a last calculated item of type formula in your block, as formula put a call to your function
FUNCTION FK_ENABLE_DISABLED (i_nDummy IN NUMBER) RETURN NUMBER IS BEGIN IF <calculated item of type summary> >2 THEN --disable item ELSE --enable itemn END IF; END;
FK_ENABLE_DISABLE(<calculated item of type summary>)
Thanks very much for the help, never used fields in this way before and it seems really useful. However when i add the calculation field my form doesnt seem to compile due to errors with unrelated fields oon a different block which I have not even touched. I have no idea what could be causing this issue the error im getting is: Warning: Required property ignored for subordinate mirror item . But I havent done anything which should cause this and when I take teh summary field out it again it works fine. Do you have any ide what couldbe causing this issue?
Edited by: 786733 on 12-Apr-2012 04:26
I have no idea what could be causing this issue the error im getting is: Warning: Required property ignored for subordinate mirror item .That's just a warning. And i guess its always there, but you ignored it because the forms runs anyway. There will be another error in the error-window, i guess its something about Setting the property Query all records, or the block where the summary item has to be.
Thanks again andreas, its all compiling now however, the last bit where I was to create a last calculated field with a call to my procedure doesnt seem to be working, I keep getting the message stating that my procedure must be declared, but it is declared and I can call it in other places but just not in the formula property field of that item. so out of curioisty I tried to put the call the function on post query trigger and the first formula field returned 1 each time as it should, but the calculation field which was suppose to add them up never had any value in it. Maybe im doing something stupid. Thanks for the help so far.
My guess is u have created a summary item not a formula item no ?
So u have to change the calulation mode > Formula
Formula > < call ur function in this property >
that's what is meant by ...
Create a last calculated item of type formula in your block, as formula put a call to your functionHope i am the Lucky Guess...