43298members
217681posts

CDBEventJournal Custom fields : CustomStringField , CustomNumericField1 ..

Highlighted
Cadet

CDBEventJournal Custom fields : CustomStringField , CustomNumericField1 ..

Hello, how can I allow the update/write of these columns?  They seem to be there for our use however I can't update these columns via QueryPad or via ST script.

 

No hits on searching Help and didn't see anything in Configuration to allow these to be used.

 

thanks

Tags (2)
3 REPLIES 3
Highlighted
Lieutenant

Re: CDBEventJournal Custom fields : CustomStringField , CustomNumericField1 ..

There fields can only be set programmatically using the following methods:

  • CEventJournal::SetCustomStringField( RecordId, Index, Value )
  • CEventJournal::SetCustomNumericField( RecordId, Index, Value )
  • CEventJournal::SetCustomFields( RecordId, StringValue, NumericValue1, NumericValue2, NumericValue3 )

 

The CEventJournal database table is an aggregate. The aggregate is a field called EventJournal and is on the root group object in the database.

 

The following JScript examples show there use from a mimic script:

 

function SetCustomString()
{
  Server.RootObject.Interface.EventJournal.SetCustomStringField( "0000000001CD5EEAFBCE1E40000001C100000000", 0, "Hello");
}


function SetCustomFields()
{
  Server.RootObject.Interface.EventJournal.SetCustomFields( "0000000001CD6BEB2D16B9DC000054C100000000", "Hello world", 1, 2, 3 );
}

 

The RecordId will obviously need to match an actual record in your event journal and therefore won't be a constant like these examples.


Andrew Scott, Lead Engineer, AVEVA
Tags (1)
Highlighted
Commander

Re: CDBEventJournal Custom fields : CustomStringField , CustomNumericField1 ..

@AndrewScott For very restricted examples it would be possible to do this using a User Method.

Not sure what the use would be since the RecordId couldn't be dynamically entered... but it would arguably be possible.

 

It's probably important to note that these methods do require Control permissions on the $Root object.

Which for many databases may not be configured for the majority of users.

 

I'm actually intrigued by what permissions are required for the 'AddComment' method on the same aggregate.

It doesn't appear to have a Privilege associated with it in my version (GeoSCADA 2019 May 2020 Update).

2020-07-11 13_58_29-CEventJournal - Internet Explorer.png

 

 


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Tags (1)
Highlighted
Cadet

Re: CDBEventJournal Custom fields : CustomStringField , CustomNumericField1 ..

Thanks for your reply, hadn't seen these methods.  Much appreciated..

Tags (1)