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

Session.Write: Insert date

Avatar

Avatar
Validate 1
Level 1
timg96297954
Level 1

Likes

2 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
timg96297954
Level 1

Likes

2 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
timg96297954
Level 1

02-10-2017

Hi guys,

I would like to use JavaScript to update a record in the recipient table.

I use the session.Write-function. How can I insert the current time into the date field "lastUpdate" in the schema for recipient "12345"?

xtk.session.Write(<recipient _operation="update" _key="@id" lastUpdate={getDate()} id="12345" xtkschema="nms:recipient"/>);

getDate does not work.

Thanks for your help in advance.

Greetings,

Tim

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 1
Level 2
sambhavj5011451
Level 2

Likes

5 likes

Total Posts

12 posts

Correct Reply

2 solutions
Top badges earned
Ignite 1
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Ignite 1
Level 2
sambhavj5011451
Level 2

Likes

5 likes

Total Posts

12 posts

Correct Reply

2 solutions
Top badges earned
Ignite 1
Validate 1
Boost 5
Boost 3
Boost 1
View profile
sambhavj5011451
Level 2

04-10-2017

Hi Tim,

This works well.

var modifiedDate = formatDate(new Date(), "%4Y-%2M-%2D %02H:%02N:%02S")

xtk.session.Write(<recipient _operation="update" _key="@id" lastUpdate={modifiedDate} id="12345" xtkschema="nms:recipient"/>);

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

02-10-2017

Hello Tim,

Please use getCurrentDate() in pure Javascript code, not GetDate().

GetDate() is used in:

  • XML source schemas, see for example nms:recipient.created (NmsRecipient.tsCreated).
  • Query activity (expression editor on dates)
  • queryDef in Javascript activity

But  there is an attribute lastModified in the schema nms:recipient (sql table column: NmsRecipient.tsLastModified), so I wonder what is LastUpdate field ?

Or is it new field of ACS ? (I use Adobe Campaign v6.1.1).

Regards
J-Serge