Genpact Cora Knowledge Center

Support

Submit a Form

Use the API to submit a form.

using PNMsoft.Sequence.Data;
using PNMsoft.Sequence.Forms.Activities;
using PNMsoft.Sequence.Linq;
 
 
namespace SequenceEx.Form.Samples
{
    public class SubmitFormExample    {
        void SubmitData(int activityInstanceId, string queryName)
        {
            FormActivityExecutor executor = FormActivityExecutor.GetExecutor(activityInstanceId);
 
            using (DataContext ctx = executor.CreateDataContext())
            {
                IDataTable tbl = ctx.GetDataTable(queryName);
 
                IDataRow row = tbl.CreateRow();
                row.SetField("Field1", "Field1 Value");
                row.SetField("NumericField", 35);
                tbl.InsertOnSubmit(row);
 
 
                ctx.SubmitChanges();
            }
        }
 
      
    }
}