I want to generate a sequential number in my Mailin database. I created a view, sorted (descending) by the sequential number field. I’m also using @dblookup to get the first highest number then add one. Everything works fine so far.
I want to create agent that will assign tickets to 12 team members in orderly manner. First ticket will go to analyst #1, 2nd ticket to, analyst #2 and so on.
I created two hidden fields in a form to set a counter. The first field - Incremented - has this formula…
Everything works fine when I create new documents from the database. But, when new mail arrives, the two field values are not calculated. It appears that the document always have to be saved for the field values to be calculated.
If anyone has any idea of what I can do to get the computed fields saved, i would really appreciate it. I’ve searched the forum and haven’t found anything to work yet.
Sounds like you want to move the code into an agent running on new mail, assigning the numbers as the mails come in. Make the field editable and hidden with a computed for display field as well.
Thanks Dan! I made the ‘Counter’ field editable with computed for display, moved the code into an agent. I run the agent on new mail and nothing happened. For some reason, the field values are not calculated or saved. Is there anything I’m missing?
When you say nothing happened, do you mean the agent didn’t run at all?
You need to change the agent slightly of course, as the agent needs to assign the value to the field, rather than just computing to the correct value, so if you haven’t done that make sure you have. Post the agent formula if you’re unsure
As this is now an agent acting on new messages, you don’t need the checking for new document or anything, and you’re not setting the fields at all (well, you are at the beginning of the agent, but you haven’t set the values yet)
Thanks! I modified the agent and it’s working like a charm! I really appreciate your help!
Now, the client wants the tickets to be moved to the analysts folders. I’ve six folders called “Analyst1” to “Analyst6”. Can you please help me how to move new e-mailed documents to these folders??
Do I need another agent or can I do it with the one that’s already there?
The Incremented should always have the last number from the “LastNumber” view. This works fine when I create new mail from the database. But, whenever documents are mailed in, Increment displays “”.
Then your problem must be that the document that is being processed by the agent is not a new document. A new document is one that has not yet been saved but if the document is laready in your mail-in database, it must have been saved at least once. You need to solve the logic there.
I go back to my suggestion: Don’t try to modify the mail document - modify another document that you create purely for tracking the last assigned analyst.
You don’t even need to use the mail document to keep track of numbers. Create a document that tracks the last assigned analyst number and when you send the document that was just mailed in, check that number to see who should be next on the list. You can even use the same document to keep track of analyst names who are available that day (one may be on vacation or sick for example). Then the number is incremented and if it goes beyond the last number in the list, reset it to 1 and pull the first name from your list of available analysts.