Custom Form Submission Record ID

Dan G asked on May 12, 2015 01:20

Is there a way to get the record ID of the custom form that was just submitted? I know you can get the submitted field data by using the following code, but what I need to get is the ID of the record that was just added to the database.

private void viewBiz_OnAfterSave(object sender, EventArgs e)
    string Field = viewBiz.GetFieldValue("Field").ToString();

Correct Answer

Brenden Kehren answered on May 12, 2015 02:18

If you have the actual BizFormInfo object you can use this to get the PK column name dynamically:

string idColumn = formInfo.Generalized.IDColumn;

If not, then I believe you can simply use:

int insertedID = viewBiz.ItemID;
2 votesVote for this answer Unmark Correct answer

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