How To: Interact with a SQL View in an Editable List View fashion


Userlevel 5
Badge +18

15734iEF046824330DDCF4.png


Lets say you have SQL View that join multiple tables


 


14068i5D0A27D24DD13AD1.png


If you generate a SmartObject from this view, it will only have a “List” method


 


12610iA149A09321B6EC22.png


So if you try to generate a view, only the List View is available as the CRUD (Create, Read, Update, Delete) methods do not exist.  But what if you want to interact with the information in this view, allowing users to edit/update columns?


 


15139i18F65B71CCF32D04.png


This can be done by creating your own stored procedures that would (Create, Read, Update, Delete) with the columns in this View; of course, through interacting with the actual tables with the necessary joins, etc.


 


14997i9F2EDDA904BC56B7.png


Lets say you want to update the columns that had been NULL


 


14608i7E0A2EB89C90BC78.png


A stored proc to update can be created (no joins for simplicity)


 


17077i8584D3C57198F1D3.png


Refresh SQL service instance to expose this object


 


14600i53A5768AFB92BF65.png


Add this method to the View Smartobject


 


16066iBD281A3576B2FB6F.png


Change the Type to Update, or to whichever Type that matches the stored proc’s function


 


13252iB0CB6D54196353DF.png


Map the properties accordingly


 


12682iC5B208676E4FF015.png


Now when generate a view, the Editable List View is available


 


11102i0D8E1D58D1CE6979.png


The Save/Update functionality of an Editable List View is now available; the same can be achieve to Create, Read, Delete


0 replies

Be the first to reply!

Reply