account numbe r for posting

Accounting and inventory IFRS/GAAP suite for SMB. General questions. See 1C:AccountingSuite details

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

Usually a user should select an account number in the header of document, for example ARAccount (for Debit). And for example a credit account is saved in Items.
I need to write a fix account number in the object module code. In my case it is 4020 (Income 20%). So if I write Record.Account = 4020 for posting, I get an error. What is the syntax for such kind of record?

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 29, 2011
Company: 1C Company

It's not recommended. Account numbers need to be in settings or document forms so a user can change them.

But anyway, use FindByCode like in this example:

&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
Object.Account = ChartsOfAccounts.ChartOfAccounts.FindByCode("4020");
EndProcedure

 
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.