How to create an accumulation register balance form?

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

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 25, 2012
Company: Care Small Animal Hospital

Aho!

Could someone help me with an advice: I need to display item stock balance by item characteristics. And this form should open when I click a link in the item's form navigation panel. What are my steps to do that?

Thanks in advance!

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Sep 16, 2011
Company: individual

Hello, Simon!

Let's take a 1C:Subsystems Library 1.0 as an example.

First you need to create a form to display the accumulation register balance.
1. In the configuration tree go to AccumulationRegisters->Inventory->Forms and add a new Generic form and name it ItemInventory;
2. In form attributes add an attribute of DynamicList type and name it List;
3. Mark CustomQuery and Main attribute check boxes and click Open in ListSetup property;
4. Click Query Builder;
5. Drag AccumulationRegisters->Inventory.Balance table from Database tree to Tables table and double click on the InventoryBalance row to fill Margins table with all fields of that table;
6. Click Virtual table parameters and type &Period in the Period field and Item = &Item in the Condition field;
7. Click OK and see the generated query in Query tab;

Code
SEL ECT
   InventoryBalance.Company,
   InventoryBalance.Account,
   InventoryBalance.Item,
   InventoryBalance.CustomerOrder,
   InventoryBalance.QuantityBalance,
   InventoryBalance.AmountBalance
FROM
   AccumulationRegister.Inventory.Balance(&Period, Item = &Item) AS InventoryBalance

8. Choose AccumulationRegister.Inventory.Balance in Main table field below;
9. Click OK and expand the List form attribute to see the query fields are added to that attribute as columns;
10. Drag the List attribute fr om Attributes tab of the form builder to the Form tree and click Yes to add all columns, then click Command bar of the form (above the List row) and unmark Autofill property for it to remove command bar duplication on form;
11. Go to Parameters tab, add a parameter named Item and having CatalogRef.Items type and mark Key parameter check box for it
12. Double click on the root of form tree (named Form) on the left and in Events parameter group click on Open button of OnCreateAtServer property
13. Replace the selected text of the comment (// Ins ert handler contents.) with the following code to substitute Item, passed to the form as a parameter and the current date into the list query:
Code
   List.Parameters.SetParameterValue("Item", Parameters.Item);
   List.Parameters.SetParameterValue("Period", CurrentDate());

Now you need to display a command which will open this form in the navigation panel of Items catalog.
14. In the configuration tree go to Common->Common commands and add a new command with OpenItemInventory name;
15. Set the Group property of this command to Form navigation panel.Important and the Command parameter property to CatalogRef.Items;
16. Click Open in Command module property;
17. Replace the commented text in the handler template with the following code:
Code
   Parameters = New Structure;
   Parameters.Insert("Item", CommandParameter);
   
   OpenForm(
      "AccumulationRegister.Inventory.Form.ItemInventory", 
      Parameters,
      CommandExecuteParameters.Source, 
      CommandExecuteParameters.Uniqueness, 
      CommandExecuteParameters.Window);

Now you need to se t permissions for users to allow viewing this form
18. In the configuration tree go to Common->Roles and add a new role with ViewItemInventory name;
19. In Rights tab go to Common->Common commands->OpenItemInventory and mark View check box, then go to Accumulation registers->Inventory and mark Read and View check boxes;
20. To apply changes you need to click Menu->Configuration->Upd ate Database Configuration (F7);
21. To add this role to some user you need to go to Menu->Administration->Users, choose one of them and on Other tab mark View item inventory, for example se t this right for DanielVO;

To see the result run this infobase in the 1C:Enterprise mode log in the infobase using DanielVO account.
 
Good luck with 1C!

Download 1.png (69.14 KB)
Download 2.png (39.7 KB)
Download 3.png (21.8 KB)
Download 4.png (34.78 KB)
Download 5.png (55.06 KB)
Edited: Samuel Harris - Oct 25, 2012 06:29 PM
 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 25, 2012
Company: Care Small Animal Hospital

Wow! Thanks a lot, Samuel!

 
#4
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 29, 2012
Company:

Hello, Samuel!
I have tried to follow your instructions, but when I was trying to set a new role to a user I could not find it in the list of available roles...

 
#5
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 29, 2012
Company:

Sorry, my mistake, I've missed

Quote
20. To apply changes you need to click Menu->Configuration->Upd ate Database Configuration (F7);

 
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.