Expand my Community achievements bar.

Importing Script Object

Avatar

Former Community Member
Is it possible to make a Script Object part of the library in order for quick drag-and-drop additions to forms?
5 Replies

Avatar

Level 6
Create an empty subform and put your script object under that in the form hierarchy. Then you can drag the subform into the custom objects tab for sharing.

Avatar

Former Community Member
I tried that, but it does not add. What am I doing wrong?

Avatar

Former Community Member
Unfortunately, it's not possible to add a Script Object to the Object library. What I do is copy my Script Object script to another scriptable object (e.g. a Text Field) and call it "Script Object scripts" and save it in my personal custom library. Then you can copy/paste the scripts to another form's Script Object.

Avatar

Level 6
I don't know what you're doing wrong. It works for me. The subform acts as a wrapper so that you can add the script object to the custom library.



- From the library tab, drag a subform onto your form.

- In the hierarchy tab, right click the subform that you just added and click "insert script object"

- Put your code in the script object.

- Drag the subform from the Design View (not the hierarchy) to the Custom library tab for sharing/reuse.

- In the hierarchy, move the script object from the subform node to the page node

- Delete the subform.



To use the script object.

- Drag the custom subform onto the Design View

- In the hierarchy, move the script object under the page node

- Delete the subform.

Avatar

Former Community Member
Ahhh. Ok! That works. I was trying to drag it from the hierarchy, not the form. In fact, I can even call the code from the object while its in the Subform making it very portable and not requiring it to be unwrapped.



Works perfectly, thanks!