1

I'm really at a loss. I think it should be dead-easy to create a button that updates a status, but I can't work it out. On a custom record page I want a Quick Action button. When the user presses that button the status (a field on the record) needs to be set to a certain value.

The closest I got was creating a custom component and call that component from the Quick Button. But annoyingly this comes up with a popup (in which the componant normally would show) whilst my component's Init method updates the status as I want. This works, but is not what I want. The second aproach would be to use a flow URL in a button, but unfortunately you can't use regular buttons in Lightning either :(

Now I've also been looking at workflows and other stuff, so I'm not opposed to a 'non-coding' approach. I just don't know how to do it... Anyone?

0

There are couple of options that i can think of

1.Create a custom lightning component for Detail Page and a custom code to update record

The lightning component will be a simple button with a server call to update record

2.Create an action that has a VF page and onload the page would update the record .Please be aware that onload do not update or do a DML as that would create a security threat Cross Site Request Forgery (CSRF) documented here

So easiest approach would be to build a simple lightning component and drop on record detail page .

  • As I mention in my question, the Lightning Component option works, but serves a popup, and I would like to avoid that. Your 2nd option doesn't work on for Lighting, and as you say yourself wouldn't allow a DML. – Marco Pietersen Dec 21 '16 at 8:48
  • @Marco my first option is to use lightning component on detail page and avoid quick action .For second dml is allowed on action attribute but it has security threat – Mohith Shrivastava Dec 22 '16 at 3:51
  • Thanks. Using a component on the detail page is my starting point, but I thought it to be more elegant to use the quick buttons. But apparently it's not possible to trigger any update without using a form. It just seemed too obvious so I thought I missed something. I'll stick with my button component then. – Marco Pietersen Dec 22 '16 at 12:31
0

There appears to be no real solution for my usecase at the moment. Closing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.