Y
Y
yiicoder2015-02-11 14:57:49
SQL
yiicoder, 2015-02-11 14:57:49

1C deep integration, how to make an entry in the database?

We have a task to implement deep integration of the site (online store) with 1C.
1C has a very .. specific organization, but we figured out reading data from 1C.
Now you need to transfer data to 1C.
Since we figured out the structure of the database on reading, it seems to us that the ideal option is to write directly to the 1C database.
You need to write orders and customers.
The flow of orders is large and I want to keep 1C as up-to-date as possible, for example, operators, for historical reasons, work with the 1C database, and not the site database, and customers often call immediately with clarifications on an order that is not "still" in the database due to work through "unloading".
With the entry in 1C, there is still one specific visible problem - the generation of _IDref occurs according to some internal algorithms that are completely incomprehensible to us.
How can this ID be safely generated?
In what ways can this problem be solved in general?
What other interfaces can there be for synchronous interaction between 1C and external systems?
What are the pitfalls in trying to implement synchronous 1C interaction with the site?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
thepry, 2015-02-11
@yiicoder

>> it seems to us that the ideal option is to write directly to the 1C database.
This is very very bad. First, it will be difficult for you to control referential integrity. Secondly, any changes in the 1C metadata structure will need to be programmed separately. Thirdly, deadlocks are possible. Fourth, such code is difficult to maintain.
>> What other interfaces can there be for synchronous interaction between 1C and external systems?
1. Web services in 1C.
2. Http services in 1C.
3. Separate tables in the database: Customer base -> Base 1C and vice versa. Upload changes to the table and check from the 1C side once in n times, if there is something there, then read and delete what has been read.
If your load is not crazy, then the first and second options will do. True, it is necessary to clarify how the licenses will be spent in this case.

A
Alexander Nikitin, 2015-02-11
@padla2k

No need to interfere with the work of DB 1C. Use either scheduled unloading or COM object "V8.Application".

A
afna, 2015-02-11
@sulik93

I agree with Alexander
to use uploading to the site. For example, through the ODBC driver:

Соединение = Новый COMОбъект("ADODB.Connection");
СтрокаКоннекта = "DRIVER={MySQL ODBC 5.2 Unicode Driver}; SERVER="+СокрЛП(Сервер)+";DataBase="+СокрЛП(ИмяБазы)+"; UID="+СокрЛП(Логин)+";PWD="+СокрЛП(Пароль)+ ";OPTION=" + "3" + ";STMT=SET CHARACTER SET UTF-8";

Попытка
    Соединение.Open(СтрокаКоннекта);
    Сообщить("соединились");
Исключение
    Сообщить("Невозможно установить соединение с бд! " + ОписаниеОшибки()+"!!!");		
    Возврат;
КонецПопытки;

Well, you can go on and on

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question