Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Setting the Deletion Mark Programmatically

Forum

Search UsersRules
Setting the Deletion Mark Programmatically
#1
Active user
Points:: 0
Joined:: Sep 16, 2011

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!

Profile
#2
Interested
Points:: 15
Joined:: Oct 27, 2011

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

Profile
#3
Active user
Points:: 0
Joined:: Sep 16, 2011

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

Profile
#4
Active user
Points:: 1
Joined:: Nov 24, 2011

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.

Profile
#5
Active user
Points:: 0
Joined:: Sep 16, 2011

Alexey Gerasimov and Cocos, thank you very much!

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



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.