Pages

Thursday, March 18, 2010

Thanks to Javascript Grid Editor adopters!

I just wanted to drop a quick note to thank all of those who have implemented my Javascript Grid Editor project.  Furthermore, with additional eyes on the project I've been able to identify and correct a couple of bugs.  The version has been updated to 1.0.2 to reflect the changes.  Big thanks to those who have kept me in the loop about problems they've had so we can resolve these things.

As for those of you who would be interested in knowing the next move for this project, I have a handful of features that I'd like to add in short order.  The first of which, will be the ability to validate input for required fields.

It's a bit of a pain that the fields don't perform input validation right now (i.e. verifying a value exists), and it could be considered a bug, but I honestly hadn't intended to include that functionality in the initial release, since I figured the platform would throw the appropriate errors.  This has turned out to be an incorrect assumption on my part when it comes to Business Required attributes.  So, expect to see a feature release in the near future to include this.  Apologies to all who are affected by this.

11 comments:

  1. Dave: Wow. Very impressive. Awesome work. Congratulations, and thank you.
    PS: I blogged about your javascript grid editor at http://icu-mscrm.blogspot.com/2010/03/crm-grid-editor-all-done-with.html

    ReplyDelete
  2. Hi Dave,
    Iam at a client location where the CRM is heavily customized. They wanted editable grids and I was fortunate enough to land here. :)
    While implementing this, and in the EDIT mode, I get the following errors for below variables while debugging:
    LOCID_ARRAY_SHORT_MONTHS is undefined
    LOCID_ARRAY_LONG_MONTHS is undefined
    LOCID_ARRAY_SHORT_DAYS is undefined
    LOCID_ARRAY_SHORTEST_DAYS is undefined
    LOCID_ARRAY_LONG_DAYS is undefined

    LOCID_SHOW_WEEK_CAL_WIDTH is undefined
    LOCID_NO_WEEK_CAL_WIDTH is undefined
    LOCID_CALENDAR_HEIGHT is undefined

    LOCID_LU_SELECT_VALUE_FOR is undefined

    I have been struggling with this for sometime now.Actually if this works then this will be a major win for me for showing the power of CRM to the client. If this is related to a corrupted CRM installation, then please let me know as it would be a big relief to know that the culprit is not me! :-)

    ReplyDelete
  3. Spike,

    Those variables are necessary for the calendar controls for "Date[and Time]" attributes. They're supposed to be retrieved by the function RetrieveGlobals() at line 703. It gathers them from the AdvancedFind page. (It's kinda hacky that way, but I had to get them from somewhere dynamically; they're not native to grids, just forms and other places that actually implement controls.)

    So, if the AdvancedFind page has been sufficiently hacked or "customized", then it may not be presenting the global script references that I'm looking for. However, it's possible that the global variable declarations just simply aren't in the first script element on the page--which is what the function looks for, specifically. You may only need to change the function to locate and obtain the contents for the proper script element containing the missing global declarations.

    Best of luck!

    ReplyDelete
  4. Hi Dave,
    Thank you very much for replying back. As per your suggestion, I did take a look at my custom entity form's HTML when it loaded. I find that all the variables have the necessary values assigned:

    var LOCID_ARRAY_SHORT_MONTHS = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,";
    var LOCID_ARRAY_LONG_MONTHS = "January,February,March,April,May,June,July,August,September,October,November,December,";
    var LOCID_ARRAY_SHORT_DAYS = "Sun,Mon,Tue,Wed,Thu,Fri,Sat";
    var LOCID_ARRAY_SHORTEST_DAYS = "S,M,T,W,T,F,S";
    var LOCID_ARRAY_LONG_DAYS = "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday";
    var LOCID_SHOW_WEEK_CAL_WIDTH = "170";
    var LOCID_NO_WEEK_CAL_WIDTH = "150";
    var LOCID_CALENDAR_HEIGHT = "163";

    var LOCID_LU_SELECT_VALUE_FOR = "Click to select a value for \x7b0\x7d.";

    The AdvancedFind.aspx also seems to have these values once its loaded. It looks like I have hit a wall here...is there anything else you would like me to try? I really have a feeling I can get this working just like everyone else out here...Thanks for all your help!

    ReplyDelete
  5. AdvancedFind.aspx is exactly where the previously mentioned function scrapes these values from. However, if you look at the function, it looks for these values within the first <script> element. If it's been pushed to some subsequent <script> element by unsupported customization, then the function will need to be changed to locate that one instead.

    My code is designed to wait for the inclusion of those external bits of code before it will attempt to function--so it must be finding something other than the required global variables in that first <script> element.

    ReplyDelete
  6. Thank you for your response Dave. I have checked several times now and can say for sure that all the required values are present within the first script element. I have also tested this with multiple entities. Everytime I get the same error as mentioned above. I have also tried adding the values to the Date.js file after which it fails at "LOCID_LU_SELECT_VALUE_FOR is undefined". Is there someway that I can copy all the values and put them in a seperate file and make your script to read from it and then go from there. Can you show me which function I might need to edit to achieve this? Sorry for being a bother.

    ReplyDelete
  7. Spike. There may be an issue with the usage of SERVER_URL in my script, and I've come across many scenarios where it doesn't work properly. My suspicion is that the Advanced Find page is failing to load, but the absence of any error checking in that bit of code keeps the problem from being more apparent. Try replacing line 704.

    From:
    httpObj.open("GET", SERVER_URL + "/AdvancedFind/AdvFind.aspx", false);

    To:
    httpObj.open("GET", prependOrgName("/AdvancedFind/AdvFind.aspx"), false);

    If the errors go away, then you'll need to replace every reference to SERVER_URL this way. I may issue a bug-fix update to address this if it turns out to have affected you this way.

    ReplyDelete
  8. YES!! YES!! YES!!!...thank you sooo very much..this has fixed my issue..Iam able to successfully EDIT and INSERT records(YIPPEE!!!)...this is really amazing..you cannot imagine how ecstatic I feel right now..thanks to YOU!..I am really grateful to you and your constant support Dave...you have truly given me a reason to be "Merry" this Christmas...I wish you the very best from the bottom of my heart..may the joy always be with you :-)

    Thanks for everything once again,
    Srihari R.

    ReplyDelete
  9. Spike. You're quite welcome. In the future, though, I would prefer to be contacted directly by email for issues pertaining to support of my projects. It's easier to manage support without having to approve moderation on comments to the blog. However, you have provided me an excellent opportunity to have a published example of the support I am willing to provide.

    ReplyDelete

Unrelated comments to posts may be summarily disposed at the author's discretion.