TypeLink property for attributes that are NOT in Accounting Register

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

#1
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi,

We have two documents:
1. Accounting Doc.
This document doesn't contain tabular section. In form as tabular section viewed register record set table.
For ExtraDimension 1,2,3 fields typelink is setted form according account.

So when user choose account, extradimension 1,2,3 fields are automatically become readonly or not.

2. Another Document.
This document contain tabular section. In tab. section there are 4 attributes Account, ExtraDimension 1,2,3.
For ExtraDimension 1,2,3 fields typelink is setted form according account.

So when user choose account, extradimension 1,2,3 fields are NOT automatically become readonly or not.

Question: The logical work of TypeLink property is changed according table type? Or it's little bug?

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Murat!
Would you please provide the configuration where this issue can be reproduced?

 
#3
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi Timofey,

We have prepared for you a configuration. There are two docs: 1 - With account attribute. 2 - Without account attribute, using register record fields.

 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Thank you for the information, Murat.

This is a bit more complicated task as you must use script here to make fields dependent.

I will provide you an example shortly.

 
#5
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

There are two key features that you have to use.

The first one is you need to get account parameters:

Code
Query = New Query;
Query.SetParameter("Account", Account);
   
Query.Text = 
"SELECT
|   Accounting.Ref,
|   Accounting.Parent,
|   Accounting.Code,
|   Accounting.Description,
|   Accounting.Type,
|   Accounting.OffBalance,
|   Accounting.DontUse,
|   Accounting.ByCurrency,
|   Accounting.ByQuantity,
|   Accounting.ByDepartment,
|   Accounting.ForTaxes
|FROM
|   ChartOfAccounts.Accounting AS Accounting
|WHERE
|   Accounting.Ref = &Account
|;
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
|   ChartOfAccountsAccountingAnalytics.LineNumber AS LineNumber,
|   ChartOfAccountsAccountingAnalytics.ExtDimensionType AS AnalyticalDimensionType,
|   ChartOfAccountsAccountingAnalytics.ExtDimensionType.Description AS Description,
|   ChartOfAccountsAccountingAnalytics.ExtDimensionType.ValueType AS ValueType,
|   ChartOfAccountsAccountingAnalytics.TurnoversOnly AS TurnoversOnly,
|   ChartOfAccountsAccountingAnalytics.ByAmount AS ByAmount
|FROM
|   ChartOfAccounts.Accounting.ExtDimensionTypes AS ChartOfAccountsAccountingAnalytics
|WHERE
|   ChartOfAccountsAccountingAnalytics.Ref = &Account
|
|ORDER BY
|   ChartOfAccountsAccountingAnalytics.LineNumber";
   
ResultArray   = Query.ExecuteBatch();
   
Selection = ResultArray[0].Select();
If Selection.Next() Then
   FillPropertyValues(AccountData, Selection);
EndIf;
      
AnalyticalDimensionTypesSelection = ResultArray[1].Select();
      
AccountData.AnalyticalDimensionCount = AnalyticalDimensionTypesSelection.Count();
      
Index   = 0;
      
While AnalyticalDimensionTypesSelection.Next() Do
      
   Index = Index + 1;
      
   AccountData.Insert("AnalyticalDimensionType" + Index, 
      AnalyticalDimensionTypesSelection.AnalyticalDimensionType);
   AccountData.Insert("AnalyticalDimensionType" + Index + "Description", 
      AnalyticalDimensionTypesSelection.Description);
   AccountData.Insert("AnalyticalDimensionType" + Index + "ValueType", 
      AnalyticalDimensionTypesSelection.ValueType);
   AccountData.Insert("AnalyticalDimensionType" + Index + "ByAmount", 
      AnalyticalDimensionTypesSelection.ByAmount);
   AccountData.Insert("AnalyticalDimensionType" + Index + "TurnoversOnly", 
      AnalyticalDimensionTypesSelection.TurnoversOnly);
   
EndDo;

Code
Function GetMaxAnalyticalDimensionCount() Export

   Return Metadata.ChartsOfAccounts.Accounting.MaxExtDimensionCount;

EndFunction


Then set form attributes to let this data be used in Conditional appearance:
Code
For Index = 1 to MaxAnalyticalDimensionCount Do
   If ObjectFields.Property("AnalyticalDimension" + Index) Then
      Object[ObjectFields["AnalyticalDimension" + Index] + "Enabled"] 
         = (Index <= AccountData.AnalyticalDimensionCount);
   EndIf;
EndDo;


And the second is Conditional appearance. The current recommendation is to set Conditional appearance using Script as it it easier to monitor when you make changes in your applied solution.
Code
For Index = 1 To AccountingServerCallCached.GetMaxAnalyticalDimensionCount() Do
   ConditionalAppearanceItem = ConditionalAppearance.Items.Add();
   AdjustedField = ConditionalAppearanceItem.Fields.Items.Add();
   AdjustedField.Field = New DataCompositionField("RecordsAnalyticalDimension" + Index);
   FilterItem = ConditionalAppearanceItem.Filter.Items.Add(
      Type("DataCompositionFilterItem"));
   FilterItem.LeftValue = New DataCompositionField("Object.Records.AnalyticalDimension" 
      + Index + "Enabled");
   FilterItem.ComparisonType = DataCompositionComparisonType.Equal;
   FilterItem.RightValue = False;
   ConditionalAppearanceItem.Appearance.SetParameterValue("Enabled", False);
EndDo;


I have prepared a complete example for you. See the attached .cf file for that.

Download 1Cv8.cf (47.96 KB)
 
#6
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

great. Timofey thanks a lot so much.

 
#7
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Apr 10, 2020
Company:

Hello Murat,
How can I multiply ChartOfAccounts by company?

Sample
ChartOfAccounts A company
      100 XXX
      200 XXX
      500 XXX
ChartOfAccounts B company
      100 XXX
      200 XXX
      500 XXX
ChartOfAccounts C company
      100 XXX
      200 XXX
      500 XXX

 
#8
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 10, 2017
Company: Rufinor

Dear Ertuğrul Erdoğan!

There is no need to do it like this. If you use multiple organizations structure, each if them will have access to chart of accounts

Kind regards,
Alex

 
#9
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 10, 2017
Company: Rufinor

Dear Ertuğrul Erdoğan!

There is no need to do it like this. If you use multiple organizations structure, each if them will have access to chart of accounts

Kind regards,
Alex

 
#10
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Apr 10, 2020
Company:

Hello Alex,

What should I do? Can you give example?


Thanks,

 
#11
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 10, 2017
Company: Rufinor

Chart of accounts are available for all companies by default. No need to multiply them for each company

Kind regards,
Alex

 
#12
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 10, 2017
Company: Rufinor

It would be good if you let me know what exactly you want to do with the chart of accounts.

Kind regards,
Alex

 
#13
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Apr 10, 2020
Company:

Hello,
Company A
Company B
Company C
I want to make a separate account plan for these companies. I do not want the account amounts to be confused. I want to get a separate trial. If there is a single account plan, I cannot parse and accounts get confused.
Sample
Company A 600.01.01        account
Company B 600.01.002       account
Company C 600.01.003.001   account
this can happen.

Kind regards

 
#14
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 10, 2017
Company: Rufinor

What 1c solution are you using now? Is this an existing solution or you want to make your own fr om scratch ?

Basically in 1c there is no need to make the way you want to do. All information in accounting registers is kept with dimensions/filters of the company and account number. So, you can filter accounting information by company and/or account number. For example all information for Company A on account 600.01.01 in accounting register is kept separately of Company B and so on.  So, you just need to make 1 chart of accounts and provide dimension for companies in it.

If you still prefer to see separate accounts for each company you can have one single chart of accounts still but make a filter for each account and link it to certain company. It will mean that account 600.01.01 belong to company A, 600.01.003.001  account to Company C, etc. Then use this filter in each form wh ere you open account for selection.

Hope this is helpful t you. If you need more information about it or need further help you can contact me on info@rufinor.ru

Kind regards,
Alex

 
#15
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Apr 10, 2020
Company:

Thank you Alex.

 
Subscribe
Be the first to know tips & trick 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.