Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Im doing some stuff with action handlers in an old installation (Umbraco 3), and I have a minor problem.
Some of the code look like this
Boolean umbraco.BusinessLogic.Actions.IActionHandler.Execute(umbraco.cms.businesslogic.web.Document documentObject, umbraco.interfaces.IAction action) { if (documentObject.ContentType.Alias == "blogComment" && action.Alias == "create") { try { Document doc = new Document(documentObject.Parent.Id); GetMemberList(doc.getProperty("guid").Value.ToString(), documentObject.getProperty("authorEmail").Value.ToString()); documentObject.Save(); } catch (Exception) { return false; } return true; } else { return false; } }
I need to get the value in bold, but it's empty - I guess it's because the handler fires "too early". Is there something I can do...like using an action that fires after publish? Or any other way I can get this value.
/Mikkel
Okay...Im just blind
I changed: return new umbraco.interfaces.IAction[] { new umbraco.BusinessLogic.Actions.ActionNew()};
To:return new umbraco.interfaces.IAction[] { new umbraco.BusinessLogic.Actions.ActionPublish()};
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Action handlers in Umbraco 3
Hi,
Im doing some stuff with action handlers in an old installation (Umbraco 3), and I have a minor problem.
Some of the code look like this
Boolean umbraco.BusinessLogic.Actions.IActionHandler.Execute(umbraco.cms.businesslogic.web.Document documentObject, umbraco.interfaces.IAction action)
{
if (documentObject.ContentType.Alias == "blogComment" && action.Alias == "create")
{
try
{
Document doc = new Document(documentObject.Parent.Id);
GetMemberList(doc.getProperty("guid").Value.ToString(), documentObject.getProperty("authorEmail").Value.ToString());
documentObject.Save();
}
catch (Exception)
{
return false;
}
return true;
}
else
{
return false;
}
}
I need to get the value in bold, but it's empty - I guess it's because the handler fires "too early". Is there something I can do...like using an action that fires after publish? Or any other way I can get this value.
/Mikkel
Okay...Im just blind
I changed:
return new umbraco.interfaces.IAction[] { new umbraco.BusinessLogic.Actions.ActionNew()};
To:
return new umbraco.interfaces.IAction[] { new umbraco.BusinessLogic.Actions.ActionPublish()};
is working on a reply...