Macro as default value in BizForm

Alena Mikhalchanka asked on July 18, 2014 10:39

Hi, I used the macro {%CurrentUser.UserName#%}as default value in BizForm in Kentico 7. Now I try to do the same in Kentico 8. But it doesn't work in the case of BizForm. Can You help me to understand where is the problem?

Correct Answer

Joshua Adams answered on July 18, 2014 16:12

Did you enter the macro through the macro editor? I have had problems when just pasting a macro into the field. I find that pasting the macro into the macro editing window usually works, but if you paste into the default value field, it won't work.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on July 18, 2014 14:15

Maybe have to do some checking prior now? This works for me: {% if (CurrentUser.IsAuthenticated) { CurrentUser.UserName } else { "" } @%}

1 votesVote for this answer Mark as a Correct answer

Martin Danko answered on July 20, 2014 16:45

Hello Alena,

Joshua is right, you have to use the macro editor and insert macro there instead of inserting the macro directly into the default value field.

You can open the macro editor by clicking on the small arrow between the default value field and its label.

Best regards, Martin

1 votesVote for this answer Mark as a Correct answer

Alena Mikhalchanka answered on August 12, 2014 08:31

Hello, Thank You very much. All Your advices have helped me very much.

Best regards to all You, Alena

0 votesVote for this answer Mark as a Correct answer

Suman Layek answered on May 23, 2016 19:43 (last edited on May 23, 2016 19:46)

It is not working even when I used macro editor for default text

Image Text

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.