The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Feb 28, 2012
Company:

I have a tabular section which is common in many documents.
For example lets say my tabular section fields are ItemRef(Catalog reference) and price (Number)

Lets say that on the Document Form I need to handle the event of changing the ItemRef as follows:

when the ItemRef changes i need to call the server, get the last price from an information register and populate the price field

My problem is that i dont want to write the same code on the document form of all the documents. Is it possible to put this code inside a common module and how?

What is the best practice for creating this sort of mudularity on managed forms development?

 
#2
People who like this: 0 Yes / 0 No
Just came
Rating: 1
Joined: Apr 17, 2012
Company: Zoi TechCon GmbH

Hi,
You may cre ate   procedure or function with reserved word "Export" in "Common Module" and call it when you need.

 
#3
People who like this: 0 Yes / 0 No
Just came
Rating: 1
Joined: Apr 17, 2012
Company: Zoi TechCon GmbH

For example:

Code
Function GetPrice(Ref) Export

   Price = 100;
   
   Return Price;

EndFunction

In properties of module you must set "Server" and "Server call"

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)