Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aljosa Cakic 3 posts 23 karma points
    Jan 28, 2014 @ 11:29
    Aljosa Cakic
    0

    Get FormId inside the FieldType's razor view

    Is it possible to get FormId inside the FieldType's razor view?

    In the version for web forms I used FieldType.AssociatedField.Form, but I can't find

    something similar in the razor script model class - Umbraco.Forms.Mvc.Models.FieldViewModel.

    I need FormId to get form's records in Razor using method

    Umbraco.Forms.Mvc.DynamicObjects.Library.GetRecordsFromForm(string formId)

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 28, 2014 @ 12:15
    Fuji Kusaka
    0

    Hi Alijosa,

    Have you try this.

     

     

  • Aljosa Cakic 3 posts 23 karma points
    Jan 28, 2014 @ 12:34
    Aljosa Cakic
    0

    Hi Fuji,

    methods in the Umbraco.Forms.Mvc.DynamicObjects.Library receive paramethers pageId or formId,

    so  in the Razor script of my custom FieldType I need to get them before passing to these methods.

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 28, 2014 @ 12:59
    Fuji Kusaka
    0

    HI Alijosa,

    You want to get the pageId or formId in one of your fieldType ?

    [#pageId] in Default Value.

    By formId do you mean the number of times the form as been submitted or Guid?

    I did something quite similar making use of db instead. But somehow the formId will only be visible when a mail is being submitted on notification to Admin or anyone assigned to in the workflow.

     

  • Aljosa Cakic 3 posts 23 karma points
    Jan 28, 2014 @ 13:24
    Aljosa Cakic
    0

    Hi Fuji,

    exactly I need formId in razor script of my custom FieldType.

    FormId is big fat guid, the one from the settings tab on Contour form's page.

    I found temporary solution by creating custom setting FormId in my custom FieldType, but I beleive that exists a more elegant solution.

    WorkflowType class is something different, the Record class can be accessed there.

Please Sign in or register to post replies

Write your reply to:

Draft