locked
LightSwitch Getting Single Field Value from DataWorkSpace RRS feed

  • Question

  • Hi

    Writing my first Lightswitch HTML Client.

    On Screen Created I want to set  screen.displayName from the value in CompanyConfig table   I've tried using the following

     myapp.dataWorkspace
           
    .ApplicationData.CompanyConfig
          
            .top(1)
           
            .execute(function succeed(result) {
               
    var Comp= result.results;
           
    }, function fail(error) {
           
    });

    screen.displayName=Comp.Name

    I get an error Unable to get property 'CompanyConfig' of undefined or null reference??

    Anybody out there can help me with this

    Friday, August 2, 2013 4:25 AM

All replies

  • I tried the following and that works:
    var z = myapp.activeDataWorkspace.ApplicationData.Customers.top(1).execute().then(function (result) {
            var topRow = result.results[0];
        }, function (fail) {
         
        })


    paul van bladel

    Friday, August 2, 2013 7:46 AM
  • Hi

    Thanks for your answer but ...

    Still getting the undefined or null reference on the table name (CompanyConfig)

     Meir
    Friday, August 2, 2013 8:37 AM
  • what happens if you create a browse data screen for CompanyConfig ?

    Everything works as expected?


    paul van bladel

    Friday, August 2, 2013 8:45 AM
  • yes the browse data screen for it works..

    Meir

    Friday, August 2, 2013 9:27 AM
  • I'm probably not helping you by saying that the tableName is case sensitive?

    paul van bladel

    Friday, August 2, 2013 9:32 AM
  • Nope :)

    Friday, August 2, 2013 9:40 AM
  • you are using dataWorkspace instead of ActiveDataWorkspace ??

    paul van bladel

    Friday, August 2, 2013 10:07 AM
  • used your exact code .. except for table name

    Friday, August 2, 2013 10:12 AM