Link to home
Start Free TrialLog in
Avatar of cyle
cyle

asked on

Using browse button to get file folder.

Is there a way to use a hotspot button having a browse button just like using attachments but in this scenario you will be able to get an EX: C:/test/hotspots/expert.doc --- this will be displayed in your field instead of the usual.
Thank you.
Avatar of qwaletee
qwaletee

@Prompt([LocalBrowse]; .... ) returns a filename.  You can assign the return value to a field.
Avatar of cyle

ASKER

I created a hotspot button and formula @Prompt([LocalBrowse]; "Select a to open"; "0". Had it at 0 and 1 to test. I will not be opening any nsf file. I can open it but it will not display, my field is text and editable (changed it to computed to test) and value is the fieldname.
Try this

FIELD FieldName :=  @Prompt([LOCALBROWSE]; "Select a database to open"; "1");
""

~Hemanth
Add this formula in your browse button :-

FIELD fpath := fpath ; (where fpath is your file path field)
file := @Prompt([LocalBrowse]; "Select a database to open"; "1");
@If(file = ""; @Return(1); "");
@SetField("fpath";file);
@Command([ViewRefreshFields])
Avatar of cyle

ASKER

Commander Sir,
  It is giving me "Cannot execute specified command".
This was for ure information only , please remove it ---> (where fpath is your file path field)

Copy this and In this change the fpath to your fieldname

FIELD fpath := fpath ;
file := @Prompt([LocalBrowse]; "Select a database to open"; "1");
@If(file = ""; @Return(1); "");
@SetField("fpath";file);
@Command([ViewRefreshFields])
Avatar of cyle

ASKER

Yes, I did removed that part.
Notes Ver ?

This command is available form 4.6 only !!
Avatar of cyle

ASKER

Sorry, I am using 6.5
I assume you running this on Notes Client ? , Can you paste the portion of your code , is there anything else in formula besides this code ?
I just created a test form , two elements , one is Browse button , second is editable text field called fpath , it worked like charm. Are we missing something here ?
Hemant ,

Did you meant from 4.6 only or FOR 4.6 only ?

As I am on Release 6.0.3 September 26,  2003  and it worked great, I agree you don't need the FIELD declaration after R6 release, but just copied the code  from an existing application I worked on. Believe me it works on R6 and above.

From Help files :-
"With Release 6, you no longer need to declare the field receiving the assignment prior to setting its value with @SetField. For R5 or earlier clients, declare the field at the beginning of the formula, as follows:
FIELD Fieldname:=Fieldname; "
Avatar of cyle

ASKER

Two elements:
 1. field with name fld_filelocation property text & editable value is fld_filelocation
 2. a button
 
FIELD fpath := fld_filelocation ;
file := @Prompt([LocalBrowse]; "Select a database to open"; "1");
@If(file = ""; @Return(1); "");
@SetField("fpath";file);
@Command([ViewRefreshFields])
SOLUTION
Avatar of xp_commander
xp_commander

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
B'cuz I am very complicated person..... :p (Just Kidding)

Hey I know , that would work too , it just i had already paste the code at same time  , and was supporting my code, lol.

Cyle , the above code would work too, without any complications ;) , mine just have added lines to check the file is not empty @If thing.





Avatar of cyle

ASKER

Thank you both your help!!!