The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

Hello there

I want to create documents with the code.
I have one document. Name the Test.
It contains 3 records.
I want to add another record. How do I do with this code?
I want to find the UUID of the created record.

Edited: Erdogan Uguz - Aug 08, 2016 01:20 PM
 
#2
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Aug 8, 2016
Company:

Hello Uguz!
It's very simple.

Code
DocTest = Documents.Test.CreateDocument();
DocTest.Write();
UUID = DocTest.Ref.UUID();

 
#3
People who like this: 0 Yes / 0 No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

hi

Code
Function TestEkleTestEkle(Request)
   Response = New HTTPServiceResponse(200);
    Result = "";
              
      
   nesne = Documents.Test.CreateDocument();

   nesne.Alan1="a";
   nesne.Alan2="b";
   nesne.Alan3="c";
   nesne.Write();
   
   Return Response;

EndFunction



Quote
{HTTPService.Test.Module(12)} : An error occurred in the process of content method call ( Write )

Edited: Erdogan Uguz - Aug 09, 2016 10:38 AM
 
#4
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Erdogan!

Maybe you have some script in the object module of the Test document that prevents writing.

If this wouldn't help, please provide a sample configuration where I could reproduce the issue. You can attach it to the message or send to int@1c.com.

 
#5
People who like this: 0 Yes / 0 No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

Thank you (www.1tc.com.tr -> Stas)

Solution :

Code
Function TestEkleTestEkle(Request)
   Response = New HTTPServiceResponse(200);
    Result = "";
                    
   nesne = Documents.Test.CreateDocument();
   nesne.date= CurrentDate(); // The date should be not empty.
   nesne.Alan1= "a";
   nesne.Alan2="b";
   nesne.Alan3="c";
   nesne.Write(DocumentWriteMode.Posting);

   
   Return Response;

EndFunction

 
Subscribe
Users browsing this topic (guests: 2, registered: 0, hidden: 0)