Skip to main content

(Using Smartobject created from a SharePoint List)

New Item Form

Hi, I am totally new to K2 and was quite pleased with myself for creating a 'New Item Form' that has 40 columns originally which I have split into 8 tabbed views.  I've even added a fancy auto calculation to show the progress dynamically on the form.. the 'save' buttons do post succesfully back to the SP List ... All Good I thought :-)


Edit Form
I made a copy of all of the views I had created for the new form (9 in total) and then made a copy of the OOTB K2 Edit Form and was hoping to just import the copied views and change the action on the 'Save Buttons to an 'update list item method' as opposed to a 'create list item method'.


However, my new edit form and views does not retrieve the data from the sp list item (when accessed directly from the SP List itself)


I looked at the rules from the OOTB original edit form and tried to emulate it on the copied form/views but I just get errors saying the columns i am trying to populate on initlize arent attached to a smart object.

I have spent 2 days now looking at tutorials and googling, but all the form creation articles are on creating a new entry form and not an edit form... totally baffled and frustrated now :-(    I don't understand the logic well enough yet to work this out for myself :-(

Can anyone tell me how I get a form to retrieve the ID of the item at the point of the form opening?

 

Thanks, Julie :-)

Thanks!

 

 

 

 

Hello @JulieBird,


 


Check to make sure the views that were not auto-generated contain "Parameters" which are used to pull data. Make sure ID and Serial No are added to those values, so data can be populated as well as be used in workflow. If it contains those, make sure there is a "SmartObject" that has a "Get List" rule to load the data, this should go under the "When the Form is Initializing" rule.


Thanks Michael and Sello, it worked!!

 

Incase anyone else asks the same, heres what I did, I also found the part in the tutorial that Sello mentioned and have screenshot it for reference:

 

1) In the edit view I had on the Form I created 2 blank parameters called ID and Serial No

2) I added the action 'Execute a method on a view' then added another action underneath that called 'Get List Item by ID' (its just called Get List in versions before K2 5)

3) In the configure screen under Input Mappings I added the blank parameter field to the 'Smart Object input mapping column called 'ID 

 

In the example attached, it actually maps the ID parameter to a column called 'Expense Claim ID', I think this is because the example is showing how to load a child item on a sub view, but mine is just a simple edit form with no subvies so I used the ID column.

 

Hope this helps someone else :-)



Reply