Setting the Deletion Mark Programmatically

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 16, 2011
Company: Oksley Shipping

I'm trying to set the Deletion Mark, but it does not save!

Here is my code:

Selection = Documents.MoneyReceipt.Select();
While Selection.Next() Do
Selection.GetObject().DeletionMark = True;
Selection.GetObject().Write();
EndDo;

Please help!

 
#2
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Try this
Selection = Documents.MoneyReceipt.Select();
While Selection.Next() Do
Object = Selection.GetObject()
Object.DeletionMark = True;
Object.Write();
EndDo;

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 16, 2011
Company: Oksley Shipping

Thank you, Alexey!
But what is the difference? It looks like I'm doing the same, but 1 line shorter?

 
#4
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Nov 24, 2011
Company:

Selection.GetObject().DeletionMark = True;  /you get the object but it's temporary and next string used another vesion of this object.
Use Gerasimov's code as is. In visual basic and another languages are same rules for programming.

 
#5
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 16, 2011
Company: Oksley Shipping

Alexey Gerasimov and Cocos, thank you very much!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.