locked
LS2013 + RIA Service: User_Created exists in General Methods, but adding records is disabled... RRS feed

  • Question

  • Hello,

    I've created a RIA Service in which users can be added, edited, deleted, and retrieved from the Membership system.  I've added this data source to an LS2013 solution and generated forms.  On the "Browse Users" screen, I've placed an "Add" button, as usual, and have generated the AddEditUser screen.  When I look at the "Users" table/entity in LS, and look at the methods available, I see User_Created, etc, so it appears that LS knows that I should be able to add records.  However, when I run the application, the Add button is not displayed.  Its properties are set to be visible and to not display it, if disabled.  So, it appears that LS is disabling this button, but I have no idea why...  When I disable the option to not display a disabled button, the button appears, but it is ghosty/grayed out! :P

    Here is the signature for creation of a User... I've tried with and without the Invoke, but the issue persists.

    [Invoke(HasSideEffects = true)] 
    public void CreateUser(User user)
    {
         if (user == null)
         {

    I don't see anything wrong with what I've configured, and would appreciate your suggestions.

    Thank you for your time,

    Mike

    Sunday, October 20, 2013 4:54 PM

Answers

  • How do you suppose LS determines which method supports CRUD? I would prefer explicit decoration but we stick to Insert Update Delete naming prefix and hoped that LS works with the parameter types. If there is anything more I would like to know... Cheers 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 Monday, October 28, 2013 9:33 PM
    Sunday, October 20, 2013 7:12 PM

All replies

  • How do you suppose LS determines which method supports CRUD? I would prefer explicit decoration but we stick to Insert Update Delete naming prefix and hoped that LS works with the parameter types. If there is anything more I would like to know... Cheers 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 Monday, October 28, 2013 9:33 PM
    Sunday, October 20, 2013 7:12 PM
  • Hi Dave,

    Thank you for your response!  In fact, my original method was named InsertUser(User user).  When it didn't work, I changed the name to CreateUser.  Still no luck...  I am going to create a quick sample in VS2012 to see whether my current code works there... If so, then the issue is probably something in the new release.  I'll report back what I learn tomorrow.

    Thanks,

    Mike

    Sunday, October 20, 2013 10:08 PM
  • Totally off topic but I have to say

    When I disable the option to not display a disabled button, the button appears

    is my current favourite sentence!  Nobody should think about that sentence without a safety net and a free voucher for psychiatric treatment :-)


    Paul Linton

    Monday, October 21, 2013 3:36 AM
  • Yikes!  I agree that it is convoluted! :P
    Monday, October 21, 2013 5:09 PM