Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Turning buttons on and off


Onesimus

Recommended Posts

Is there a way of deactivating a button when it is pressed and peformed its script - and automatically reactivating the same button when a user returns to the layout that that button was on?

 

In essence, I only want that button to perform its script only once when it is on that layout - and to be deactivated if that button is pressed further. Leaving that layout then returning to the layout reactivates that button.

 

Onesimus

Link to comment
Share on other sites

Do anything like this:(may be this help you)

Create one global field "Pressed"

In script for button do like this:

Allow user abort off

If (not Pressed)

Pressed=1

Perform script .........

Pressed=0

Endif

Link to comment
Share on other sites

Thanks for your response, aaa - but how do you introduce variables into scripts e.g. Pressed=1, Pressed=0, etc?

 

Onesimus

Link to comment
Share on other sites

  • 3 weeks later...

another way might be to have two identical layouts - one with the button...one without... if the user presses the button - you perform your script and switch to the layout without the button.... you can even put a 'greyed out' version of your button on the second layout...

Link to comment
Share on other sites

adding to aaa's suggestion, using container fields, you can make custom buttons look pressed and active.

 

store the buttons in a global repeating container gButtons

 

Script1Button=calc, container result=case(pressed=1;GetRepetition(gButtons;1);GetRepetition(gButtons;2))

 

then define this container field as the button that calls your script.

 

You can use gButtons to store more buttons (pressed-unpressed, sent-received-read, trash-save, whatever) that are set by different calcs, Script2Button Script3Button etc.

 

kjoe

Link to comment
Share on other sites

OH COME ON! The visibility routine is now old news - Simply create a relationship and portal which when a condition is met, the button (or whatever) appears (or changes state) on the layout. When the condition is not met, the button (or whatever) simply disappears (or changes state). Rather elementary, Watson.

 

If you need a sample of how this is done, email me at fmguru@tampabay.rr.com and I can send you about a million little files illustrating the technique. So, if one returns to the first layout, then the script simply reverses the relationship and VOILA - the button is back to its original state. Really quite simple - and no convoluted calcs needed.

 

Tom laugh.gif

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use