Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

how to use javascript functions in input form

Avatar

Avatar
Validate 1
Level 2
dikshac45201755
Level 2

Likes

2 likes

Total Posts

8 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
dikshac45201755
Level 2

Likes

2 likes

Total Posts

8 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
dikshac45201755
Level 2

03-04-2018

I want to implement my java script function through form rather than workflow. When user put values in form at that moment i want to data to get reflected to user.

Thanks,

Diksha

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile
MarcelSzimonisz
MVP

10-05-2018

Hello dikshac45201755​,

You need to implement input button in your form which will call method in your schema

Some information can be found here:

1. In your form add input

Form structure

<input enabledIf="" img="" label="Label" type="button">

     <enter>

       <soapCall name="soapCallName" service="namespace:schema"> // xtk:workflow

           <param exprIn="[@attribute1]" type="boolean"/>

           <param exprIn="[element/@attribute2]" type="int"/>

           <param exprIn="[attribute3]" type="string"/>

           ..

           ..

        </soapCall>

        <reload/>

      </enter>

</input>

2. In your schema add method

Schema structure

<method library="namespace:yourJavaScript.js" name="soapCallName" static="true">

    <parameters>

      <param inout="in" name="attribute1" type="boolean"/>

      <param inout="in" name="attribute2" type="long"/> // it does not know int type 🙂

      <param inout="in" name="attribute3" type="string"/>

        ..

        ..

    </parameters>

</method>

3. Last but not least add your JS function to JavaScript codes folder:

Implementing SOAP methods

Data oriented APIs

Can be something as below:

function namespace_schema_soapCallName(attribute1, attribute2, attribute3,..,..){ 

   xtk.session.Write(<schema xtkschema="namespace:schema"

      _operation="update" attribute1={attribute1}  attribute2={attribute2}  attribute3={attribute3} ...

      _key="@attribute2"

  />);

}

llName

Marcel

Answers (8)

Answers (8)

Avatar

Avatar
Validate 1
Level 4
pierrec70731455
Level 4

Likes

62 likes

Total Posts

59 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 4
pierrec70731455
Level 4

Likes

62 likes

Total Posts

59 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
pierrec70731455
Level 4

18-04-2019

Hi dikshac45201755,

The logs are just going to be visible int the web@default.

If you want to print the logs in some workflow logs you are probably going to have :

* add a dummy activity in your workflow

* create a task with NLWS.xtkWorklflowTask.create(...) with the workflowID

* create the logs with NLWS.xtkWorkflowLog.create(...) with the newly created taskID and the workflowID

Pierre

Avatar

Avatar
Contributor
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

57 posts

Correct Reply

14 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

57 posts

Correct Reply

14 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back
View profile
saikatk2447661
Level 3

13-09-2018

Faced same issue. Ended up creating custom schema to store debug info with custom methods.

Avatar

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile
MarcelSzimonisz
MVP

13-09-2018

i do no know what is javascript code inside button click ..Do you mean in web apps?  there is no debug tool only debug i could use was logError(ctx) but triggered from web browser to speed up the process..

Avatar

Avatar
Validate 1
Level 2
Aalokitoaami
Level 2

Likes

14 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
Aalokitoaami
Level 2

Likes

14 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Aalokitoaami
Level 2

12-09-2018

marcel.gent.86​,

Sorry if I am missing anything. But here we are talking about input forms and I am adding the Javascript code inside the button click. So the logInfo is not associated with any workflow.

I checked the XtkWorkflowLog table also to be double sure and also checked the XtkJobLog. But there is not reference to the log. Any help is really appreciated. I am doing alert("message") for debug but seems that button click just allows the first alert. Any subsequent alerts are suppressed.

Avatar

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile
MarcelSzimonisz
MVP

12-09-2018

In the workflow Journal you can see log info

2018-09-12_09-29-53.png

Avatar

Avatar
Validate 1
Level 2
Aalokitoaami
Level 2

Likes

14 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
Aalokitoaami
Level 2

Likes

14 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Aalokitoaami
Level 2

11-09-2018

Hi marcel.gent.86​,

I want to try the same thing and trying to use the logInfo function inside the javascript as mentioned in Implementing SOAP methods But I don't know where these logInfo store the messages. For workflpow it writes to log. Where does the input form stores the messages?

Thanks,

Tarun

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

09-05-2018

Hi Diksha,

Any update to share on this?

Florent

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

18-04-2018

Hi Diksha,

To make sure we understand, can you provide a more detailed example of what you are trying to achieve?

Florent