This Forum is ARCHIVE only
For LightSwitch questions,
please use the official forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Pre Fill Date on AddEdit New Screen
Last Post 26 Jul 2013 03:27 AM by rogrey. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
RogReyUser is Offline
New Member
New Member
Send Private Message
Posts:2
Avatar

--
25 Jul 2013 12:02 PM
    Hi All,

    I am a noob so bare with my. I see many post that dance around my issue, or maybe I am not understanding.

    I have a application where the user selects their Zone, Site and Facility information.  From the selection screen I am passing the parameters to a new log screen. The new log screen is bound to the Log table and has the queries for the Zone, site and facility. What I am trying to do is prefill the new log with data from the selected item in the relative query.

    Some example code is below

    myapp.NewBioLogAddEdit.created = function (screen) {

    // set date.

    screen.tblBioLog.DateofApplication = new Date();

    // try to set log site ID to the result from the tblSite query 
    screen.tblBioLog.SiteID = this.tblSites.SelectedItem.ID;

    };

    I believe I am approaching it wrong but I don't know where to go from here.

    RogReyUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:2
    Avatar

    --
    26 Jul 2013 03:27 AM
    I am updating this post. Forgive me, the title was off, the description probable not clear enough. I believe its a simple fix. It was straightforward in the SilverLight C# client but I am lost in the HMTL client.

    I passed a parameter to the screen to filter the tblSites and tblZone to a unique record. I want to copy that information to the new log table . For technical reasons the Sites and Zone tables are not related to the log table (no one to many , or one to one)

    Here is a snippet of my C# code:

    public partial class CreateNewtblBioLog
        {
            partial void CreateNewtblBioLog_InitializeDataWorkspace(List saveChangesTo)
            {
                // Seting Default Values.
                this.tblBioLogProperty = new tblBioLog();
                tblBioLogProperty.SiteID = tblSite.ID;
                tblBioLogProperty.SiteName = tblSite.SiteName;
                tblBioLogProperty.SiteManager = tblSite.SiteManager;
                tblBioLogProperty.ZoneID = tblZone.ID;
                tblBioLogProperty.ZoneName = tblZone.ZoneName;
                tblBioLogProperty.ZoneSoilPH = tblZone.ZoneSoilPH;

    How can i do the same this the HMTL client. 
    You are not authorized to post a reply.


    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation