1 Reply Latest reply on Mar 28, 2013 9:13 AM by philmodjunk

    Merging - User Address...???



      Merging - User Address...???


           OK...I'm going to do my best to explain this and not confuse. 

           I have a database with a table called Users.  It has user names, addresses, phones, etc. 

           I am creating letters which will merge various information in the database. 

           I have set a variable to insert the current logged in user name, address in the appropriate areas on letters when needed and this is working fine.  The problem, some users which would be generating letters can work in two different locations. 

           I am trying to figure out the best way when creating letters and merging information to put their location in the header (Building name and address) and in the appointment location (building name). 

           I was thinking that on the user table I can put location 1 name, address and location 2 name, address fields.  But what I wondered was if there was a user with only one location could it automatically fill this in the appropriate merge fields and if they had two the user must select which location they would like to use ? 

           If there is a better way to go about this I'm open to suggestions, I'm learning as I go and may not know all the different capabilities available. 


        • 1. Re: Merging - User Address...???

               A small variation to consider is that instead of two sets of location fields, you could use a related table where each record is a different location for the same user.

               It's hard to answer your question without knowing more about what you currently have in place. Since you have this data already in fields in your database, you don't really need to copy the information into variables. You can simply refer to the fields.

               There are a number of ways that you can use to select from more than one location for the same user. A script can detect that there are multiple locations and pop up a custom dialog or modal window asking the user to select a location. The script can then use the user's choice to set a field or variable to a value that then controls which location appears in your layout for use as a merge field. (A calculation field can return the address for location 1 or location 2 depending on what value is set in a variable or field by your script.You'd use that field as your merge field on the layout.)