Get Value of custom page type field in transformation of repeater with macro

kalpak shambharkar asked on June 13, 2017 16:59

I have a scenario where i want to get the value of custom page type inside transformation with help of macro. I have written a macro method which accepts one parameter whose value I want from custom page type field. I am using a Repeater web part in which I am using my custom macro method in which I have to pass the value of custom page type field.

Recent Answers


Prashant Verma answered on June 13, 2017 20:02

Hi Kalpak,

Can you provide a piece of code how you writing transformation you are calling so its better to understand , by the way with your question it seems you having calling issue with custom page type value and passing it to your custom macro on transformation.

There are in general two cases.

1.You not selected your custom page type in the repeater as datasource.

2.Your custom macro method not working properly.

Solution

  1. Make sure you calling rightly your value using .net expression like this in transformation.

<%Eval("CustomPageTypeFieldValue")#%>

2.Calling custom macro method.

<%CustomMacroMethod(Eval("CustomPageTypeFieldValue"))#%>

Thanks

Happy to help you

1 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on June 13, 2017 22:04

Also you could test your macro in System -> Macro -> Console

0 votesVote for this answer Mark as a Correct answer

kalpak shambharkar answered on June 14, 2017 10:29

Hello Prashant, Actually I want to add macro method in Transformation name field of Repeater web part and not in actual transformation, we have written a custom macro method which will return me transformation name based on some parameters and I want to pass parameter to the macro method,this parameter will be custom page type field value. How can I pass this custom page type field value.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on June 14, 2017 10:49

Kalpak, what are you trying to achieve here? May be there is a simpler solution? Would you like to discuss it here?

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on June 14, 2017 16:10

Kalpak,

macros have context, you can access the "CurrentDocument" macro in transformations, so have you tried to use that to load the value you are seeking?

THe CurrentDocument MAY not have the custom page type information available, try first CurrentDocument.GetValue("TheColumn"), if that doesn't work then you may have to use the macros to load the document with full data and then GetValue, such as Documents[CurrentDocument.NodeAliasPath].GetValue("TheColumn")

0 votesVote for this answer Mark as a Correct answer

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