locked
LS2012 HTML Client + RIA: "Invalid date/time value"? (sample included) RRS feed

Answers

  • Here goes then...

    Try you RIA and OData sources in a VS2013 rich client app. Does that work ok with dates?
    In my scenarios it did and I worked on tweaking the HTML client javascript for a temporary workaround.

    VS2013 RC - datajs-1.1.1.js
    VS2012 Update 2&3 - datajs.1.1.0.js
    Search for "Invalid"

            if (!parts || (!withOffset && offset !== "Z")) {
                if (nullOnError) {
                    return null;
                }
                //Xpert360: Invalid date/time from Salesforce WCF RIA
                //throw { message: "Invalid date/time value" };
                return null;
            }
    

    This is a temporary workaround and I am waiting for VS2013 RTM to investigate further. We will not use VS2012 LightSwitch HTML client any more, only VS2013. Work to do:

    #1 investigate the new timeoffset datatype

    #2 investigate "nullOnError"

    #3 investigate possible overuse of JQuery datetime auto-detection parsing

    Back on VS2012 Update 2 & 3...

    VS2012 - msls-1.0.0.js
    Search for "404"

                        operation.code(function error(err) {
                            msls_mark(msls_codeMarkers.queryDataEnd);
    
                            var statusCode = tryGetStatusCode(
                                    err.response);
                            //Xpert360: http 500 -> no items
                            if (statusCode === 404) {
                                operation.complete({
                                    totalCount: 0,
                                    results: []
                                });
                            } else if (statusCode === 500) {
                                operation.complete({
                                    totalCount: 0,
                                    results: []
                                });
                            } else {
                                reportServerErrors(err);
                            }
    

    This is a temporary workaround for VS2012 null object reference on http 500 status where VS2013 RC shows "No items". It is to stop our demo apps looking ugly.

    Go through that lot and get back with your progress.

    Thanks

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by A Bit of Help Friday, October 18, 2013 3:55 AM
    Wednesday, October 16, 2013 9:15 AM
  • Hi Guys,

    Well, I have some bad news...  I uninstalled VS2013RC, rebooted, and installed the released version.  I opened the sample application and the project was converted without any errors.  I cleaned it, and ran it... Boom... The datetime error persists...  :(

    Although I could tweak the LS JavaScript, I think that our solution is going to be to create empty browse, addedit, and view screens.  I'll use KendoUI controls and ajax on these pages to work with a WebAPI service, which we are already using for other tasks.  Since we are using the ASP.NET Membership system and not directly working with a database, it seems that we are not loosing anything that an LS Odata service provides.  I am going to work on this over the next few days, and will report back.

    It is a pity that no one from Microsoft has joined this conversation...  Such a simple scenario... Using POCO objects with DateTime, and they won't work.  Hopefully, at some point, they will discover this thread and fix it.

    Thanks again for all your help,

    Mike

    • Marked as answer by A Bit of Help Friday, October 18, 2013 3:54 AM
    Friday, October 18, 2013 3:54 AM

All replies