How to change set of Command Interface of Forms by script

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

In form according some algorithm I need to control visibility of form commands as showen in attached pic. for usability of users. How can I do it?

Edited: Murat Yazlıyev - Aug 05, 2013 06:55 AM
 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Murat!

You can use roles or functional options to change visibility of items in navigation panel.

 
#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.

I know how to use roles and functional options to change visibility.

The function I need is not related with roles. Functional option may be, but functional options directly related with Constants and constants used for the whole application.

The property I want to do is: In item form there is an attribute. By changing this attribute some command will appear or disappear (This is for easy usability of my users). But this function not deadly needed, if there is way to control comman interface of form by script, it will be better for me and for my users.

Edited: Murat Yazlıyev - Aug 06, 2013 01:52 AM
 
#4
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jul 3, 2013
Company: 1C Company

Hello, Murat!

You can use functional options linked with information registers
For exaple,
If you need command linked with user that creates a document:

1. Create information register that will keep visibility settings (you can also use a catalog).
Dimension: User, resource: Visible
2. Create a functional option and a functional option parameter.
Link function option with resource of information register and functional option parameter with dimension of information register (see attachment "option.png")
3. Link command with functional option (see attachment "command.png")
4. In form module write the following script:

Code
&AtClient
Procedure UserOnChange(Item)

    SetFormFunctionalOptionParameters(New Structure("User", Object.User));

EndProcedure

&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)

    SetFormFunctionalOptionParameters(New Structure("User", Object.User));

EndProcedure


See example "1cv8.cf" in attachment. Try to change user in document and visibility of commands will change.

Download 1Cv8.cf (11.94 KB)
1C Company support team
 
#5
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, Sergey

I thought, it may be without adding any configuration metadata object (especially, without adding tables in db).

But, that example is useful for me too.

Thanks for an example.

 
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.