Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > TypeLink property for attributes that are NOT in Accounting Register

Forum

Search UsersRules
TypeLink property for attributes that are NOT in Accounting Register
#1
Interested
Points:: 0
Joined:: Apr 5, 2012

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?

Profile
#2
Guest
Points::
Joined::

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

Profile
#3
Interested
Points:: 0
Joined:: Apr 5, 2012

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.

Profile
#4
Guest
Points::
Joined::

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.

Profile
#5
Guest
Points::
Joined::

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.

Profile
#6
Interested
Points:: 0
Joined:: Apr 5, 2012

great. Timofey thanks a lot so much.

Profile
#7
Active user
Points:: 0
Joined:: Apr 10, 2020

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

Profile
#8
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Profile
#9
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Profile
#10
Active user
Points:: 0
Joined:: Apr 10, 2020

Hello Alex,

What should I do? Can you give example?


Thanks,

Profile
#11
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Kind regards,
Alex

Profile
#12
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Kind regards,
Alex

Profile
#13
Active user
Points:: 0
Joined:: Apr 10, 2020

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

Profile
#14
Active user
Points:: 0
Joined:: Mar 10, 2017

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

Profile
#15
Active user
Points:: 0
Joined:: Apr 10, 2020

Thank you Alex.

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



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.