Lightswitch HTML Client - How do you pass a value from one screen to another?

Posted on 2014-09-01
Last Modified: 2014-09-04
My question in particular is based upon a view screen, where I have a unique ID and I want to pass this to an Add/Edit screen. So rather than the user having to type this out every time, they can simply just click on the details picker plus symbol and selected the value(s) associated with that.

So for example I have a CustomerID which is 1, and they have made an order (OrderID 100). On this Order I want to add an item they have purchased and display it onto the OrdersViewScreen. Within Lightswitch I have an AddDeliveryLine button which takes me to this particular Add screen. I have set up a query based on the CustomerTable, which asks the user to search by their CustomerID… When I type in 1 myself it will load up the items the customer is awaiting within the CustomerOrders details picker.


The values need passing within JavaScript however the following methods ive tried have not worked:

myapp.AddEditDeliveryLine.CustomerID_postRender = function (element, contentItem) {

    contentItem.screen.CustomerID =

myapp.ViewDeliveryNote.ShowAddEditDeliveryLine_canExecute = function (screen) {
    return screen.CustomerID;
myapp.ViewDeliveryNote.ShowAddEditDeliveryLine _execute = function (screen) {
    return myapp.showAddEditDeliveryLine(screen.CustomerID);

I’ve added a print screen of what I am trying to accomplish. Thanks for any help.
Question by:wint100
    1 Comment
    LVL 77

    Accepted Solution

    Many different ways one of the best ways is by using the example shown @

    In your List Detail, you need to create a Data Item to store the User Name. In the Properties for that Data Item, you then need to check "Is Parameter".
    When you call your second screen from the code in your SearchUserInformationLists screen, you pass the value of that Data Item to it.


    The screen Parameters should be the first items in your list of Data Items on the left of the Screen Designer. You can pass more than one parameter and the order that you pass them in is the order in which they are listed in your Data Item list.

    this.Application.ShowZeiterfassungsListDetail(this.Param1, this.Param2, this.Param3);

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now