• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

Dependant upon who is filling out form, mailsend to...

We have a form, FoodShow Registration
The form is to be completed by the salesreps for all of their customers who will be attending our foodshow

The SalesRep field is an author's field

Dependant upon the SalesRep, we want the form sent to their respective Sales Manager....
Division A, SanDiego, SalesRep Bob, completes form, automatically mails to Big Bob, the SanDiego Salesmanager

Division B, Chicago, SalesRep Jim, completes the form for his customer, automatically on Save and Send, mails the completed form to Jumbo Jim, the Chicago Salesmanager

currently the salesrep selects their sales manager from the company address book, but we want to make it even simpler for them.....

any suggestions?
0
Paulette
Asked:
Paulette
  • 11
  • 4
  • 4
  • +2
1 Solution
 
Jean Marie GeeraertsApplication EngineerCommented:
You have two options :
1) Add the sales manager to the manager field of the public name and address book (or the domino directory as it is called nowadays) and lookup the name of the sales manager from there.
2) Create a form to hold two names fields : sales person and sales manager. Then create a view, sorted on sales person containing only these documents and lookup the sales manager's name from this view.

I'd go for the first solution if possible, since this is the easiest. (You do however need to have users that are disciplined enough to leave this field alone and you need to be able to modify the fields for all concerned users to enter the sales manager).

The formula for the sales manager field would then look something like this, supposing the domino directory is on the same server as the current database :

@DbLookup(NoCache; "":"names.nsf"; "($Users)"; @UserName; "Manager");

This function will perform a lookup of the current user's name in the domino directory and return the contents of the field "Manager". This field is a names field, that can be filled out on the Work/Home tab of the person document of the user.

If you need any further info, let us know.

JM
0
 
PauletteAuthor Commented:
Jerrith


I am trying to follow the 'easy' way and have done this ...

In the NAB added the manager name to the work/home tab for three of my reps <to test>

On the form, added a hidden field, SalesMgr...hidden in all instances of use....computed

When I try to preview my form now, get the error

'entry not found in index or view's index not built yet'

Do I need to create a view as well?


0
 
PauletteAuthor Commented:
Jerrith


I am trying to follow the 'easy' way and have done this ...

In the NAB added the manager name to the work/home tab for three of my reps <to test>

On the form, added a hidden field, SalesMgr...hidden in all instances of use....computed

When I try to preview my form now, get the error

'entry not found in index or view's index not built yet'

Do I need to create a view as well?


0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
PauletteAuthor Commented:
Jerrith


I am trying to follow the 'easy' way and have done this ...

In the NAB added the manager name to the work/home tab for three of my reps <to test>

On the form, added a hidden field, SalesMgr...hidden in all instances of use....computed

When I try to preview my form now, get the error

'entry not found in index or view's index not built yet'

Do I need to create a view as well?


0
 
HemanthaKumarCommented:
It is your dblookup which is not finding the key.

For Person "Bob" there should be same value on the First sorted column in the view that you are referencing in the dblookup.

Get the field value "Manager" in the lookup.

Also the view that is being lookedup should be sorted on First column.
0
 
PauletteAuthor Commented:
Well, after playing with it a bit more, I decided that since it was looking into names.nsf (which on the server is the Public address book, where on local it is my personal address book)..I changed it to look to my local copy of the server address book (for testing)  now I don't get the error..yeah  BUT <isn't there always a but in my questions?>

I have the field hidden, yet the resulting value <manager's name> shows on the form...how do I hide the result as well?

And then, moving on to my desired result, how do I make it send a mail message to that manager when they save and close the form?  

thanks in advance again :)
0
 
PauletteAuthor Commented:
Well, after playing with it a bit more, I decided that since it was looking into names.nsf (which on the server is the Public address book, where on local it is my personal address book)..I changed it to look to my local copy of the server address book (for testing)  now I don't get the error..yeah  BUT <isn't there always a but in my questions?>

I have the field hidden, yet the resulting value <manager's name> shows on the form...how do I hide the result as well?

And then, moving on to my desired result, how do I make it send a mail message to that manager when they save and close the form?  

thanks in advance again :)
0
 
zvonkoCommented:
Hello Paulette,

instead using this:
@DbLookup(NoCache; "":"names.nsf"; "($Users)"; @UserName; "Manager");

try that:
@NameLookup([EXHAUSTIVE];@UserName; "Manager");

Place this formula into a field named: Manager
Make this field: ComputedWhenComposed

Place into QuerySave event this formuls:
@If(@IsNewDoc;@MailSend(Manager;"";"";"Follow this link";"";"";[IncludeDocLink]);"")


Good luck,
zvonko
0
 
PauletteAuthor Commented:
My Manager field is computed when composed / text

The value is
@NameLookup([EXHAUSTIVE];@UserName; "Manager");

Where do I put the querysave event?  Where do I define that?  I cannot find it, in help it says it says it occurs during the SAVE operation, but I can't find it on any of my saves....

0
 
zvonkoCommented:
click on a part of the form where no field are.
When clicked there, you will see left side to formula definition window an explorer window with a list of attributes for the form itself.
First attribute in the list is: WindowTitle
Scroll down, and you will find: QuerySave

0
 
HemanthaKumarCommented:
Create a field Called MailOptions (ComputedForDisplay) and set the value to "1"
Create one more field Called SendTo (ComputedForDisplay) which will refer to Manager field value

So on every save the notes will send the mail
0
 
PauletteAuthor Commented:
My Manager field is computed when composed / text

The value is
@NameLookup([EXHAUSTIVE];@UserName; "Manager");

Where do I put the querysave event?  Where do I define that?  I cannot find it, in help it says it says it occurs during the SAVE operation, but I can't find it on any of my saves....

0
 
PauletteAuthor Commented:
My Manager field is computed when composed / text

The value is
@NameLookup([EXHAUSTIVE];@UserName; "Manager");

Where do I put the querysave event?  Where do I define that?  I cannot find it, in help it says it says it occurs during the SAVE operation, but I can't find it on any of my saves....

0
 
PauletteAuthor Commented:
My Manager field is computed when composed / text

The value is
@NameLookup([EXHAUSTIVE];@UserName; "Manager");

Where do I put the querysave event?  Where do I define that?  I cannot find it, in help it says it says it occurs during the SAVE operation, but I can't find it on any of my saves....

0
 
PauletteAuthor Commented:
Whew, almost there thanks to all of you again

But I do have one last question on this one

I have added the specific manager to each reps Address Book entry....
Have followed Hemantha's suggestion...

Put the formula
@NameLookup([Exhaustive];   @UserName ; "Manager")
Behind the hidden Manager field

Put the formula
@If(@IsNewDoc;@MailSend(Manager;"";"";"Food Show Registration:  Follow this link";"";"";[IncludeDoclink]);"")

in the querysave

The only problem I am having, and I don't know why is that each time I click on Send, it doesn't just send the message to the designated recipient, it questions the name (no match found for name, brings up a dialog list INCLUDING the name in question....) is there a way round this?

thanks so much, a million thanks
0
 
HemanthaKumarCommented:
Include O and OU in defining the manager name (ie. fully qualified name, eg: Manager/Sales/US) in the person document.

0
 
Jean Marie GeeraertsApplication EngineerCommented:
Yes that would be it. Make sure the full distinguished name is available in the Manager field of the person document and it should work like a charm.

Cool function that @NameLookup thing, zvonko. I guess I'll have to study the formula's in my applicaton guide to see if there's other cool formula's like that ;-)
0
 
zvonkoCommented:
<|:-)
0
 
ArunkumarCommented:
JM, I experienced some coolest @Functions in RNext.  Like printing to the status bar, looping functions WOW !!! I no more need to go for scripts anymore for a notes app !

The entire DECS is not available as a property tab in RNext thats another coolest thing i saw.

I could not check the mobile interface yet.  Has anyone tried it ?

;-)

But....no application is yet developed by me or my company yet with RNext.  They are just running a test server even now...
0
 
Jean Marie GeeraertsApplication EngineerCommented:
Well, you can't expect people to run applications on an environment that's not officially released, yet. :-)
0
 
PauletteAuthor Commented:
worked wonderfully :)

thanks experts again
0
 
zvonkoCommented:
you are welcome ;-)


I'll give a round of cyber-beer for my expert buddies :-)

0
 
ArunkumarCommented:
yum yum yum....



0
 
Jean Marie GeeraertsApplication EngineerCommented:
Burps, thanks zvonko :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 11
  • 4
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now