The 1C:Enterprise developers forum
Hi.I have got a catalog table.-Code-DescriptionI can ins ert record with code.newrow = Catalogs.MyCatalog.CreateItem();newrow.Description = "New Val ue";newrow.Write();I want to know the added number after adding the record.What should I do for this?Sampleinsertedcode = newrof.Code ????or ?What should I do?
Dear Erdoğan Uğuz,Here is the piece of code that solves the task you mentioned:
&AtServerNoContext Procedure AddNewItemAtServer() MyNewItem = Catalogs.MyCatalog.CreateItem(); MyNewItem.Description = NStr("en = 'This is my new item'"); MyNewItem.Write(); ItemCode = MyNewItem.Code; EndProcedure