How to connect a mobile application written not in the mobile platform 1C, but let's say on the same swift, with the database 1C? Moreover, that the data were selected from the database selectively. What is the mechanism of this work?

  • Is the database remote or do you plan to store the 1C database locally? - Vitaly
  • remote. but I'm going to protest locally. How does the interaction of another development environment and 1C base occur? - Amelie Fowl

1 answer 1

I think the best option for you is to use web services 1c, from a mobile application to access the service, which will give what you need.

1. In the configuration tree General - Web services- add

2. On the Operations tab, add fields to select data that the service will receive

3. Go to Actions - open the module.

4. In the code, describe the module that will receive incoming data, process them and give the answer, for example

Функция Request(АргументИзПункта2) // получим типы из XDTO ТипXDTOРезультатОперации = ФабрикаXDTO.Тип("RequestLK", "РезультатОперации"); ТипXDTOСвойства = ФабрикаXDTO.Тип("RequestLK", "Свойства"); XDTOСвойства = ФабрикаXDTO.Создать(ТипXDTOСвойства); Запрос = новый Запрос; Запрос.Текст = "Выбрать * из Справочник.номенклатура где Номенклатура.наименование = &АргументОтбораИзПункта2" Запрос.УстановитьПараметр("АргументИзПункта2",АргументОтбораИзПункта2); РезультатЗапроса = ЗапросСтрок.Выполнить(); Выборка = РезультатЗапроса.Выбрать(); Пока Выборка.Следующий() Цикл XDTOПозиции = ФабрикаXDTO.Создать(ТипXDTOРезультатОперации); XDTOПозиции.Name = Выборка.Наименование; XDTOСвойства.items.Добавить(XDTOПозиции); КонецЦикла; Возврат XDTOСвойства; КонецФункции 

Official 1C Web Services Documentation

  • @Dmitry corrected and supplemented the answer) - Vadim Popov