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

Web application- java script

Avatar

Avatar
Boost 5
Level 2
ramprakasht3196
Level 2

Likes

9 likes

Total Posts

43 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 2
ramprakasht3196
Level 2

Likes

9 likes

Total Posts

43 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramprakasht3196
Level 2

30-03-2020

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.

 

ramprakasht3196_0-1585580648914.png

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.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

166 likes

Total Posts

383 posts

Correct Reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

166 likes

Total Posts

383 posts

Correct Reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile
Milan_Vucetic
MVP

31-03-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

 

Answers (0)