P
P
Pavel K2020-03-16 00:29:43
1C
Pavel K, 2020-03-16 00:29:43

How to create the "FormDataTree" type on the server?

Good evening!
I had to poke my head into the unknown steppe.
In general, from a WebService (created, figured out, there are no problems in general), you need to call a function from the built-in processing manager module.

The problem is that, as I understand it, one of the parameters of the function requires the type "FormDataTree" (client, as I understand it, because "GetElements" is used inside), and "ValueTree" ( dz = New ValueTree; ) does not fits.

I need to somehow convert the Value Tree into "FormDataTree", and then back.
Provided that my code is "&OnServer" (because WebService).

I can’t change the processing, because configuration cannot be changed. It is not possible to make a copy of the same processing, because. it is very large + calls about a dozen other processing (where the same "FormDataTree" is used, in general, an ambush).

I wanted to try this, BUT:

дз = Новый ДеревоЗначений;
дфд =  ??? Как создать с типом ДанныеФормыДерево?
ЗначениеВДанныеФормы(дз, дфд);


Tell me, please, how to be?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel K, 2020-03-17
@PavelK

In general, I did it through XDTO packages, first I drove the DataFormTree into an XML file, saved it,
castrated the xml to a couple of lines for about three hours (because I didn’t like it in different versions for some reason), then

идиотизРЯК = Новый ЧтениеXML;
идиотизРЯК.УстановитьСтроку("1Ссникам страдать!");
деревоЗначенийКлиент = СериализаторXDTO.ПрочитатьXML(идиотизРЯК);

In general, after talking with 1C, as usual, a burning ass, I argue:
wasted 3000re (for consultations of "highly qualified certified specialists"), the answer of which is "no" and they say "who wrote the crooked hands", but that's just a reproach that the configuration is written by them the same company (not a very small one and the configuration is used in many places)!
"Well, there were reasons for that."
Thank you for answering here for free!
Well, its 1C nafig, I decided for myself that I’ll wait 10 years until they stop emulating c ++ and switch to pure, otherwise there are continuous perversions all around (and this was just one of the examples).

A
Alexander, 2020-03-16
@Escanor

dfd = ??? How to create with type DataFormsTree?

On the server, no way.
Tell me, please, how to be?

There are actually not many options:
1) As you wrote - copy and redo the methods to suit your "Wishlist" (I actually would not use this option)
2) Make an extension where to add processing to suit your needs.
3) Decide what exactly you need from processing (you may not know its functionality you need). Describe your method which, based on the parameters you passed, will return the "answer" you need.

S
Sgr_A, 2020-03-16
@Sgr_A

Do not panic, you just need to suffer a little, and everything will work out!

&НаСервере
Процедура СоздатьНеСоздаваемое()
РеквизитФормыДерево = Новый РеквизитФормы("Дерево", Новый ОписаниеТипов("ДеревоЗначений"));

МассивДобавляемыхРеквизитов = Новый Массив;
МассивДобавляемыхРеквизитов.Добавить(РеквизитФормыДерево);
    
ИзменитьРеквизиты(МассивДобавляемыхРеквизитов);
  
ДеревоЗначений = Новый ДеревоЗначений();
ЗначениеВДанныеФормы(ДеревоЗначений, ЭтаФорма.Дерево);
КонецПроцедуры

This is of course all through one place, but you can defeat this issue in this way. Only of course in your case you will need to get any form into which you programmatically push the new props.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question