1 of 1 people found this helpful
A bunch of different approaches to do this.
One of the "easiest" is to duplicate your layout and, using the Inspector, change the fields on one of the layouts to disallow entry in Browse mode.
Then add an "edit record" button to this layout that switches to the other layout where all the fields are fully editable. Then you can add a similar button to the "data entry" layout that "submits" the data and switches back to the "read only" layout.
I do this by unchecking browse mode as steveromig suggested and a button bar icon with a popover for editing. Either using the actual fields or global fields as needed for the solution. Globals are a good safe way to go. When "Saved" the globals are saved to the record.
Thanks. this doubles the form count, but still it's a workable solution.
Now if I have a set of screens and I rename them with an added "View" or "Edit" in the name like
- OS Form View
- OS Form Edit
how can I put a Button on every form to swith to its sibling Like
goto layout [ Get(activescreenname) & " Edit"] or
goto layout [ Get(activescreenname) & " View"]
so I don't have to hard code this on every form
I do similarly. Consistency in naming layouts like this also makes finding them easier.
And all your list layouts are shown.
But you can't beat that calculated Go to Layout (toggle).
Sent from miPhone
>>But you can't beat that calculated Go to Layout (toggle).
but in order to do this (what my question was about) how do I get the name of the current layout so I can append to it in calculates layout????
You could have a big transparent rectangle all over your layout which visibility you control. When it's visible, you click and the bigTransparentThing beeps at you. You click on edit and the BTT disappears.
Of course this will be defeated by user tabbing, if a tab order exists.
More completely, using "Layout Name by calculation":
Go to Layout [
[ ~curLay = Get ( LayoutName )
; ~editOrList = RightWords ( ~curLay ; 1 ) // return "List" or "Edit"
; ~result = Case
( ~editOrList = "List" ; Substitute ( ~curLay ; "List" ; "Edit" )
; ~editOrList = "Edit" ; Substitute ( ~curLay ; "Edit" ; "List" )
; ~curLay )
]; ~result // this will be dynamically set to the layout name, toggled between List and Edit or staying where you are
transparency over-lay was my friendly neighborhood spider man, until the layout went to WD. No layers (or behavior = not good).
now that leads me to another question. As I get more into this FMP thing I would like to make things more generic
each form has a button bar on the bottom (since 12 hour ago :-) )
on the view form :
on the edit form they arecaptioned:
I can use the same bar on both form type if I can change the caption of the buttons from edit to save and from delete to new respectively. I know how to case the code appropiately, but nt hoe to cahnge the caption
in VFP this is so ease like 'This.caption = "Edit" :-)
button bar labels can also be dynamic (using the same principle of getting the "List" or "Edit" as above)
but you also must remember that the label alone doesn't change, but the branching in the script called by each button must also test for the List or Edit. Or are you using a hiding technique or just have different buttons on the layout "types"?
I know. But how do I get to the caption
caption? the LABEL of the button or the tooltip (shown on hover)?
Screen shot(s) of layout mode and/or browse mode (of the buttons), please?
Usually the cation of a button is the text on the button. But if you prefer label, that's OK with me.
how to you programmatically change the word on the button based on a condition in a script?
I want the word Edit replaced with Save if the form is "OS Form Edit" when the form is displayed.
I know what to do when it's clicked
if that is not possible I have to have 2 controls one which says Edit one which says Save