Start a new topic

Current User as Notepad Author

So, I've run into what may be a bit of a bug, where IOM requires a Gift Notepad Author to be specified (despite the Author field not being offered in the Default Gift Notepad section in Config).  I could just choose someone to be the default Author, but I would rather it defaulted to whoever was logged in and running the import.

I've had a look around in RE's VBA glossary, and found these two functions:

GetUserID Function Returns the ID of the user whose name is sUserName.
GetUserName Function Returns the name of the given user ID.

Am I on the right track?  I'm not sure what the syntax would need to look like?


Thanks!


Sophia

...

Update...or instead of calling a function, would I just need to refer to the field CurrentUserID (member of the class IBBSessionContext?).  (Can you tell I am stumbling around blindly, clutching at straws? :-) )


Thanks, Wayne.

It turned out to be simpler than I thought...

[code]Import.Fields.GetByExcelName("AP").Value= Import.REUsername[/code]

(as part of an If statement, where AP is the virtual field mapped to Notepad Author)

Found that totally by chance - I noticed REUsername as a suggestion after I typed "Import.", and it does the job!
Your update sounds promising. You can always use MsgBox() to output the value during testing to see if it makes sense.

Also you might be able to turn off Author being required in Config->Fields->Notepad
Login or Signup to post a comment