The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Hi everyone;

I have a problem and I couldn't solve this.

Firstly I explain with codes.

Here I try to open new form and send data to this form.

Code
mActiveRow = Items.Sorular.CurrentData;
   NullUnicID            = New UUID("00000000-0000-0000-0000-000000000000");
   If mActiveRow.UnicID  = NullUnicID  Then
      mActiveRow.UnicID = New UUID();
   EndIf; 
   FrmStr = New Structure();
   FrmStr.Ins ert("pQuestionUnicID",mActiveRow.UnicID);
   FrmStr.Insert("pSurvey", Object.AnketAdı);
   FrmStr.Insert("pQuestion",mActiveRow.Soru);
   If Object.Ref.IsEmpty() Then
      FrmStr.Insert("pSurveyRef",GetEmptyRef());
   Else
      FrmStr.Insert("pSurveyRef", Object.Ref);
   EndIf;
   If Object.Seçenekler.Count() > 0 Then
      OptionList = New ValueList();
      For Each CrrOptionItem In Object.Seçenekler Do
         OptionStr = New              Structure("SoruUnicID,UnicID,Seçenek,Cevap");
         OptionStr.SoruUnicID = CrrOptionItem.SoruUnicID;
         OptionStr.UnicID     = CrrOptionItem.UnicID;
         OptionStr.Seçenek    = CrrOptionItem.Seçenek;
         OptionStr.Cevap      = CrrOptionItem.Cevap;
         OptionList.Add(OptionStr);
      EndDo;
      FrmStr.Insert("pOptionList",OptionList)
   Else
      FrmStr.Insert("pOptionList",Undefined);
   EndIf;
   ModalResult = OpenFormModal("CommonForm.AnketSeçeneklerFormu",FrmStr);
   If ModalResult <> Undefined Then
      FillOptions(ModalResult);
   EndIf;


And here is other form OnCreateServer procedure. I handled ValueList if it's not undefined.

Code
   
     If ThisForm.Parameters.pOptionList <> Undefined Then
      For Each CrrOption In ThisForm.Parameters.pOptionList Do
         NewOptionItem = OptionTable.Add();
         NewOptionItem.SoruUnicID = CrrOption.SoruUnicID;
         NewOptionItem.UnicID     = CrrOption.UnicID;
         NewOptionItem.Seçenek    = CrrOption.Seçenek;
         NewOptionItem.Cevap      = CrrOption.Cevap;
      EndDo; 
   EndIf;


But when i run I got en error. I tried to breakpoint and look datas via shift+f9 and it doesn't have any problem but it couldn't find SoruUnicID. I don't understand. I am sharing screenshots now.

Here is formdatacollection Item. I mean in this I handle values and try to add Table on form. I checked shift+f9 and all can find all areas of table.
1.jpg

Here this val ue of come data. I defined form parameter as valuelist and this valuelist put on structure. I checked this with shift+f9 and can find all areas of structure no problem.
2.jpg

But I got this erro. This error says "Object's area couldn't find (SoruUnicID) but I checked may times maybe I write wrong chracter, syntax error but it seem fine.
3.jpg

Well, what may be this reason? How can I solve this?

Download 1.jpg (110.84 KB)
Download 2.jpg (94.57 KB)
Download 3.jpg (112.21 KB)
 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Mehmet Tuğrul SARIÇİÇEK.

Could you please create an external data processor where I could reproduce your issue?

 
#3
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Thank you Timofey Bugaevsky,

I solved this and I want to explain to you what is reason of this problem.

Normally If we added Structure to array we can call like this.

Code
 For Each CrrStructure In StructureArray Do
   Item1 = CrrStructure.Item1;
   Item2 = CrrStructure.Item2.
 EndDo


But If we add Structure to ValueList we can't access to structure datas like this. It's the reason of my problem, we have to call like this

Code
 For Each CrrStructure In ValueList Do
   Item1 = CrrStructure.Value.Item1;
   Item2 = CrrStructure.Value.Item2;
 EndDo
EndDo


I solve like this.

Edited: Mehmet Tuğrul SARIÇİÇEK - Oct 21, 2015 01:03 AM
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)