Expand my Community achievements bar.

SOLVED

Could you point me to the documentation?

Avatar

Level 3

I'm trying to find good documentation about how to build a custom function with Javascript in my LS-created form.

Would someone please point me in the right direction?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Then what you are looking for is called a scripting object. It is well described in the online help in Designer.

Paul

View solution in original post

9 Replies

Avatar

Former Community Member

Hi there!

You can try this link: http://help.adobe.com/en_US/livecycle/9.0/lc_dp_list.html and under the "Creating Forms Using LiveCycle Designer ES2" heading, you can find a variety of documentation resources that include a basics guide and reference material.

Hope that helps!

...Gil

Avatar

Level 3

Thanks Gil,

I'm looking for a description of how to create a custom function within LS then

call it from various events.

The pointer you sent has lots of info but I don't seem to be able to find what

I'm seeking.

I'm not sure what I want to do can even be done within LS, do you know?

Thanks again

 Bill

Avatar

Former Community Member

Sorry, what is LS? Do you mean LC, for LiveCycle?

If you click on LiveCyc'e Designer ES2 Scripting Basics, there is a section on Events. That section may have some of events information you seek. There is a entire Application model available that let's you key in on different types of events that include Application events and form interaction events.  What are you trying to accomplish?

Avatar

Level 3

Sorry, meant LC.

I have to exec some complex code at both prePrint and preSave events (maybe also others) and am looking for a way to only write it once then execute it when I need it. A custom (global?) function may be one answer but I don't know how to create it.

Is there some other way?

Thanks

Avatar

Correct answer by
Former Community Member

Then what you are looking for is called a scripting object. It is well described in the online help in Designer.

Paul

Avatar

Former Community Member

As Paul mentions (Thanks Paul!), it is well described in the Designer Help.

Here's a direct link to the Scripting section in the Designer Help: http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000715.html#1613857.

Other subtopics that may help you with what you seek based on what I think you said you were trying to accomplish:

  • Referencing Objects in Calculations and Scripts (http://help.adobe.com/en_US/livecycle/9.0/designerHelp/000794.html#1592676)
  • To create a script object (http://help.adobe.com/en_US/livecycle/9.0/designerHelp/000819.html)
  • To reference JavaScript functions stored in a script object. ( http://help.adobe.com/en_US/livecycle/9.0/designerHelp/000820.html)

Feel free to look at other topics in the Scripting section. It is fairly comprehensive. If not, providing a snippet of code might help as well.

I presume you are familiar with working with the Scripting environment in Designer ES2. If not, there is a small calculation tutorial that shows you how to use the Script Editor (http://www.adobe.com/go/learn_lc_subtotals_9).


Hope that helps!

...Gil

Avatar

Level 3

Thanks to you both, it looks like the info I need. No doubt there will be other

questions in the future...

 Bill

Avatar

Former Community Member

You want to put your JS functions in a Scripting Object.  If you don't see one at the bottom of the hierarchy list, right click the root and add it.  Then put the code in this one place and call it from one to many places on your form.

Avatar

Level 3

Thanks to all of you for the great assistance!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----