Добрый день!
Пытаюсь создать уведомление:
ISchemaManagerItem<Terrasoft.Core.Entities.EntitySchema> reportSchemaItem = UserConnection.EntitySchemaManager.GetItemByName("Contact"); Terrasoft.Core.Entities.EntitySchema remindingSchema = UserConnection.EntitySchemaManager.GetInstanceByName("Reminding"); Entity reminding = remindingSchema.CreateEntity(UserConnection); reminding.SetDefColumnValues(); reminding.SetColumnValue("AuthorId", UserConnection.CurrentUser.ContactId); reminding.SetColumnValue("ContactId", UserConnection.CurrentUser.ContactId); reminding.SetColumnValue("SourceId", RemindingConsts.RemindingSourceAuthorId); reminding.SetColumnValue("RemindTime", UserConnection.CurrentUser.GetCurrentDateTime()); reminding.SetColumnValue("SysEntitySchemaId", reportSchemaItem.UId); reminding.SetColumnValue("LoaderId", reportSchemaItem.UId); reminding.SetColumnValue("SubjectId", Guid.Empty); reminding.SetColumnValue("SubjectCaption", "Caption"); reminding.Save();
на Save() возникает ошибка:
что я делаю не так?
27 февраля 2020 15:27
А какой сам текст ошибки? Он где-то над стеком.
27 февраля 2020 15:35
Error creating an instance of the "Terrasoft.Configuration.INotificationSender" class Error activating INotificationSender No matching bindings are available, and the type is not self-bindable. Activation path: 1) Request for INotificationSender Suggestions: 1) Ensure that you have defined a binding for INotificationSender. 2) If the binding was defined in a module, ensure that the module has been loaded into the kernel. 3) Ensure you have not accidentally created more than one kernel. 4) If you are using constructor arguments, ensure that the parameter name matches the constructors parameter name. 5) If you are using automatic module loading, ensure the search path and filters are correct.
28 февраля 2020 19:20
Руслан, на объекте Reminding во встроенном БП ничего не менялось? В частности, функция SendNotification у Вас стандартная?
2 марта 2020 07:11
На объекте Reminding ни чего не менялось. Хотя из приложения уведомления создаются, а из Visual Studio выбрасывается исключение.
2 марта 2020 15:08
Видимо, часть логики ядра, которую вызывает строчка
var notificationSender = ClassFactory.Get<INotificationSender>(
в функции SendNotification() встроенного БП объекта Reminding, не совместима с запуском извне. По самому сообщению обсуждают здесь.
Если обойти не получится, создавать запись можно внутри системы, а если нужно извне — по OData, обращением к веб-сервису или запуском БП.
Показать все комментарии
Войдите или зарегистрируйтесь, что бы комментировать