Skip to main content

Search

Save and make a Copy as New

Comments

5 comments

  • Christof

    You mean some kind of a new Action to open a prefilled NewForm with values of current form (or saved item values), sounds plausible.

    Current workarounds for similar logics are:

    • Use a Script action on the save button writing the values into a window variable, open the NewForm with logic reading out that window variable values and set into the inputs -> quite technical
    • An "Add list item" Action on the save button with a following "Open form" Action which immediately opens the EditForm of the new created item -> easy to configure, but new item will exist with the initial values even if user decides to cancel the form (and changed values creates a new version on the new item)

    Since both workarounds have it's downsides, a possibility to prefill a NewForm somehow sounds much appreciated.

    1
  • Joerg_K.

    Christof many thanks! Although it sounds technical, I think the first option is the better one. Is there a page and tutorial on how to store to and read from windows variables?

     

    0
  • Christof

    Not a full tutorial, but in the community portal there are snippets like this one: Window Variables ...which describes how to set a window variable and get the value(s) later.

    In your scenario SET it in an "Execute script" action on the save button by e.g. window.yourFieldOneValue = [[YourFieldOneName]]
    And GET it on the Initial configuration of the input field on the opened NewForm =window.yourFieldOneValue

    0
  • Joerg_K.

    Christof, perfect, I will look into it. Meanwhile, I tried an approach where I used 

    [[@Web.GetValuesForQuery('Teilnehmer Intern', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="ID" /><Value Type="Number" ProviderType="Expression">[[@Actions.Save_form.ItemID]]</Value></Eq></Where></Query><RowLimit>1</RowLimit></View>', 'Firma')]]

    Just to try if I can get values via @Web ... however, I do get an error on [[@Actions.Save_form.ItemID]]

    Failed to evaluate property "Firma" in "Add list item": Error occurred on evaluating expression "[[@Web.GetValuesForQuery('Teilnehmer Intern', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="ID" /><Value Type="Number" ProviderType="Expression">[[@Actions.Save_form.ItemID]]</Value></Eq></Where></Query><RowLimit>1</RowLimit></View>', 'Firma')]]". Action "Save_form" has not been executed yet.

    Although, I have the Save From action just prior to my Add list item action.

     

    0
  • Joerg_K.

    Could it be, that the problem lies within the fact, that what I try to do is, that I am using this within a SubList while the parent is open and in edit mode? I already ensured that the parent once got saved, so it is existing with a list ID. However, while the parent is open in edit mode the elements at the SubList are not saved until I save all modifications by saving the parent!?

    0

Please sign in to leave a comment.