Skip to main content

Hi everyone,

 

I am still struggeling with SmartForms for some time now. My use case is pretty simple but it seems to be difficult with SmartForms: I am developing an account management solution. It is already working for single users but the requirements for version two give me some headaches. Now it's not a 1:1 relationship - 1 request equals 1 user to be added or removed from a group - but the user should be able to select a set of individual user and once he has added all users he should choose the function (add/remove all of the selected users to AD group XYZ) and click on submit.

 

I figured out that in SmartForms I need to populate a list on the form with the users that one selects using a picker. But I don't want to save the selected users directly in a SmartObject because the user might just close the form and this would result in orphaned users in my SmartObject. So how can I populate a control on a form just to temporarily store the selected user accounts information and in case the user clicks on submit pass the information to an approval workflow. All the rule examples I found directly save the information in the database which is definitely not what I need.

 

I would be very glad to see some rule / code examples. It's getting urgent now and I need this functionality in most of my future developments so I try to standardize this a bit for my team.

 


Many thanks!

Joachim

 

Hi Joachim,


 


I will try and find out a bit more about this.


 But just to clarify you only want to save users that submit to the DB the rest must be saved in a temp location (Not in the DB)?


Also the users are they from the (AD, already Exist somewhere) or do they need to be manually enter to be created when they submit?


 


Regards


Quintin


Hi Dodge76


 


I suggest that you edit the "Submit" buttons rules. By default the save button would save the data entered into a form or view to the smartobject, this save location can be changed to anywhere depending on how you state it in your rules. When editing the rule of the submit button remove the default save option "when control(save/submit) is executed(Clicked/intialized)" and add your own rule that would save the data of a form or view to a subform or subview instead of saveing the data to SmartObject.


Hi Raymond,

 

yes, almost correct. I have the picker and I search for an employee there. When the picker resolves, it loads another item view displaying data like employeeID and stuff of the selected user. On this item view I have a button 'Add'. When I click on this button I want another control (currently an editable list) on the form being populated with the selected employee. The user can do this multiple time to create a list of users. Once he is done with his list he has to choose the action (add or remove user from group) from another view and once he has fully completed then click on 'Submit' at the very bottom of that form. This is the moment when I want to update a SQL request table / SmartObject with the selected users and the selected function because then an approval workflow is  started. In that request table I need to add a single line per selected employee from that editable list. In need to have some sort of dynamic loop because I never know how many users are selected.

 

I attached a screenshot. Hopefully this helps to understand what I am trying to do.

1. Search for user

2. Add user to temporary editable list (Add button)

3. Choose function (currently hidden on the fom)

4. Click submit to save a record per selected employee in another table on SQL Server

 

Many thanks!

Joachim

 

 

 


16083i29FCBAFFAAA4D413.png

Hi,


 


You could just have a normal editable list view - which would allow for search functionality and adding/deleting/editing of records. You could then search for records and modify the record accordingly.


 


Regards.


Unfortunately it doesn't seem to be that easy. I am now able to populate the list. The issue in this case is, that an editable list is linked to a SmartObject and it is not the SmartObject where the data should be stored in the end.

 

In the screenshot below you see that I added two records to this editable list using the 3 rules 'add a new row to the editable list' 'transferring data' from the (in this screenshot hidden) item view to the list and 'apply the changes to the editable list'

 

15406iE5F16834D4DD4396.png

 

The next step for the user is to select the functionality what he wants to do with these users: add to group or remove from group, the Active Directory group itself and an effective date when this should happen. Once this is done I need to create a record for every selected employee in another SmartObject. This is where I am blocked.

 

I would need to have to create some sort of a loop on form level (when a button is clicked) so I can transfer data for every record from the list above, add some information from other views in each record and then save the complete data in another SmartObject.

 

How do I do that?

 

Many thanks!

Joachim

 

 

 

 

 

 


Hi Dodge76


 


Have you logged a ticket for this before?


 


As this seems like a very details and long process, I would suggest that you log a ticket for K2 to investigate if you have not done that already.  In the meanwhile we will still try to help with suggestions on this.


 Hi Dodge76

Just doing a quick follow up in regards to my previous post asking that you please log a ticket for this issue also please advise if there is any additional information you acuired that could be of help in the conversation related to this issue?


Hi Dodge76

We have not recieved any feedback on this post converstation, please confirm if the issue is solved and can be marked as as such or do you require further assistance?


Hi Dodge76


 


I am kindly marking this post as solution due to no response and no solution being marked.


Reply