How can I assign a Macro value to a variable in kentico

Eswari Peravali asked on August 6, 2019 03:48

I am fetching the value of the custom field from OM_Contact as "Advanced.ContactInfo.CustomFieldName".

How can I get the value and assign to a variable? When I do Variable1 = Advanced.ContactInfo.CustomFieldName its not assigning.

Recent Answers


Juraj Ondrus answered on August 6, 2019 09:15

HAve you tried using the GEtValue("fieldName") method for given contact object? E.g. contact.GetValue("CustomFieldName");

0 votesVote for this answer Mark as a Correct answer

Eswari Peravali answered on August 12, 2019 01:27

Thank you for your Response Ondrus. I was able to place things in a where condition as "GlobalObjects.CustomTables["OMAG.Customers"].Items.Where("ItemID = " + Advanced.ContactInfo.OMAGUserRelationID)[0]["ParentDealerID"]". However I am trying to validate if the value contains null or not and when I use "if (GlobalObjects.CustomTables["OMAG.Customers"].Items.Where("ItemID = " + Advanced.ContactInfo.OMAGUserRelationID)[0]["ParentDealerID"] != null) and it doesn't do anything. I know I am missing something.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on August 12, 2019 08:28

What does the macro debug say on resolving the macro? It is hard to tell just so - I would check in the debug that all the variables do have a correct values.

0 votesVote for this answer Mark as a Correct answer

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