for exam : like to add a handlers for document event ( after publish , before save , etc.. )
that what i want to do :
1) I want tocancel the operationifsome conditionoccurs.
2) I wnat to update some hidden fields before they save in entires. that should be some data that i want the user( web site admin) see in theform entries , but the user how fill the form not see this fields.
i can change this values via JS , but i preffer to change them programatically when submit or when the form is loaded...
(if form set to auto approved this event activated every time the form is sending )
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Umbraco.Forms.Core; using Umbraco.Forms.Core.Services; using umbraco.cms.businesslogic.web; using umbraco.BusinessLogic;
namespace customEvents { public class formsEvent : umbraco.BusinessLogic.ApplicationBase { public formsEvent() { RecordService.RecordApproved +=new EventHandler<RecordEventArgs>(RecordService_RecordApproved); }
add workflow event programatically
helllo everyone.
it is possible to add event programatically?
for exam : like to add a handlers for document event ( after publish , before save , etc.. )
that what i want to do :
1) I want to cancel the operation if some condition occurs.
2) I wnat to update some hidden fields before they save in entires. that should be some data that i want the user( web site admin) see in theform entries , but the user how fill the form not see this fields.
i can change this values via JS , but i preffer to change them programatically when submit or when the form is loaded...
thanks in advance. cheers
here is example for record approved event..
(if form set to auto approved this event activated every time the form is sending )
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Umbraco.Forms.Core;
using Umbraco.Forms.Core.Services;
using umbraco.cms.businesslogic.web;
using umbraco.BusinessLogic;
namespace customEvents
{
public class formsEvent : umbraco.BusinessLogic.ApplicationBase
{
public formsEvent()
{
RecordService.RecordApproved +=new EventHandler<RecordEventArgs>(RecordService_RecordApproved);
}
void RecordService_RecordApproved(object sender, RecordEventArgs e)
{
RecordService rs = (RecordService)sender;
//// check something
// if (true) - delete Record
// { rs.Delete(); }
}
}
}
is working on a reply...