It set based on a tick box being checked… It basically updates a DB fields with the information from Date and Username but when ever I reopen the form to look at the stamps… They always say the person who is logged in… E.g If it was filled in with Joe Bloggs (another user) they’ve pressed save… I open the same form and look at the same record. It will say Aaron Gulley in the username box and the date will be today rather than the date when the tick box was ticked.
You should probably only use that code when doing an Update, otherwise you should simply just EpiBind to CollectionStampDate_c & CollectionStamp_c and nothing more, nothing less.
Even better, the way I would do it is I would set the user and the timestamp in the UD100 BPM so if you have multiple companys and they have their own timezones you could use
The two boxes are only bound to the data fields nothing else. When the form loads they some how show current data but there is nothing in Form Load that causes this.
What’s the BPM code for Username e.g Joe Bloggs rather than jbloggs.
Must be something going on with the if statement that checks the checkbox. Make sure your doing it in an AfterFieldChange event. (dont use checkbox events if you are)
BPM:
string name = Db.UserFile.Where(u => u.DcdUserID == Session.UserID).Select(x => x.Name).First()