Link onClick event of javascript with an event of 1C

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 14, 2019
Company: 1c Vietnam

Hi everyone,
I'm creating an button in HTML by using JS and I want to assign this button with the event open a form. How can I do it?
Thank you in advance!



Duc Tien NGUYEN

 
#2
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jun 9, 2020
Company:

Hi, Duc Tien NGUYEN,

Where you generate this html view? In platform form, in email, web site or other?

For example if you use mailing and using web publishing you can generate links like
https://domain/infobase/#e1cib/data/Metadata.ElementName?ref=object_id
for example:
https://domain/infobase/#e1cib/data/Catalog.Catalog1?ref=80fe00155d00050d11eaaa40c06233d0

Path to object you can get by function "GetURL".

 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 14, 2019
Company: 1c Vietnam

Hi, Bogdan Zuy,

Quote
Hi, Duc Tien NGUYEN,

Where you generate this html view? In platform form, in email, web site or other?

For example if you use mailing and using web publishing you can generate links like
https://domain/infobase/#e1cib/data/Metadata.ElementName?ref=object_id
for example:
https://domain/infobase/#e1cib/data/Catalog.Catalog1?ref=80fe00155d00050d11eaaa40c06233d0

Path to object you can get by function "GetURL".

I generate this html view in platform form.

 
#4
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jun 9, 2020
Company:

Duc Tien NGUYEN,

ok, so I think you use "HTML document field" and you can use OnClick event. For example,

Code
<ht ml><body><button id=test>Open form</button></body></html>


Code
If(EventData.Button.id = "test") Then
   OpenForm("Catalog.Catalog1.ObjectForm");
EndIf;

 
#5
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 14, 2019
Company: 1c Vietnam

Bogdan Zuy,

Thank you so much. It works perfectly.

 
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.