InformationRegister updating

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

#1
People who like this:0Yes/0No
Interested
Rating: 13
Joined: Sep 30, 2020
Company: Nortek Bilişim

Hello,

I want to update informationregister records.Is it possible?

For example,I have an information register below;

Car           gear
 Opel               manuel
 Seat               automatic

if car name is opel in the info register,change gear manuel to automatic.Is it possible and How?

Edited: Mesut Kahraman - Dec 07, 2020 06:36 PM
 
#2
People who like this:0Yes/0No
Administrator
Rating: 12
Joined: Oct 3, 2019
Company:

Dear Mesut,

yes, of course it is possible.

For example, your register is called "Cars", it has Dimension "Car", and Resource is "Gear" (see screenshot).

In this case, the source code could be like this:

Code
&AtServer
Procedure Command1AtServer()
   
   RecordSet = InformationRegisters.Cars.CreateRecordSet();
   RecordSet.Filter.Car.Set("Opel");
   RecordSet.Read();
   
   If RecordSet.Count() Then 
      Record = RecordSet[0];
      Record.Gear = "automatic";
      RecordSet.Write();
   EndIf;
   
EndProcedure



Best,
Aleksandr

 
#3
People who like this:0Yes/0No
Interested
Rating: 13
Joined: Sep 30, 2020
Company: Nortek Bilişim

Thank you very much!

 
Subscribe
Be the first to know tips & trick 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.