[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

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
0
brel
Asked:
brel
  • 3
  • 3
1 Solution
 
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
 
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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now