Paulette
asked on
Button with address book behind to populate fields
In a database I am creating, there is to be a 'requested by' button. Behind the button I would like to have code that brings up an address book choice box, you pick the name of the caller from the address book <NAB> and the fields branch/phone etc are populated from that. There is a similar database in use on one of our servers <designed by someone no longer here> that has that type of button that works on that server only <though the form is used company wide>. The code behind the existing button is...
SubDir:=@LeftBack(@Subset( @DbName;-1 );"\\");
DB_Name:=@If(SubDir="";""; SubDir+"\\ ") + ContactList;
Choice:=@PickList([Custom] ;@Subset(@ DbName;1): DB_Name; "Employees";"Select A Contact";"Select the related contact.";1);
Chosen_Contact:=@Subset(Ch oice;1);
@If(Chosen_Contact ="";"";@Do(
@SetField("RelatedDocument "; @Text(Chosen_Contact));
@SetField("RequestedBy";@D bLookup("" :"NoCache" ; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;2));
@SetField("PeopleToNotify" ;@DbLookup ("":"NoCac he"; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;2));
@SetField("ReqByPhone";@Db Lookup("": "NoCache"; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;3));
@SetField("ReqByLocal";@Db Lookup("": "NoCache"; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;4));
@SetField("ReqByDept";@DbL ookup("":" NoCache"; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;5));
@SetField("ReqByDivision"; @DbLookup( "":"NoCach e"; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;6));
@SetField("ReqByBranch";@D bLookup("" :"NoCache" ; @Subset(@DbName;1):DB_Name ; "Employees"; Chosen_Contact;7))))
Is this more complicated code than I need put in?
Any suggestions?
thanks
SubDir:=@LeftBack(@Subset(
DB_Name:=@If(SubDir="";"";
Choice:=@PickList([Custom]
Chosen_Contact:=@Subset(Ch
@If(Chosen_Contact ="";"";@Do(
@SetField("RelatedDocument
@SetField("RequestedBy";@D
@SetField("PeopleToNotify"
@SetField("ReqByPhone";@Db
@SetField("ReqByLocal";@Db
@SetField("ReqByDept";@DbL
@SetField("ReqByDivision";
@SetField("ReqByBranch";@D
Is this more complicated code than I need put in?
Any suggestions?
thanks
ASKER
As the database will be on 3 or 4 servers, geographically distant, what would you suggest to be the 'best' or 'most straight-forward' way to accomplish what I am aiming to do?
any suggestions appreciated
any suggestions appreciated
Replicate the database which will be used for lookup to all 3 or 4 servers and use the replicaID in place of Server:DBPath for lookup.
ASKER
Would it be more straight-forward for me to create my own code or method to achieve this lookup? Rather than trying to pick someone elses code apart and change as necessary, would I maybe be further ahead <given I am at the beginner level of design> to use a method other than this?
Or maybe I am trying to do something WAY over my head....
thanks for your input as usual.....looking forward to your opinion...
Or maybe I am trying to do something WAY over my head....
thanks for your input as usual.....looking forward to your opinion...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When I click on the 'requested by' button I get this error
'entry not in design list' <pretty unspecific I know....>
what causes this?
'entry not in design list' <pretty unspecific I know....>
what causes this?
The specified column 10 is hypothetical, you have to substitute with the column that contains all the information that will be retrieved and parsed.
SubDir:=@LeftBack(@Subset(
DB_Name:=@If(SubDir="";"";
is the deciding factor to see what database it is hitting.
In the line,
Choice:=@PickList([Custom]
@Subset(@DbName;1), select the server which would be the current server the database is residing.
In order to generalize this code, do this (Which will be a hard coding)
Server := "Name of the server where the lookup db is residing";
DB_Name := "Path to the database"
OR you can use some kind of control document and store centrally the path and server info of the lookup database, OR you can create a shared field containting the same info.
Let me know which suits your purpose
~Hemanth