entity.Type = DataWorkspace.ApplicationData.Types_SingleOrDefault("PR") in javascript
-
Tuesday, January 08, 2013 7:39 PM
How can I write above code in javascript?
myapp.Detail.created = function (entity) { //folowing does not work in javascript entity.DetailType = myapp.dataWorkspace.ApplicationData.DetailTypes_SingleOrDefault("PR"); //this is how it is done in C# //DataWorkspace.ApplicationData.DetailTypes_SingleOrDefault("PR") in C# };
thanks
- Edited by Bart.NET Tuesday, January 08, 2013 7:40 PM
All Replies
-
Wednesday, January 09, 2013 1:59 PM
This may help:
Using Promises In Visual Studio LightSwitch
So this may work (I can only guess):
myapp.dataWorkspace.ApplicationData.DetailTypes_SingleOrDefault("PR").execute().then(function (results) { entity.DetailType = results; });
The Visual Studio LightSwitch Marketplace
http://LightSwitchHelpWebsite.com
- Edited by ADefwebserverMVP Wednesday, January 09, 2013 1:59 PM
- Marked As Answer by Bart.NET Thursday, January 10, 2013 6:46 PM
-
Thursday, January 10, 2013 6:46 PM
Thanks, result.results[0] did the trick- Proposed As Answer by ADefwebserverMVP Thursday, January 10, 2013 7:31 PM

