Skip to main content

Hi there,


 


I'm currently working on a K2 Smartform project that involves what I imagine to be associative SmartObjects. I've seen a few examples and demo's performing exactly what I wish to do so I'm pretty sure it's possible.


 


Consider the following scenario:


 


I have 2 SmartObjects with the following properties:


 


Order:



  1. ID                      Auto Number
  2. Description       Text
  3. Requester          Text
  4. Products ID       Multivalue

Product:



  1. ID                      Auto Number
  2. Name                Text
  3. Description       Text
  4. Price                  Decimal

I've configured an association on the Product SmartObject ID with the Products ID


 


I have an Order form allowing the user to capture the order descirption, requester and associated products. Assume that none of the products have been precaptured - meaning every order will have its own set of unique products.


 


It is on the associated products that I'm having a problem. I can't seem to figure out how I would create this order with a list of products.


 


I'd imagine there should be a way when executing the Order Create method to write all of the included Product IDs to the multivalue Product ID column.


 


Furthermore, I'd probably only want to only create those Products to the Product SmartObject when the Order Create Method is executed.


 


Any help on this would be greatly appreciated.


Thanks in advance,


Sean


 

Hi Sean,


 


I think it should be posible,


I will see if i can create the senario to test if it is posible or not.


 


Regards


Quintin


 


 


Hi Sheinen


 


I suggest that you give this scenariosa try:


 


1. Creat smartobject (SMO_1) - containing all products


2. Create smartobject (SMO_2) - to save records


3. Create view - your main view


4. Create list view -  subview for the main view


5. Connect smartobject (SMO_1) to the subview


6. Connect smartobject (SMO_2) to main view


7. Insert a rule on the main view


    "when the view executed initialize"


    "then open a Subview"


8. On the subview you add a rule transfer data to the main view into the multi value column


9. Click save.


10. The initial idea here is that you have a main view where you will have an ID and multi value column this view is connected to a


       smartobject to which you will be saving your records. 


       In the main view a rule will execute on initialize or a button click which will call the subview that is containing all the products, you


       will then select all related products and click a button to upload the selections to the main view where you can then click save to


       save the record.


 


 


Hi Sheinen


 


Please confirm if my last post was able to help in regards with creating this order with a list of products ?


 


Thank You in advance.


Reply