Controllable Locks, Setting Values

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: 3
Joined: Jul 20, 2011
Company:

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?

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

Joined:
Company:

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.

 
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.