Saving prices in information register when importing

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Interested
Rating: 11
Joined: Nov 10, 2011
Company: 1A Software e.U

Hello!

I am trying to import products from an excel-sheet. Everithing is going well except for writing into pricelist (information register).

Code

Reg = InformationRegisters.PriceList.CreateRecordManager();
Reg.Product = NewProduct.Ref;
NewPrice = ExcelApp.Sheets(CurrentNumber).Cells(NRows,NColumns +3).Value;
Period = ExcelApp.Sheets(CurrentNumber).Cells(NRows,NColumns +5).Value;
Reg.Period = Period;
Reg.Price = NewPrice;
Message(Period); // this message is just to see that date is readed correctly, it is
Reg.Write(True);



What is wrong?
Thank you in advance for any suggestion!

 
#2
People who like this:0Yes/0No
Interested
Rating: 11
Joined: Nov 10, 2011
Company: 1A Software e.U

Sorry, I solved the problem myself.

I just wrote this code below of

Code
NewProduct.Write();


Otherwise the product was not saved and I tried:

Code
Reg.Product = NewProduct.Ref;


Now it works!  :)

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks 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.