Answered by:
Add Values to a Table using Javascript in the Lightswitch HTML Client

Question
-
Hi Guys,
i Need to execute a Stored Procedure from a Lightswitch HTML Applikation.
I don´t know much about Ria Services, so i used the other way and created a Table which acts like a queue containing the Parameters of my Stored Procedure. On the Inserting Trigger i call my Stored Procedure. This works fine.
But how can i implement it in my AddEdit Screen? I have a Screen with two Values. Personalnr. and credit.
Now i would like to have a Button and when the Button is pressed the Personalnr. and credit are written into my dummy table which will execute my Stored Procedure.
When i click on "Edit Execute Code" from the Button this appear:
myapp.Anteile_anzeigen.QuellensteuerSchreiben_execute = function (screen) { };
Now i have to code it in Javascript, but i don´t know how...
The Table is under DataSources / ApplicationData and named InsertQuellensteuerOperation
Thanks a lot for your help,
Ruediger
Wednesday, April 16, 2014 2:25 PM
Answers
-
See:
Dynamically Creating Records In The LightSwitch HTML Client
myapp.BrowseCustomers.AddDynamicCustomer_execute = function (screen) { // Add a new Customer var newCustomer = new myapp.Customer(); // Set the Status newCustomer.CustomerName = "New"; // Set the Age newCustomer.CustomerAge = 0; };
Unleash the Power - Get the LightSwitch HTML Client book
http://LightSwitchHelpWebsite.com
- Edited by ADefwebserver Wednesday, April 16, 2014 4:47 PM
- Proposed as answer by ADefwebserver Saturday, April 19, 2014 12:40 PM
- Marked as answer by Angie Xu Thursday, April 24, 2014 1:13 AM
Wednesday, April 16, 2014 4:46 PM
All replies
-
See:
Dynamically Creating Records In The LightSwitch HTML Client
myapp.BrowseCustomers.AddDynamicCustomer_execute = function (screen) { // Add a new Customer var newCustomer = new myapp.Customer(); // Set the Status newCustomer.CustomerName = "New"; // Set the Age newCustomer.CustomerAge = 0; };
Unleash the Power - Get the LightSwitch HTML Client book
http://LightSwitchHelpWebsite.com
- Edited by ADefwebserver Wednesday, April 16, 2014 4:47 PM
- Proposed as answer by ADefwebserver Saturday, April 19, 2014 12:40 PM
- Marked as answer by Angie Xu Thursday, April 24, 2014 1:13 AM
Wednesday, April 16, 2014 4:46 PM -
Hi Michael,
It´s me Ruediger, i cant paste Images with the other Account.thanks your answer, but that doesn´t work. It still works for my "normal" Datasource which was created when i started the Project. But with the manually added Table it doesn´t work.
If i make var test = new myapp.myentity();
and then the Parameters from the myentity are doen´t shown. Hope you understand what i mean...
i paste two screenshot then it is easier to understand.
Sorry for the bad english!
Thank a lot again!! Ruediger
Thursday, April 17, 2014 10:12 PM -
Your screen shots did not come through.
Thursday, April 17, 2014 10:46 PM -
Greetings, Ruediger
Friday, April 18, 2014 8:07 AM -
I did a test and when I connected to an external data source the coding pattern worked.
The only thing I can suggest is to put in the code, even though you will get the intellesense errors and see if it works.
Friday, April 18, 2014 11:51 AM -
Hi Michael,
yes i ignored the IntelliSense error and it worked. Thanks a lot and have great Easter - Days, Ruediger
Saturday, April 19, 2014 6:15 AM