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
Solved! Go to Solution.
Views
Replies
Total Likes
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
<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
<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:
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
Views
Replies
Total Likes
Hi Diksha,
To make sure we understand, can you provide a more detailed example of what you are trying to achieve?
Florent
Views
Replies
Total Likes
Hi Diksha,
Any update to share on this?
Florent
Views
Replies
Total Likes
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
<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
<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:
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
In the workflow Journal you can see log info
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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..
Views
Replies
Total Likes
Faced same issue. Ended up creating custom schema to store debug info with custom methods.
Views
Replies
Total Likes
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