What is the current way to do a custom button with some js in it?
We are building a custom button that needs to be able to read from the current contact (email address, phone, mailing address), and run a few lines of js. (We also need to create a call record.)
But how/where is this done in salesforce these days?
This page doesn't point me anywhere:
https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_enterprise.htm
And this explanation of the new method in Lightning isn't clear where the js lives:
https://developer.salesforce.com/forums/?id=906F0000000BWr4IAG
Where is the needed example/doc?
If you are using buttons on custom visualforce page there are no any problems with defining custom JS function for it. For example, if you use <apex:commandButton/> you can use such attributes as onclick, onkeydown, onkeyup and other. See more information in documentation.
If you are using buttons on object layouts, you can create custom button and chose executing of JS as a behavior, see attached screenshot.
If you mean some other cases, please, describe it.
Related
On standard salesforce page, I need to display some custom buttons based on some conditions. The decision to display the button or not is based on response from Apex method. As my page is standard visual force page, how can I trigger the JavaScript function before the page is loaded so that I can take a decision whether to display the button or not?
You can display a custom button on standard salesforce page. but salesforce not allowed to make any call on load of standard page. Salesforce have a feature that is page layout. You can create different record type with page layout in that you can use custom button as your need.
On the other hand you can make a decision and filter when javascript custom button click and show error like 'you are not allowed to click this button'.
I am using the material-ui next branch and using the following example as reference for building a dialog.
https://material-ui-next.com/demos/dialogs/
https://codesandbox.io/s/7rq8nl11x
I wanted to know the best way to let the user enter a new contact as per material guidelines ie how to handle the UI for click of add contact button present in the bottom of the dialog. Would it be to hide this dialog and show a new dialog instead which shows a form letting the user enter a new contact.
I'm mostly looking for suggestions on design.
There's a lot of good information on the material design guidelines and best practices for managing components in React.
With that said, a good solution for your situation is to handle all the account management within the one modal. Here's an idea for a structure that's very similar to what Google does:
DialogContainer as the parent component to handle logic and contain the next two components.
AccountList to render each user as well as the 'add account' button.
AccountCreation component that renders the input to add another account.
I have create new event in kendo scheduler.There is some problems in my scheduler.I want to show delete button only authorize person who is created this event.And I want to hide delete button who is not created this event,Only show event scheduler and hide icon.
I am so tired but not solved this problems please help
I think that you need to create different types of users and give them different perks. For example, the person who created that event will be an administrator. You have to create some function where the administrator will have the create and the destroy properties as true. To other users, you'll set those properties false. As for the hiding or not buttons, I suggest you to make your own custom edit form template. This was just a general idea but I hope you get the bigger picture.
updated answer:
Not only I think you should implement the CRUD operations manually but also customize the Scheduler behavior. Just like you can wire edit event and hide the save button if an user is not authorized or just like you can wire a save event and control wheather you allow or not event modifications, the same can be made with a delete event. Anyway, from what I understood, I think that using a custom editor template to control the state of any components should be enough. Basically, define a custom template and allow/disable/hide/show some widgets depending on the user that is logged in. The credentials can be loaded and used directly in the template. Check this dojo, it might be useful.
There's a search box on the top of Salesforce. Is it possible to override(re-implement) it? Like catching the click event, popping up dialog, or customizing the search result page...
I went over the Visualforce development guide, it seems I can't do this with Visualforce. Any suggestions?
You'd need to use custom sidebar components.
In one of them place javascript that will intercept the events from the global search -> and make that event invoke whatever you want.
Need to show a popup message in home page only for the first time a user logs into salesforce....
its more like a splash page.
it can be a jquery popup as well..
can i do it using a visualforce page ??? if yes, please give ur suggestions
can we do it using the sidebar component in salesforce ???
I thought of showing it using a sidebar component by keeping a custom field in user object...everytime he logs in i will check the custom field and the show the popup...since this popup will be shown only for the first time is there anyother better solution instead of querying the user object evertime..
thanks.
You can use window.open method of Javascript and for the sidebar provide your scroll option.
If you want to get fancy to have customized look you can just use jquery modal with some style on document ready.
We can use cookie to store if this is the first time or salesforce user object can tell you this is the first time