custom title action button to save and close window

edited April 28, 2017 in Questions
I have created a simple Skuid page that is launched from a standard button on the Case feed page. The page is supposed to be used as a pop up for editing a subset of case fields and posting a Chatter comment. I would like to create a custom save button on the page that saves all the changes (including the Chatter comment), closes the window, and refreshes the originating case feed page so the data changes will be reflected. Since I am new to Skuid and am not a developer, I am a little lost with regards to the custom button snippets. Where can I find help on how to achieve this?

Comments

  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited February 10, 2017
    Tamar,

    I think you should be able to accomplish this with the action framework... only a tiny bit of javascript to accomplish the requery.

    The standard button on the case feed page should launch a popup. In that popup, use the page include component to pull in your page.

    On that custom popup page, use a pagetitle component and add a button to run multiple actions:
    • save model(s) action
    • run custom javascript action
    • close topmost popup action
    for your javascript, create a snippet with this single line:
    skuid.$M('ParentPageModelName').updateData();
  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited December 7, 2016
    As an aside, if you rebuild your custom popup page within the popup on the parent page, instead of using a page include component, you could replace the javascript with a simple Query Model action in the action framework.
  • edited December 28, 2015
    Hi Matt, thank you for your reply. Currently I am using a field editor component on my page as demonstrated in the tutorials. I will try to read up on the action framework and the page include component and see how I can use them to follow your suggestion. My originating page is a standard SF case feed page and not a Skuid page. I am launching the Skuid "pop up" page using a URL button. I am not sure what you mean by "rebuild your custom popup within the popup on the parent page". Please excuse my ignorance, this is my very first Skuid page. .
  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited February 10, 2017
    Tamar,

    I'm sorry, I was assuming that the page you were launching from was a skuid page. If you can build your parent page in skuid (instead of just the 'popup' page), you'd have an easier time of it. And by easier, I mean less javascript. But if you want to leave your page as is, you'll have to work around it.

    In your current construct, probably the easiest way would be to just have your skuid page save button do the following:
    • save model(s)
    • redirect to url , open in current window. (back to your case feed page)
    If you can set up your URL button on the standard SF page to open in the current window instead of a new window, you're all set. Then you don't have to worry about trying to open and close windows and refresh windows with javascript.


  • edited December 29, 2015
    My requirements are to launch a pop up from the standard case feed page so I'm afraid your suggestion to open in the same window will not work for me. Thank you for your suggestion.
  • Rob HatchRob Hatch πŸ’ŽπŸ’ŽπŸ’Ž
    edited September 1, 2016
    Launching from the standard case feed page means you won't be using a skuid solution to do the launching. Β I'm not sure what actions are available on the feed page, Β but you might be able to have a custom action or a redirect url that goes to a specific skuid page. Β I'm also not sure you can do that in a popup. Β  The skuid page - easy. Β Getting there - not so much.Β 
  • edited December 29, 2015
    Hi Rob I can launch the "pop up" from a standard URL button. What I want is have the Skuid "pop up" auto close after I save the data on it. I will try creating a custom save button on my Skuid page that runs multiple actions and see if it works. I think I can get the originating case feed page to refresh if I use a JavaScript button to launch my Skuid "pop up" and reload the window after the Skuid "pop up" closes but I am not a developer and do not know how to write that bit of JavaScript.
  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited February 10, 2017
    window.close() will close your current window for you in javascript

    I'm not sure about refreshing the parent window.
  • edited April 19, 2016
    Thanks Matt, works great as a snippet, very helpful and simple.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!