Web application- java script | Community
Skip to main content
Level 3
March 30, 2020
Solved

Web application- java script

  • March 30, 2020
  • 1 reply
  • 5933 views

Hi ,

 

Iam trying to create web application to update a field password in custom schema. I created a custom schema userProfile and inserted data. I need to update the field password. For that a web form is created to enter email and new password.

 

Based on email entered by customer new password will be updated in schema. For that Iam using below javascript 

 

var temp= ctx.vars.emailID;
var tempPassword= ctx.vars.password;
var query = xtk.queryDef.create(
<queryDef schema= "cus:UserProfile" operation="select">
<select>
<node expr="@firstName"/>
<node expr="@lastName"/>
<node expr="@email"/>
<node expr="@password"/>
</select>
<where>
<condition expr="@email = temp"/>

</where>
</queryDef>)

var results = query.ExecuteQuery();

 

xtk.session.Write(<recipient xtkschema="cus:UserProfile" _operation="update" password ={tempPassword} _key="@email"/>);

 

 

Iam unable to update the field inschema.

 

Please help me here.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Milan_Vucetic

Hi @ramprakasht3196 

 

you should check if your query return anything and if you have enough privileges.

You may try like this:

 

ctx.recipient.@xtkschema="cus:UserProfile";
ctx.recipient.@_operation="update";
ctx.recipient.@_key="@email";
ctx.recipient.@password= {tempPassword} ;


xtk.session.Write(ctx.recipient)

Regards,

MIlan

 

1 reply

Milan_Vucetic
Milan_VuceticAccepted solution
Level 9
March 31, 2020

Hi @ramprakasht3196 

 

you should check if your query return anything and if you have enough privileges.

You may try like this:

 

ctx.recipient.@xtkschema="cus:UserProfile";
ctx.recipient.@_operation="update";
ctx.recipient.@_key="@email";
ctx.recipient.@password= {tempPassword} ;


xtk.session.Write(ctx.recipient)

Regards,

MIlan

 

Level 3
April 1, 2020

Thank you. Could you please tell me,  If   i use loginfo statement where to check logs for javascript in web application.