Settings update does not work

StatusIDPriorityType
Closed35643MajorBug
ProfileReply
Владислав КушнерClient

Code in topic "Application Settings. How to Modify Settings Model" does not work. Link - https://documentation.galaktika-soft.com/xafari/doc_app_settings_how_to_modify_model

Settings modifications are not saved in the database after execution of this.ObjectSpace.AppSettings().Update()

Replies

UserDescriptionPosted On
MariyaVoytovichAgent

Hello!

Thanks for reporting the issue.

Regarding the error that you reported I can say that all information submitted to our development team.
Also a relevant issue [102.189937] registered in our issue tracking system. You may reference to this number later to find out its state.

Feel free to contact us if you have any questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

MariyaVoytovichAgent

Hello!

Settings modifications are not saved in the database after execution of ObjectSpace.AppSettings().Update(), because the SettingsAccessor service is not active during command execution.

To successfully complete the modifications, modify Update class.

public class Updater : XafariModuleUpdater
{
//...
public override void SafeUpdateDatabaseAfterUpdateSchema()
{
//...
SettingsAccessor.Instance.Updaters.Add(new FCSettingsNodeUpdater());
SettingsAccessor.Instance.Activated += Instance_Activated;
SettingsAccessor.Instance.Initialize();
//...
}

void Instance_Activated(object sender, EventArgs e)
{
var objectSpace = ObjectSpaceFactory.Instance.GetObjectSpace();
objectSpace.AppSettings().Update();
objectSpace.CommitChanges();
}
//...
}

Feel free to contact us if you have any questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

× This ticket is closed.

Write US