Bizform custom post method

Conor Dunk asked on September 28, 2016 15:46

Hi,

When a user submits a bizform I need to call a custom method, is this possible within Kentico 9?

Thank you, Conor

Recent Answers


Matthew Sandstrom answered on September 28, 2016 16:02 (last edited on September 28, 2016 16:04)

Yes, you can register a global event handler for bizform insert and call your method there.

Here's the idea: https://docs.kentico.com/display/K9/Handling+global+events And here are the events themselves: https://docs.kentico.com/display/K9/Reference+-+Global+system+events#Reference-Globalsystemevents-BizFormItemEvents

1 votesVote for this answer Mark as a Correct answer

Jake Kula answered on October 7, 2016 02:12

Hi, you can also clone the Biz Form web part and define before-save and/or after-save methods to handle this. Then, in your cloned web part .ascx control:

In .ascx front-end code:

<cms:BizForm ID="viewBiz" runat="server" OnOnBeforeSave="viewBiz_OnBeforeSave" OnOnAfterSave="viewBiz_OnAfterSave" IsLiveSite="true" />

In .ascx.cs code-behind:

private void viewBiz_OnBeforeSave(object sender, EventArgs e)
{
    //Do something
}

private void viewBiz_OnAfterSave(object sender, EventArgs e)
{
    //Do something
}
0 votesVote for this answer Mark as a Correct answer

Delford Chaffin answered on June 29, 2018 16:58

@Matthew Sandstrom - How do I assign a global event to BizForm events? I get for documents, I have:

DocumentEvents.Insert.After += Document_Insert_After;

... but what do I use for BizForm events?

Thanks!

0 votesVote for this answer Mark as a Correct answer

Matthew Sandstrom answered on June 29, 2018 17:52 (last edited on June 29, 2018 17:53)

@Delford Chaffin - you can use BizFormItemEvents.[event].[event type]

0 votesVote for this answer Mark as a Correct answer

Delford Chaffin answered on June 29, 2018 17:56 (last edited on June 29, 2018 20:02)

@Matthew Sandstrom - I realize the original question was for Kentico 9 and I should have clarified, this is still a Kentico 7 site I'm working on. BizFormItemEvents doesn't seem to exist in 7? Do you know of anything similar that does?

Thanks!

EDIT: I found what I needed here if anyone else is looking ... https://devnet.kentico.com/questions/bizform

0 votesVote for this answer Mark as a Correct answer

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