get a value from field A to B with javascript RRS feed

  • Question

  • hello

    how do i get the value of a Screen, filed A and pass it into field B, with JavaScriptin HTML5 LightSwitch 2015?


    myapp.BrowsePLZ_GPS_CH1Kt.mwToDo_execute = function (entity, screen) {

        //Part1 get the value of the selected field A???


       //Part2 insert the value in the Parameter field B

      entity.B = ???value of Part1???


    thanks for your help


    Friday, June 10, 2016 9:16 AM


All replies

  • One method (there are others):

    myapp.BrowseCustomers.AddAndViewCustomer_execute = function (screen) {
        myapp.showAddEditCustomer(null, {
            beforeShown: function (addEditScreen) {
                // Create new Customer here so that
                // discard will work.
                var newCustomer = new myapp.Customer();
                addEditScreen.Customer = newCustomer;
            afterClosed: function (addEditScreen, navigationAction) {
                // If the user commits the change,
                // show the new Customer in View Screen.
                if (navigationAction === msls.NavigateBackAction.commit) {
                    var newCustomer = addEditScreen.Customer;

    Visual Studio LightSwitch Screen Navigation and Advanced JavaScript Examples




    Unleash the Power - Get the LightSwitch HTML Client / SharePoint book

    Friday, June 10, 2016 3:48 PM
  • hello, many thanks for your help.

    but it's not working yet. maybe i explained wrong. and is there an easyer way for a non JS guru ;-)

    the two fields are on the same Screen, and from a list the selected value shoud be pasted into field B which is a Parameter field. is there a easy Workaround like in VB (me.A = me.B)

    hanks, marcel

    Saturday, June 11, 2016 4:20 PM
  • hi,

    i just got it by try and error ... this is what works now. if you have a better or more prof. way, please let me know.

    myapp.BrowsePLZ_GPS_CH1Kt.mwPar_execute = function (screen) {
        // Write code here.
        screen.Parameter = screen.Kantone.selectedItem.Kt;

    thanks, marcel

    Saturday, June 11, 2016 4:40 PM