Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

Uniface 9: logging a form whenever it is activated or acessed.

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

19 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

Thanks a lot for the option option 1 : what i understand is i need compile all forms again to have that , which is slightly difficult at present. option2: Can you explain this in detail, this one looks like feasible option for our prj , if possible with simple example.


Author: lalitpct (lalitpct@gmail.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

Do you currently use the init operation in the operations trigger of the components? If not, you can add an init operation to the operations trigger, which uses $instancename, $componentname, and $componentname($instanceparent) (and possibly even the call stack) to log the information. You should be able to 1. Add the init operation to any component templates which will automatically compile it into all components still bound to the template. 2. Add the init operation using a simple span through UFORM (using the DICT model)


Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

-yes screens are called using activate . -code added in MODEL->DICT->UFORM->SFUNC field->(code in all triggers) was not added automatically in sample form after compilation.


Author: lalitpct (lalitpct@gmail.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

The URR makes sense only after the compiles have been done, not before. do you call your forms via activate? The INIT operation will not be avctivated if you use RUN to start your forms, as the documentation reads: Init Defines the component behavior when a component instance is created with newinstance (or by activate when newinstance is executed implicitly). Have you checked in your sample form that the modification of the repository really ended up in the operations trigger? Perhaps you can test in the IDF at first, if the sample form works when you use the IDF test mode. Next would be to run your production application with the /deb switch to see if and how the component is called.


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

Hi Uli,sochaz Thanks for testing i tried below things 1)MODEL->DICT->UFORM->SFUNC field->coded below things in all triggers. 2)regerated URR and compiled one sample form. 3)Released both and checked. The code was not called , is there something else that needs to be done or i need to add manually code in the form? coded below things ---------------------------------------------- operation init putmess "hello 1" end


Author: lalitpct (lalitpct@gmail.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

Hello, we have recently implemented quite the same thing as Uli mentioned. We put some kind of #include COMP_LOG into all init and cleanup operation of every single component. In this include, there is a simple code to activate a servis passing him some information (componentname, operation etc ) which does the rest... it logs all inits and cleanups of all components of our application into a sipmle table. We log something like componentname, number of inits, datetime of last init, number of cleanups, datetime of last cleanup... Please be aware that logging in database might be a bit tricky on transaction. We use Oracle, so we use sql and autonomous transaction, so this logging does not influence other data. Zdenek


Author: sochaz (zdenek.socha@fullsys.cz)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

Hi lalit, as the description of the field says, the INIT datafield holds the code for the EXECUTE trigger, so you better not touch it. what you need is an OPERATION INIT which has to be placed in the field SFUNC of UFORM. But be careful because there may be other operations already defined in this trigger which must not be overwritten. For flexibility reasons i recommend you just place the operation definition and a #include into the code of each form. operation init #include OVERALL:INIT_CODE end ; operation INIT then you create a library OVERALL and an included proc called INIT_CODE. If you want to change/enhance the functionality, there is just a change in this include proc necessary (and a recompile of all the forms)


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

Hmm ok , will see the first option also. For DICT model modification I have acess to MODELl->DICT->UFORM->INIT. Do i need to add code in Trigger of field INIT? I tried but it didnt work


Author: lalitpct (lalitpct@gmail.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:32 AM UTC

logging a form whenever it is activated or acessed.

Author: lalitpct@gmail.com (lalitpct)

In our project we have lot of screens activated in ad hoc manner. I want to log them in a table whenever they are acessd, Below is one example how it is activated. Is there any inbuilt functionality which can be used here , I cannot modify this at each and every place so some inbuilt functionality needs to be used $1 = @$fieldname activate "act_lu"

AND MAKE VERY SURE THAT YOU HAVE A BACKUP !!!


Author: Theo Neeskens (tneeskens@itblockz.nl)