How to edit Persondocument in N&A

Hi there,

Can somebody help with this problem. I have button in a form that I want to open the current users Person document in our NAB. It has no view with the first sorted column containing complete user name. I also can't add any new views because the design is locked.
I have figured out how to open the NAB but I want to find the UNID to current users Person document that probably could be used as a parameter to open his/hers doc.

server:=@Name([CN]; @Subset(@DbName; 1));
uname:=@Name([CN];@UserName);
@Command([FileOpenDatabase];"Notes":"Nocahe";server:"names.nsf";"People\\by Name");
***** Some code to get UNID ****
@Command([OpenDocument];"0";unid)


/Brel
brelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HemanthaKumarCommented:
Use the abbreviated name of the current user as a key and pass it to the view ($VIMPeople) which is a standard view recomeneded to use with looking up the persons document. And get the DocumentUNID and edit the document

Good Luck
Hemanth

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brelAuthor Commented:
Do I need to use Lotus Script to obtain DocumentUNID or is there a way to do it with @Functions/Commands?
/brel
0
HemanthaKumarCommented:
Use notesdocument.UniversalID to get the document Unique ID.

Hemanth
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

brelAuthor Commented:
I've tested notesdocument.universalid, but I used this code instead (part of it):
     keys(1)=LastName
     keys(2)=FirstName
     Set dbHome = sess.GetDatabase(server, "names.nsf")
     Set viewPeople = dbHome.GetView("People\by Name")    
     Set docA = viewPeople.GetDocumentByKey(keys)    
     Set uidoc = ws.EditDocument(True,docA)

It works but it doesn't use the Form "Person" when displayed. Insted it uses a hidden Form called (46Person) that only displayes a fragment of the "original" document.

How can I tell Notes to use (46Person) to display?

/brel
0
HemanthaKumarCommented:
Try to use command viewswitchform in an agent and run that agent from the script.

Hemanth
0
brelAuthor Commented:
I want to have all code in an Action button that could be pasted in a mail that help users to find their own persondocument.

I also haven't enought accessrights to switch form.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.