Dynamically assign form element type

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

I have a form element which can be of a composite data type or AnyRef type. The type of this form element depends on selected value of another form element. Is it possible in OnChange event handler procedure for form element which I select manually to assign a specific data type for the form element which now has a composite data type or AnyRef type?

 
#2
People who like this:0Yes/0No
Administrator
Rating: 23
Joined: Oct 3, 2019
Company:

Hello Peter Cross,

you can use a composite data type for this attribute (scr_1) and process the OnChange event as follows (scr_2).

As a result, the attribute will consistently take the type of value you need

Download scr_1.png (56.28 KB)
Download scr_2.png (12.22 KB)
 
#3
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

In my case Attribute1 has type Enumeration and Brands, Products and Shops are combined into one element of composite type which can be one of CatalogRef.Brands, CatalogRef.Products or CatalogRef.Shops type. And Attribute1 should go first on the form.

 
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.