cancel
Showing results for 
Search instead for 
Did you mean: 

Question on initialize method (p. 255 of WDJ Tutorial #3 )

Former Member
0 Kudos

At the top of p. 25 of Tutorial #3, the code block says to add the line:

(a)

wdContext.currentContextElement().setBirthday(new Date(0)));

When I do this, an error message results saying that setBirthday takes a string argument.

So I change the above line to:

b)

wdContext.currentContextElement().setBirthday(new Date(0)));

and the error message goes away.

What's going on here? Is (a) a mistake in the tutorial, or have I overlooked something somewhere ?

Thanks

Dave

Accepted Solutions (1)

Accepted Solutions (1)

former_member181923
Active Participant
0 Kudos

This was just a typo in my post here - I have 2 parens in the code.

Former Member
0 Kudos

Check the type of your context attribute. It should be a date type and not a string type.

Regards,

Christophe

former_member181923
Active Participant
0 Kudos

So. if you're right, then the tutorial is wrong on p.12 or p.25.

I think I should leave the type string. What do you think ???

Thanks for taking the time to reply

Former Member
0 Kudos

Yep it seems there is an error on page 12. If you import the attached source and if you check the simple type BirthDay in the dictionary (in your studio), you can see that the build-in type is set to date and not to string. It is also expected to use a date type for a birthday.

Regards,

Christophe

Answers (0)