I have following custom Macro method setup
[MacroMethod(typeof(bool), "Comment ", 2)]
[MacroMethodParam(0, "id", typeof(int), "Comment")]
[MacroMethodParam(1, "number", typeof(int), "Comment")]
public static object Method(EvaluationContext context, params object parameters)
When I run the Macro, I'm getting following error: Method for object of type 'System.Int32' not found, please check the macro or the method declaration.
Method for object of type 'System.Int32' not found, please check the macro or the method declaration.
Is there something wrong in my setup?
I've found the solution.
Calling Method(ToInt(123),456) did fix the issue.
I assume you've followed the docs: docs.kentico.com/.../registering-custom-macro-methods
Have you also registered them?
And the code us supplied your macro will be called literally as Method(123,456), as I expect you want something as GetComment(123,456)?
I've registered my MacroMethodContainer as
[assembly: RegisterExtension(typeof(CustomMacroMethods), typeof(int))]
I've been following the documentation.
The Container is places in another project.
Please, sign in to be able to submit a new answer.