Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > how to remove a specific information regiester record

Forum

Search UsersRules
how to remove a specific information regiester record
#1
Active user
Points:: 0
Joined:: Jun 4, 2013

I found it hard to delete a record by script from the information register , it's not specified in the "a practical developers guide" book or in the 1C enterprise help ... I think 1C is hard to learn for not Russian people :(

Profile
#2
Guest
Points::
Joined::

You simply need to understand some concepts.
If you need to delete a single record, you can use Delete() method of your information register record manager. If you need to delete a bulk of records, you need to create a record set, remove those records from it and write it.

Profile
#3
Just came
Points:: 0
Joined:: Oct 8, 2012

Use

Code
InformationRegisterRecordManager.Delete()

Quote
mohammad maleh wrote:
I think 1C is hard to learn for not Russian people
Why do you think so?  ;)

Profile
#4
Active user
Points:: 0
Joined:: Jul 18, 2012

For example:

Code
   Prices = InformationRegisters.PriceList.CreateRecordSet();
   Prices.Filter.Product.Set(ProductRef);
   Prices.Filter.Period.Set(BegOfMonth(Month));
   Prices.Read();
   For Each Price In Prices Do
       Prices.Delete(Price);
   EndDo;
   Prices.Write();

Profile
#5
Just came
Points:: 0
Joined:: Oct 8, 2012

Code
   
   Prices = InformationRegisters.PriceList.CreateRecordSet();
   Prices.Filter.Product.Set(ProductRef);
   Prices.Filter.Period.Set(BegOfMonth(Month));
   Prices.Read();
   Prices.Clear();
   Prices.Write();

Profile
#6
Active user
Points:: 0
Joined:: Jun 4, 2013

thanks Stephanie Elliott, I'll try it ... 1C is a great language I really want to learn it, but  i think there is lack of examples ... i know there is forums in Russian and Turkish gives a lot of examples but I can't speak those languages ... if you want to go public i think you should take care more of English speakers ... I'm from Syria but now living in turkey ...  in syria we've never heard about 1C, in turkey it's popular a little bit :)

Profile
#7
Active user
Points:: 0
Joined:: Jun 4, 2013

Dmitry Shcherbakov, thanks a lot for helping :)

Profile
#8
Active user
Points:: 0
Joined:: Jul 18, 2012

You're welcome. This site is to compensate this lack.

Profile
#9
Active user
Points:: 0
Joined:: Jun 4, 2013

Stephanie Elliott, I appreciate your efforts ... and I'm sorry for the huge amount of questions i ask

Profile
#10
Just came
Points:: 0
Joined:: Jul 5, 2013

Quote
Dmitry Shcherbakov wrote:

1. Prices = InformationRegisters.PriceList.CreateRecordSet();
2.   Prices.Filter.Product.Set(ProductRef);
3.   Prices.Filter.Period.Set(BegOfMonth(Month));
4.   Prices.Read();
5.   Prices.Clear();
6.   Prices.Write();
Dmitry Shcherbakov,,mohammad maleh,  you don't need lines 4 & 5. Just set filter and Prices.Write()

When you use method Write() for InformationRegisters without any parameters you replace old records in filter  with new recordset. When you don't use method Read() your recordset is empty.

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.