Note that there are some explanatory texts on larger screens.

plurals
  1. POSet related entity to current user in HTML Client
    primarykey
    data
    text
    <p>I am building a Help Desk ticketing program in Lightswitch, and have been having trouble with one requested feature. I was asked to build a mobile friendly version of the app for End Users to submit tickets from their mobile devices. I built the app, with just a couple screens, and added code to the PreProcess query to limit the tickets they can see to only their own. That works wonderfully. What I'm having trouble with is assigning the currently logged in user as the submitter on a new ticket. I've looked at multiple guides online, all of which stop short at what I'm trying to do. The most promising I've found is <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/47832659-4ed3-4a8c-9a62-b3ad46c8e8b4/get-logged-in-employee" rel="nofollow">http://social.msdn.microsoft.com/Forums/vstudio/en-US/47832659-4ed3-4a8c-9a62-b3ad46c8e8b4/get-logged-in-employee</a> With that technique, I can succesfully display the current user on the screen.</p> <p>The challenge is, setting the Ticket.EndUser field to the CurrentUserName field. I've tried it in the created method of the AddEditNewTicket screen, and the beforeApplyChanges method.</p> <p>I've been bashing my head against this wall for a couple days now, has anybody out there ever accomplished this?</p> <hr> <p>UPDATE</p> <p>So, I think I may have found the problem, just not sure how to get around it. In the execute code for the new ticket button, I create the ticket, and use <code>newTicket.setEndUser()</code>. This function takes an EndUser entity as a parameter, so I retrieve it with <code>myapp.activeDataWorkspace.MyDataBase.Techs_SingleOrDefault(CurrentUserName)</code> which returns null. UserName is the primary key for my Techs table.</p> <p>Even when I use a literal string for the UserName, it still returns null.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload