Forums

Forums / Developing Portals / Get SubEntites on ITpcPreMvcFormSubmitEvent

Get SubEntites on ITpcPreMvcFormSubmitEvent

3 posts, 0 answered
  1. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    18 Jul 2023
    Link to this post
    Hello, dear TPC team,

    Could you please tell me is there a way to get field values from SubEntites on the ITpcPreMvcFormSubmitEvent?

    For example I have an entity on the form and inside it there's a connected entity TPC layout with some fields. I tried to use @event.FieldValue<string?>("vlbsi_termsandconditionsacceptedby") but it gave me an error. 
  2. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    19 Jul 2023
    Link to this post
    Hi Dmitriy,

    Thank you for your question.

    Kindly see the documentation with regards to TPC Form Submission Events

    https://www.crmportalconnector.com/developer-network/documentation/developing-for-tpc/portal-form-submission-events

    You can look in the submission entity in the event object. 

    Entity submissionEntity = @event.SubmissionEntity;

    SubmissionEntity.Attributes is where the submitted fields are located.

    Regards,
    Rawdon
  3. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    20 Jul 2023 in reply to Rawdon Edghill
    Link to this post
    Hello Rawdon,

    Unfortunately it's not the answer for my case.

    The correct code is:

    foreach (string field in SystemManager.CurrentHttpContext.Request.Form)
    {
    VlbsiTracingHelper.Trace(field);
    VlbsiTracingHelper.Trace(SystemManager.CurrentHttpContext.Request.Form.GetValues(field).FirstOrDefault());
    }
3 posts, 0 answered