locked
Insert values from one screen to another screen RRS feed

  • Question

  • Hi, 

    I am developing a livery(taxi) service applicaiton

    I have a customer screen that I am passing address to an appointment screen. In the appointment screen I need to be able to select an address from a table and insert into the appointment screen to complete the order. I would like to setup a modlar windows to select the addresses from and have a button to insert the address into the currently open appointment screen. Is this possible? I am 3 days young at lightswitch, so any visual aids would help. Thanks to everyone in the community!

    Wednesday, March 27, 2013 7:37 PM

Answers

  • I would like to setup a modlar windows to select the addresses from and have a button to insert the address into the currently open appointment screen.

    Page 306 covers the AutoCompleteBox (ACB).   You have a choice to use either an ACB or a ModalWindowPicker (MWP) to select addresses.

    You can constrain addresses on the Collection used for the ACB or MWP based on information on the Screen.

    When the value is selected, you can then set any additional values with event code.

    LS will allow you to show more than one field on the pop-up selection rows.

    If you like, we can screen share.   However, I'm in Hawaii which is GMT -10.   My email is garthh at vanguardok.com

    It would be helpful if you shared a screenshot of your screen.


    Garth Henderson - Vanguard Business Technology

    • Marked as answer by zack142 Thursday, March 28, 2013 5:45 AM
    Wednesday, March 27, 2013 11:50 PM

All replies

  • hehe . . . simple, use the database.   Save what you need in the database.

    There is one significant shortcomming of LS Screens:  A detail screen that is used as a target link cannot contain any parms.

    Point:  We should be able to pass as many parms as we'd like between screens, however, doing this means that we can't use the screen as a target link.

    As Zack, brings up, a Screen SHOULD have the ability to have non-required parms and still be used as the target link.

    Note to Zack:   You can create Screens with additional parms and pass data that way - but the Screen with parms will not be able to be used as a target link.


    Garth Henderson - Vanguard Business Technology

    Wednesday, March 27, 2013 8:18 PM
  • I don't really have to have a modlar window to do this.

    Let me ask, If I have am address table already, is there a way to use autocomplete on the other addresses that I need filled in? One set of addresses are coming from the customer record, the other ones from the address table. Any suggestions? 

    Just need to fill full address, city, state and zip into appointment screen and save the record.

    Wednesday, March 27, 2013 8:24 PM
  • I don't really have to have a modlar window to do this.

    Let me ask, If I have am address table already, is there a way to use autocomplete on the other addresses that I need filled in? One set of addresses are coming from the customer record, the other ones from the address table. Any suggestions? 

    Just need to fill full address, city, state and zip into appointment screen and save the record.

    I wasn't thinking that you needed to use a Modal Window - my suggestion was based on you wanted to pass information to a separate Screen.

    You can use Table Code to do anything you want.

    I recommend this book to learn LS:

    Pro Visual Studio LightSwitch 2011 Development


    Garth Henderson - Vanguard Business Technology


    Wednesday, March 27, 2013 9:05 PM
  • Thanks for the reply, I have downloaded the ebook, but I still need something to resolve my issue now, any other suggestions from anyone?

    Wednesday, March 27, 2013 10:52 PM
  • So here is what I have done so far and I am trying to figure out how to accomplish this as a work around.

    I added this to my appointment table

     Private Sub Customer_Changed()
                If (Customer IsNot Nothing) Then
                    If (TakePickupStreet <> Customer.Street) Then
                        With Customer
                            TakePickupStreet = .Street
                            TakePickupStreetLine2 = .StreetLine2
                            TakePickupCity = .City
                            TakePickupState = .State
                            TakePickupPostalCode = .PostalCode
                            ReturnDropStreet = .Street
                            ReturnDropStreet2 = .StreetLine2
                            ReturnDropCity = .City
                            ReturnDropState = .State
                        End With
                    End If
                End If
            End Sub

    Couldn't I use something similar to this for my passing address to the same screen?

    Wednesday, March 27, 2013 11:06 PM
  • I would like to setup a modlar windows to select the addresses from and have a button to insert the address into the currently open appointment screen.

    Page 306 covers the AutoCompleteBox (ACB).   You have a choice to use either an ACB or a ModalWindowPicker (MWP) to select addresses.

    You can constrain addresses on the Collection used for the ACB or MWP based on information on the Screen.

    When the value is selected, you can then set any additional values with event code.

    LS will allow you to show more than one field on the pop-up selection rows.

    If you like, we can screen share.   However, I'm in Hawaii which is GMT -10.   My email is garthh at vanguardok.com

    It would be helpful if you shared a screenshot of your screen.


    Garth Henderson - Vanguard Business Technology

    • Marked as answer by zack142 Thursday, March 28, 2013 5:45 AM
    Wednesday, March 27, 2013 11:50 PM
  • I will look into the book, I solved the issue with a work around of having the addresses all reside in one entity rather than one on the customer record and in my address entity. I then use a ACB on the customer screen for pickuplocation and droplocation and passed both addresses to fill in the four addresses on my appointment screen. Its the best I could do with what I have learned so far. Thanks!! I may take you up on that screen share if I get stuck.
    Thursday, March 28, 2013 5:49 AM
  • The beginning of each application is business requirements.   Then database design.  Then screen design.  LS supports the functionality to support a correct database design. 

    Each ride has a pickup and a drop off address location.   If your taxi service is based on repeat business, then each customer would keep a list of past addresses to reuse in the future from a drop down list.

    If your customers needed to schedule a round trip, then there would be 4 addresses on 2 rides.

    It may be good to also have a preferred list of drivers for a particular customer.

    I'm not sure what your business definition is of an appointment versus a ride.  An "order" would be when someone calls to schedule a series of rides.

    If this was a limo service, then there may be many other possible services and amenities. 

    The data model could quickly grow to 100 tables with accounting.

    Here's a Red-Gate Dependency Project for one of my databases that is used in 3 of our LS apps.   The blue area in the Diagram Overview is the selection of the total database model.

    If the requirements are not correct then the database won't be correct.  If the database isn't correct then the project will be a big mess.

    Getting correct requirements is the toughest part of biz app development.  2nd is building a correct database from the requirements.  Programming is the easiest part.  90%+ of projects don't start with the correct requirements.  It is generally impossible to get clients to agree to spend the necessary time to get business requirements.   Most business owners/managers tell me that they will know the right software when they see it and my job as a custom software developer is to build the right software and then show it to them - without any requirements.

    You can create a pop-up Modal Window for the selection and entry of addresses that functions as a "sub" screen.

    Modal Windows have the same access to all Screen Collections and properties so there isn't any need to "pass" values.   See pages 239 and 292.

    I recommend that you take a few hours to read through Parts 1-3 of the LS Pro book (470 pages) - as it will make your LS development project an enjoyable journey.

    I also recommend using Yann's Luminous Controls extension.


    Garth Henderson - Vanguard Business Technology





    Thursday, March 28, 2013 6:18 PM
  • Thanks for the plugs Garth.

    You'll need to insert your image again. The current image path doesn't work for some reason, & I couldn't fix it.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Sunday, March 31, 2013 6:50 AM
    Moderator
  • Thanks, Yann.   I reposted the image.  


    Garth Henderson - Vanguard Business Technology

    Tuesday, April 2, 2013 11:02 PM
  • Cool. Thanks.

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Wednesday, April 3, 2013 1:25 AM
    Moderator