AnsweredAssumed Answered

get file info on datacard command button

Question asked by Joel Seerey on Jan 27, 2017
Latest reply on Feb 1, 2017 by Joel Seerey

first off I am very new to coding.

I have been trying to execute some code upon a data card button push.

I have been able to get code to run based on a button push but I am having issues with getting my code to recognize the file the button is attached to because I would like to only run the action on files that are checked out by the current user.

 

 

                IEdmFile5 aFile = default(IEdmFile5);

                aFile = (IEdmFile5)poCmd.mpoExtra;

 

 

I believe the issue is coming from these two lines. I was hoping I could get the file info from this code in the same fashion that I can get the vault info from this code

// set vault

                EdmVault5 vault1 = default(EdmVault5);

                vault1 = (EdmVault5)poCmd.mpoVault;

 

vault1 is then used here

               IEdmUserMgr5 userMgr = default(IEdmUserMgr5);

                userMgr = (IEdmUserMgr5)vault1;

                IEdmUser5 user = default(IEdmUser5);

                user = userMgr.GetLoggedInUser();

 

 

from this, i am able to get the user.name which I use here with my aFile variable

 

 

  if (user.Name == aFile.LockedByUser.Name)

 

so where am I going wrong the code builds just fine and will run as long as I exclude the aFile lines. how can I call the file so I can use lockedbyuser without selecting a file path?

 

 

I have been asking about some of the general issues around this in the epdm forum but I thought that now I have a more pointed question I would come here for help

Outcomes