The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 5
Joined: Jun 4, 2013
Company:

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 :(

 
#2
People who like this: 1 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
#3
People who like this: 1 Yes / 0 No
Just came
Rating: 0
Joined: Oct 8, 2012
Company: SPD Shcherbakov

Use

Code
InformationRegisterRecordManager.Delete()

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

Edited: Dmitry Shcherbakov - Jul 04, 2013 04:36 AM
 
#4
People who like this: 1 Yes / 0 No
Active user
Rating: 2
Joined: Jul 18, 2012
Company: Bristol IT Solutions, LLC

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();

 
#5
People who like this: 1 Yes / 0 No
Just came
Rating: 0
Joined: Oct 8, 2012
Company: SPD Shcherbakov

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

 
#6
People who like this: 0 Yes / 0 No
Active user
Rating: 5
Joined: Jun 4, 2013
Company:

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 :)

 
#7
People who like this: 0 Yes / 0 No
Active user
Rating: 5
Joined: Jun 4, 2013
Company:

Dmitry Shcherbakov, thanks a lot for helping :)

 
#8
People who like this: 1 Yes / 0 No
Active user
Rating: 2
Joined: Jul 18, 2012
Company: Bristol IT Solutions, LLC

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

 
#9
People who like this: 0 Yes / 0 No
Active user
Rating: 5
Joined: Jun 4, 2013
Company:

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

 
#10
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Jul 5, 2013
Company:

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.

Edited: Dmitry Afanasyev - Jul 05, 2013 05:51 AM
 
Subscribe
Users browsing this topic (guests: 2, registered: 0, hidden: 0)