databaseManager.addTrackingInfo() use?

Hi All,
Before I ask my question, I want to congratulate the team Servoy
for the efforts they are making.

I’m trying to use the added method “databaseManager.addTrackingInfo()” but it doesn’t work for me,
I call it before savedata ()? after savedata ()? but it’s not working!
I think i’m using it wrong, that’s why I hope to ask some questions.

  1. When do I need to call the method?
  2. when we add several records in the log table after saving ,is the value of the new column will be added to all these records?

Thank you for your explanations

Othmane,

This is a new v6 feature.

The sample shows the following example:

databaseManager.addTrackingInfo('log_column_name', 'trackingInfo')

Every time a tracking record is inserted in the log table, the specified value (‘trackingInfo’)is also inserted in the specified column (log_column_name).
This is added to tag data changes with some meaningful data for your app.

Rob

Hi Rob,

Thank you fir the reply,

This is added to tag data changes with some meaningful data for your app.

That’s what I want, I need to add some data (current member_id for example) to the inserted log and
which is related with it.

So I need to know when I have to call the method databaseManager.addTrackingInfo(‘member_id’, member_id)?

You only need to call this method once in your solution and all tracking info for that client from then on will be tagged as such.
You can call it more often to update the value if you need to, call it with value null if the tracking should no longer be tagged.

Rob

Hi Rob,

I tested what do you suggest but unfortunately it doesn’t work :(

Here’s what i’m doing

  1. I have a database server DB_x which is in the same time my server log
  2. I added in the table log a column with the name “id_member” and type int
  3. I have a solution with a form Frm_x based on a table TB_X witch Tracking is enabled for it
  4. I’m logging with a user who’s member of Tracking group.
  5. I called the method (databaseManager.addTrackingInfo(‘id_member’,2) for example) in onsolutionOpen, it doesn’t
    add this information in my inserted log after saving.
    I called the method (databaseManager.addTrackingInfo(‘id_member’,2) for example) in Onload of my form Frm_x, it doesn’t
    add this information in my inserted log after saving.
    I called the method (databaseManager.addTrackingInfo(‘id_member’,2) for example) in OnShow of my form Frm_x, it doesn’t
    add this information in my inserted log after saving.

What am i doing wrong.

You only need to call this method once in your solution

I need to call the method each time i have to do save because i want to log a specific value related to the inserted log
and not a static value.

Hi Othmane,

I believe the signature for addTrackingInfo() is (String, String), so I suppose it doesn’t work in your case because you use and int column and integer value.
You should try it with a VARCHAR(XX) and a String value.

Hope this helps,

Hi Patrick,
Hmmm… I see

I’ll test that ;)

That was the problem :wink:

It works perfectly :)
Thank you Patrick and Rob for your support.

rgansevles:
You only need to call this method once in your solution and all tracking info for that client from then on will be tagged as such.
You can call it more often to update the value if you need to, call it with value null if the tracking should no longer be tagged.

Rob

Hi Rob,

This was news - that I need to call .addTrackingInfo() each time my value changes.
I would like to record a global variable value with each record in my log table.
So far it’s ok, there is only one place where this variable changes and I can add a call to .addTrackingInfo() right there, but it would be nice to not have to do that.

Is it something Servoy could implement - grabbing the current value of whatever variable is passed to .addTrackingInfo(), rather than a static thing?

Cheers,
Maria