Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Controllable Locks, Setting Values

Forum

Search UsersRules
Controllable Locks, Setting Values
#1
Active user
Points:: 1
Joined:: Jul 20, 2011

In Syntax Assistant in ‘Datalock’ section there is the following script:

Code
Blocking = New DataLock;
LockItem = Blocking.Add("AccumulationRegister.GoodsInStocks");
LockItem.SetValue("Quality", Catalogs.Quality.FindByCode("1"));
LockItem.Mode = DataLockMode.Exclusive;
LockItem.DataSource = DocumentObject.ReturnableContainer;
LockItem.UseFromDataSource("Nomenclature", "Nomenclature");
LockItem.UseFromDataSource("Stock", "Stock");
Blocking.Lock();

We are setting lock on accumulation register fields for the ReturnableContainer tabular section of a document. Due to there is a SetValue method call, which sets a restriction by the Quality field, the lock will be applied only to records, having the Quality field equal to the reference to the Quality catalog item with code ‘1’. Here is the question: Will the lock be applied to all records having the Nomenclature ‘AND’ or ‘OR’ the Stock dimensions values, which are going to be set?

Profile
#2
Guest
Points::
Joined::

The controllable lock will be applied to records, having:
- the Nomenclature dimension value from the tabular section ReturnableContainer and the Quality resource value equal to the value, set;
OR
- the Stock dimension value from the tabular section ReturnableContainer and the Quality resource value equal to the value, set.
If you need to lock only by combination of Nomenclature - Stock dimensions values, which present in the tabular section, you will have to use only one UseFromDataSource operator, setting two fields, separated by a comma there.

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.