Can not call a function of a common module

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

#1
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jan 17, 2013
Company: Alaska Fitness

I created a common module and a CreateItem procedure inside of it.

Code
Procedure CreateItem() Export
   // ...
EndProcedure

Trying to call it from a command handler in my form:
Code
&AtClient
Procedure CreateNewItem(Command)
   CreateItem();
EndProcedure

But receive the following error:

{Catalog.LaundryItems.Form.ItemForm.Form(4,2)}: Procedure or function with the specified name is not defined (CreateItem)
<<?>>CreateItem(); (Verification: Thin client)

What's wrong?

 
#2
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Sep 26, 2012
Company: individual

You need call procedure with name of common module, like so

Code
CommonModule1.CreateItem();

or set property "Global" of Common module

and also if Common module at Server and you call procedure from Client procedure (&AtClient) then you need set property "Server call" of Common module

Edited: ivan avdonin - Jan 17, 2013 11:14 AM
 
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.