Author Topic: Set value on object  (Read 2579 times)

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Set value on object
« on: January 20, 2016, 04:05:32 PM »
Hi,

Somebody knows how to set a value on application Object. This object is inside -->Enviroment/Applications.

I know how to read value from configuration trough IconfigManager or IConfigurationService, but i donīt know how to set value  :-\

I tried to set value trough IConfigManager but it is setting on Agent object Annex  :'(

Some help?

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Re: Set value on object
« Reply #1 on: January 20, 2016, 05:55:16 PM »
small explanation

I can read the configuration of the application where the agent is loged with that:

CfgApplication app = _configService.MyApplication;

Inside this object i can read:

app.UserProperties
app.Options

But i canīt update a value inside. Iīm trying with set but itīs not working

app.Options.Set("key", value);

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Re: Set value on object
« Reply #2 on: January 20, 2016, 06:05:55 PM »
Update:

I found [b]app.Save()[/b]  ;D

But i have no permissions. Iīll keep you informed :)


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Set value on object
« Reply #3 on: January 20, 2016, 06:13:23 PM »
Great job :)
Good luck and thanks for sharing

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Re: Set value on object
« Reply #4 on: January 25, 2016, 11:56:28 AM »
Finally it works (setting the permisions to user)