alexed1 / LightningFlowComponents

A collection of unofficial Flow extensions that can be used to enhance Salesforce Flow and Orchestrator.
http://unofficialsf.com
Other
576 stars 574 forks source link

navigationButtonFSC not working #40

Closed datapharmer closed 6 years ago

datapharmer commented 6 years ago

The unmanaged package installer link does not appear to be functional. It installs fine and you can see the button, but url buttons do not actually do anything when clicked. Also, while the youtube video is fine the variables in the written instructions do not match the component variable names anymore.

alexed1 commented 6 years ago

I'm not seeing any obvious problems in the deployment chain...can you post your configuration for the control? also, post the code in your org for navigationButtonFSCController.js, which should be available in that component bundle if your install has happened properly.

datapharmer commented 6 years ago

Sure,

It looks like the navigateToURL and navigatetosObject are not working properly as if I do a terrible horrible thing and change urlEvent.fire to window.location = destUrl it works as expected (I had to add http:// to the front of the default url in the component to get it to not append the url).

For testing purposes my config is minimal, though I've tried it with additional parameters as well with no luck: image

({
    handleClick : function(component, event, helper) {
        var destUrl = component.get("v.destinationURL");
        var urlEvent = $A.get("e.force:navigateToURL");
        var navigationGoal = component.get("v.navigationType");

        var destType = component.get("v.destinationType");
        if (destType == 'url') {           
             urlEvent.setParams({
                 "url": destUrl
             });        
        }
        if (destType == 'record') {
            console.log('in record');
            var destObject = component.get("v.targetRecordId");
            console.log('recordId is:' +destObject)
            urlEvent = $A.get("e.force:navigateToSObject");
            urlEvent.setParams({
              "recordId": destObject,
              "slideDevName": "related"
            });
        }
        urlEvent.fire();
        var navigate = component.get('v.navigateFlow');

        if (navigationGoal == 'finish') {
          navigate("FINISH");  
        }

        if (navigationGoal == 'next') {
          navigate("NEXT");  
        }  
        if (navigationGoal == 'back') {
            navigate("BACK");  
        }  
    }
})
alexed1 commented 6 years ago

I think you might be getting bitten by the fact that force navigation events only work in Lightning Experience. window.location = destUrl works because it doesn't use events. It just executes some standard javascript. I just added this to the docs for navigationButton. Does it explain what you're seeing?

NOTE: This component uses force events technology that only runs in true Lightning Experience. It will not run in:

On Fri, Jun 15, 2018 at 12:39 PM datapharmer notifications@github.com wrote:

Sure,

It looks like the navigateToURL and navigatetosObject are not working properly as if I do a terrible horrible thing and change urlEvent.fire to window.location = destUrl it works as expected (I had to add http:// to the front of the default url in the component to get it to not append the url).

For testing purposes by config is minimal, though I've tried it with additional parameters as well with no luck: [image: image] https://user-images.githubusercontent.com/6548767/41486342-183763d6-70b2-11e8-8c7a-8b2c3cf53c48.png

({ handleClick : function(component, event, helper) { var destUrl = component.get("v.destinationURL"); var urlEvent = $A.get("e.force:navigateToURL"); var navigationGoal = component.get("v.navigationType");

    var destType = component.get("v.destinationType");
    if (destType == 'url') {
       urlEvent.setParams({
           "url": destUrl
       });        
    }
    if (destType == 'record') {
        console.log('in record');
        var destObject = component.get("v.targetRecordId");
        console.log('recordId is:' +destObject)
        urlEvent = $A.get("e.force:navigateToSObject");
        urlEvent.setParams({
          "recordId": destObject,
          "slideDevName": "related"
        });
    }
    urlEvent.fire();
    var navigate = component.get('v.navigateFlow');

    if (navigationGoal == 'finish') {
      navigate("FINISH");
    }

  if (navigationGoal == 'next') {
      navigate("NEXT");
    }
    if (navigationGoal == 'back') {
        navigate("BACK");
    }
}

})

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/40#issuecomment-397722849, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_tE5RCqGICgKEgc99hoBt0Se7hM3wVks5t9A2DgaJpZM4Uofm- .

-- Alex Edelstein Sr. Dir. Product Management - Lightning Flow and Einstein Next Best Action Salesforce.com

http://smart.salesforce.com/sig/aedelstein//us_mb/default/link.html

datapharmer commented 6 years ago

I'm afraid it doesn't. I've even tried activating it, making sure I was in lightning and visiting it via a url similar to as follows:

https://mydomain.lightning.force.com/flow/myflow and the button still doesn't work.

datapharmer commented 6 years ago

I need to add support for URLFOR due to CSRF headaches so I'll try adding some support for classic at the same time if it doesn't get too crazy on Monday but want to make sure I'm not painting over other problems.

alexed1 commented 6 years ago

Do you know how to set a JavaScript breakpoint in browser console? It would be good to know if the code is getting called

On Fri, Jun 15, 2018 at 1:43 PM datapharmer notifications@github.com wrote:

I need to add support for URLFOR due to CSRF headaches so I'll try adding some support for classic at the same time if it doesn't get too crazy on Monday but want to make sure I'm not painting over other problems.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/40#issuecomment-397736741, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_tE2CDzVEfM3VoK1Oku1x7-69000rvks5t9BxfgaJpZM4Uofm- .

-- Alex Edelstein Salesforce

Sent from phone. This means that my answers may seem a little terse and have weird stuff.

datapharmer commented 6 years ago

I wrote a console log message just before the .fire which showed up and wrote the url variable to the log as expected when clicked

I also wrote an if check for the urlevent Which came back true.

I can see what debugger; returns when I open it up next that’s more helpful

On Fri, Jun 15, 2018 at 5:57 PM Alex Edelstein notifications@github.com wrote:

Do you know how to set a JavaScript breakpoint in browser console? It would be good to know if the code is getting called

On Fri, Jun 15, 2018 at 1:43 PM datapharmer notifications@github.com wrote:

I need to add support for URLFOR due to CSRF headaches so I'll try adding some support for classic at the same time if it doesn't get too crazy on Monday but want to make sure I'm not painting over other problems.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/alexed1/LightningFlowComponents/issues/40#issuecomment-397736741 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AC_tE2CDzVEfM3VoK1Oku1x7-69000rvks5t9BxfgaJpZM4Uofm-

.

-- Alex Edelstein Salesforce

Sent from phone. This means that my answers may seem a little terse and have weird stuff.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/40#issuecomment-397752673, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPtH4kNuQj1DAvAWVU10ICOcPhzkACGks5t9C3fgaJpZM4Uofm- .

datapharmer commented 6 years ago

image

datapharmer commented 6 years ago

Ok, so a little more digging and it looks as if this is may possibly working as expected but requires the flow to be embedded in another page to actually work. I'll explore this more and send a pull request that might make this a little more robust.

datapharmer commented 6 years ago

@alexed1 Ok, so here are my finding:

-It just doesn't seem to work in lightning. I modified the code as follows and embedded it in a lightning button to test. Here is my modified code for debugging:

(function() {
  const {$A} = window;

  return {
  "meta":{
    "name":"c$navigationButtonFSC",
    "extends":"markup://aura:component"
  },
  "controller":{
    "handleClick":function(component, event, helper) {
        var destUrl = component.get("v.destinationURL");
        var urlEvent = $A.get("e.force:navigateToURL");
        var navigationGoal = component.get("v.navigationType");

        var destType = component.get("v.destinationType");
        if (destType == 'url') {           
             urlEvent.setParams({
                 "url": destUrl
             });        
        }
        if (destType == 'record') {
            console.log('in record');
            var destObject = component.get("v.targetRecordId");
            console.log('recordId is:' +destObject)
            urlEvent = $A.get("e.force:navigateToSObject");
            urlEvent.setParams({
              "recordId": destObject,
              "slideDevName": "related"
            });
        }
        if( (typeof sforce != 'undefined') && (sforce.one != null) ) {

                        console.log("running navigation for lightning desktop");
        }
        else {console.log("running lightning classic")}
        console.log("destination type: "+destType);
        console.log("URL: "+destUrl);
        urlEvent.fire();
        debugger;
        var navigate = component.get('v.navigateFlow');

        if (navigationGoal == 'finish') {
          navigate("FINISH");  
        }

        if (navigationGoal == 'next') {
          navigate("NEXT");  
        }  
        if (navigationGoal == 'back') {
            navigate("BACK");  
        }  
    }
  },
  "helper":{
    "helperMethod":function() {

    }
  }
};

}())

The console output was as follows:

11:02:15.560 aura_prod.js:579 XHR finished loading: POST "https://air.lightning.force.com/aura?r=155&aura.NavEventManager.getResolvedIntegrationUrl=1". z.send @ aura_prod.js:579 (anonymous) @ requestIdTransport.js:3 WA.zk @ aura_prod.js:241 z.un @ aura_prod.js:841 WA.zk @ aura_prod.js:241 WG.Fp @ aura_prod.js:833 WA.zk @ aura_prod.js:241 WA.start @ aura_prod.js:240 SE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 z.bb @ aura_prod.js:783 (anonymous) @ aura_prod.js:756 executeGlobalController @ aura_prod.js:756 Promise @ alohaUrlService.js:2 p @ alohaUrlService.js:2 _runURLNormalizers @ alohaUrlService.js:2 b.length.b.(anonymous function).call.then.a @ alohaUrlService.js:2 Promise.then (async) _runURLNormalizers @ alohaUrlService.js:2 normalize @ alohaUrlService.js:2 f @ alohaUrlService.js:2 async function (async) f @ alohaUrlService.js:2 a.getURLMappedPageRef @ alohaUrlService.js:2 doDefault @ action.js:7 (anonymous) @ action.js:5 b @ aura_prod.js:779 doAction @ action.js:6 triggerOrRejectAction @ action.js:4 press @ action.js:2 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 triggerAction @ actionsDropDown.js:4 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 fireSelectEvent @ menuItem.js:4 select @ menuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 onClick @ actionMenuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:363 z.bb @ aura_prod.js:783 Ci @ aura_prod.js:363 $G.Po @ aura_prod.js:850 WA.zk @ aura_prod.js:241 (anonymous) @ aura_prod.js:240 Yn @ aura_prod.js:363 b @ aura_prod.js:779 11:02:15.626 aura_prod.js:2 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 G @ aura_prod.js:2 addEventListener @ aura_prod.js:2 connectedCallback @ lightning-spinner.js:2 we @ aura_prod.js:2 st @ aura_prod.js:2 yt @ aura_prod.js:2 insert @ aura_prod.js:2 y.children @ aura_prod.js:2 kt @ aura_prod.js:2 ht @ aura_prod.js:2 ut @ aura_prod.js:2 Wt.call.r.(anonymous function) @ aura_prod.js:2 At @ aura_prod.js:2 replaceChild @ aura_prod.js:2 OC @ aura_prod.js:398 P.eb @ aura_prod.js:399 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:359 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 E.qe @ aura_prod.js:309 afterRender @ alohaPage.js:5 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 W.Nd @ aura_prod.js:644 W.Bp @ aura_prod.js:656 UE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 11:02:15.655 aura_prod.js:2 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 G @ aura_prod.js:2 addEventListener @ aura_prod.js:2 connectedCallback @ lightning-spinner.js:2 we @ aura_prod.js:2 st @ aura_prod.js:2 yt @ aura_prod.js:2 insert @ aura_prod.js:2 y.children @ aura_prod.js:2 kt @ aura_prod.js:2 ht @ aura_prod.js:2 ut @ aura_prod.js:2 Wt.call.r.(anonymous function) @ aura_prod.js:2 At @ aura_prod.js:2 replaceChild @ aura_prod.js:2 OC @ aura_prod.js:398 P.eb @ aura_prod.js:399 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:359 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 E.qe @ aura_prod.js:309 afterRender @ alohaPage.js:5 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 W.Nd @ aura_prod.js:644 W.Bp @ aura_prod.js:656 UE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 11:02:15.999 one.app#eyJjb21wb25lbnREZWYiOiJvbmU6YWxvaGFQYWdlIiwiYXR0cmlidXRlcyI6eyJhZGRyZXNzIjoiL2Zsb3cvTmV3X0VtcGxveWVlP0NvbnRhY3RJZD0wMDMzNzAwMDAwaG5iVXAifSwic3RhdGUiOnsiaW5Db250ZXh0T2ZSZWYiOiIxLmV5SjBlWEJsSWpvaWMzUmhibVJoY21SZlgzSmxZMjl5WkZCaFoyVWlMQ0poZEhSeWFXSjFkR1Z6SWpwN0ltOWlhbVZqZEVGd2FVNWhiV1VpT2lKRGIyNTBZV04wSWl3aWNtVmpiM0prU1dRaU9pSXdNRE16TnpBd01EQXdhRzVpVlhCQlFVa2lMQ0poWTNScGIyNU9ZVzFsSWpvaWRtbGxkeUo5TENKemRHRjBaU0k2ZTMxOSJ9fQ%3D%3D:1 Invalid 'X-Frame-Options' header encountered when loading 'https://air--c.na31.visual.force.com/flow/runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=%5B%7B%27name%27%3A%27ContactId%27%2C%27type%27%3A%27String%27%2C%27value%27%3A%220033700000hnbUp%22%7D%5D&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F%2Fair.lightning.force.com&nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=': 'ALLOW-FROM https://air.lightning.force.com' is not a recognized directive. The header will be ignored. 11:02:16.509 lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 XHR finished loading: GET "https://air--c.na31.visual.force.com/flowruntime/flowLightningOut.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT". requestApp @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 use @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:140 use @ lightning.out.js?v=2:59 (anonymous) @ runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=[{'name'%3A'ContactId'%2C'type'%3A'String'%2C'value'%3A"0033700000hnbUp"}]&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F%2Fair.lightning.force.com&nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=:48 11:02:16.687 BeaconLibrary.js:15 {RECEIVED = 16 , Topic = AILTN: {…}} 11:02:16.688 aura_prod.js:579 XHR finished loading: POST "https://air.lightning.force.com/aura?r=156&ui-instrumentation-components-beacon.InstrumentationBeacon.sendData=1". z.send @ aura_prod.js:579 (anonymous) @ requestIdTransport.js:3 WA.zk @ aura_prod.js:241 z.un @ aura_prod.js:841 WA.zk @ aura_prod.js:241 WG.Fp @ aura_prod.js:833 WA.zk @ aura_prod.js:241 WA.start @ aura_prod.js:240 SE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 idleDetectedCallback @ BeaconLibrary.js:4 l @ idleDetector.js:4 setTimeout (async) (anonymous) @ idleDetector.js:3 setTimeout (async) checkIfLoaded @ idleDetector.js:3 markLoaded @ ThirdPartyTracker.js:4 frameInitialized.b.onload @ alohaPage.js:2 load (async) bootFrame @ alohaPage.js:2 beenRendered.getComputedAddress.then.a @ alohaPage.js:2 Promise.then (async) renderedCallback @ alohaPage.js:2 we @ aura_prod.js:2 xt @ aura_prod.js:2 ht @ aura_prod.js:2 ut @ aura_prod.js:2 Wt.call.r.(anonymous function) @ aura_prod.js:2 At @ aura_prod.js:2 replaceChild @ aura_prod.js:2 OC @ aura_prod.js:398 P.eb @ aura_prod.js:399 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:359 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 E.qe @ aura_prod.js:309 afterRender @ alohaPage.js:5 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 W.Nd @ aura_prod.js:644 W.Bp @ aura_prod.js:656 UE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 Promise.then (async) createContent @ pageHost.js:11 changePage @ pageHost.js:9 onPageChange @ pageHost.js:3 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 E.set @ aura_prod.js:315 (anonymous) @ singlePaneWindowManager.js:13 b @ aura_prod.js:779 (anonymous) @ singlePaneWindowManager.js:20 V.Db @ aura_prod.js:639 hF @ aura_prod.js:637 V.Dg @ aura_prod.js:612 createWrapper @ singlePaneWindowManager.js:20 addNewContent @ singlePaneWindowManager.js:13 contentSelected @ singlePaneWindowManager.js:8 b @ aura_prod.js:779 (anonymous) @ standardLayoutContentSelector.js:2 Promise.then (async) selectContent @ standardLayoutContentSelector.js:2 selectContent @ standardLayoutContentSelector.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 processPage @ singlePaneWindowManager.js:7 processPage @ singlePaneWindowManager.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 commitPageChanges @ standardLayoutContainer.js:21 (anonymous) @ standardLayoutContainer.js:20 b @ aura_prod.js:779 Promise.then (async) processPage @ standardLayoutContainer.js:19 b @ aura_prod.js:779 Promise.then (async) chainPromises @ Helpers.js:5 changePage @ standardLayoutContainer.js:15 handlePageReferenceTransaction @ standardLayoutContainer.js:10 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 E.set @ aura_prod.js:315 handlePageReferenceTransaction @ appLayoutHost.js:4 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 c @ aura_prod.js:253 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 E.set @ aura_prod.js:315 resolvePageChangeReference @ one.js:29 b @ aura_prod.js:779 Promise.then (async) chainPromises @ Helpers.js:5 onNavigateToState @ one.js:24 (anonymous) @ one.js:13 b @ aura_prod.js:779 d.then.c @ navigationService.js:2 Promise.then (async) navigateTo @ navigationService.js:2 (anonymous) @ appLayoutHost.js:39 b @ aura_prod.js:779 d.then.c @ navigationService.js:2 Promise.then (async) navigateTo @ navigationService.js:2 (anonymous) @ action.js:7 b @ aura_prod.js:779 f.then.then.a @ alohaUrlService.js:2 Promise.then (async) a.getURLMappedPageRef @ alohaUrlService.js:2 doDefault @ action.js:7 (anonymous) @ action.js:5 b @ aura_prod.js:779 doAction @ action.js:6 triggerOrRejectAction @ action.js:4 press @ action.js:2 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 triggerAction @ actionsDropDown.js:4 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 fireSelectEvent @ menuItem.js:4 select @ menuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 onClick @ actionMenuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:363 z.bb @ aura_prod.js:783 Ci @ aura_prod.js:363 $G.Po @ aura_prod.js:850 WA.zk @ aura_prod.js:241 (anonymous) @ aura_prod.js:240 Yn @ aura_prod.js:363 b @ aura_prod.js:779 11:02:17.106 aura_proddebug.js:27821 XHR finished loading: POST "https://air--c.na31.visual.force.com/aura?r=0&ui-interaction-runtime-components-controllers.FlowRuntime.runInterview=1". AuraClientService.send @ aura_proddebug.js:27821 sendOverride @ requestIdTransport.js:29 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 QueuedActionsMetricsPlugin.$actionSendOverride$ @ aura_proddebug.js:36306 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$sendOverride$ @ aura_proddebug.js:36139 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 AuraClientService.$sendActionXHRs$ @ aura_proddebug.js:27586 AuraClientService.$finishCollection$ @ aura_proddebug.js:27523 AuraClientService.$runClientActions$ @ aura_proddebug.js:27491 AuraClientService.$continueProcessing$ @ aura_proddebug.js:27282 AuraClientService.$process$ @ aura_proddebug.js:27242 AuraClientService.$postProcess$ @ aura_proddebug.js:27230 AuraClientService.$popStack$ @ aura_proddebug.js:27224 AuraInstance.$run$ @ aura_proddebug.js:34714 (anonymous) @ aura_proddebug.js:34280 Promise.then (async) initializeApp @ aura_proddebug.js:34279 Promise.then (async) (anonymous) @ aura_proddebug.js:34309 (anonymous) @ aura_proddebug.js:14297 (anonymous) @ aura_proddebug.js:23090 GlobalValueProviders.$loadFromStorage$ @ aura_proddebug.js:23219 GlobalValueProviders @ aura_proddebug.js:23087 Aura.$Context$.$AuraContext$.$initGlobalValueProviders$ @ aura_proddebug.js:14318 AuraContext @ aura_proddebug.js:14269 AuraInstance.$initAsync$ @ aura_proddebug.js:34274 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:159 setTimeout (async) (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:158 load (async) addScripts @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:42 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:152 xhr.onreadystatechange @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:112 XMLHttpRequest.send (async) requestApp @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 use @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:140 use @ lightning.out.js?v=2:59 (anonymous) @ runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=[{'name'%3A'ContactId'%2C'type'%3A'String'%2C'value'%3A"0033700000hnbUp"}]&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F%2Fair.lightning.force.com&nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=:48 11:02:17.448 BeaconLibrary.js:256 {RECEIVED = 3 , Topic = AILTN: {…}} 11:02:17.454 aura_proddebug.js:27821 XHR finished loading: POST "https://air--c.na31.visual.force.com/aura?r=1&ui-instrumentation-components-beacon.InstrumentationBeacon.sendData=1". AuraClientService.send @ aura_proddebug.js:27821 sendOverride @ requestIdTransport.js:29 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 QueuedActionsMetricsPlugin.$actionSendOverride$ @ aura_proddebug.js:36306 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$sendOverride$ @ aura_proddebug.js:36139 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 AuraClientService.$sendAsSingle$ @ aura_proddebug.js:27628 AuraClientService.$sendActionXHRs$ @ aura_proddebug.js:27602 AuraClientService.$finishCollection$ @ aura_proddebug.js:27523 AuraClientService.$runClientActions$ @ aura_proddebug.js:27491 AuraClientService.$continueProcessing$ @ aura_proddebug.js:27282 AuraClientService.$process$ @ aura_proddebug.js:27242 AuraClientService.$postProcess$ @ aura_proddebug.js:27230 AuraClientService.$popStack$ @ aura_proddebug.js:27224 callbackWrapper @ aura_proddebug.js:34590 idleDetectedCallback @ BeaconLibrary.js:36 doubleCheck @ idleDetector.js:48 setTimeout (async) doubleCheckMacrotask @ idleDetector.js:31 setTimeout (async) checkIfLoaded @ idleDetector.js:30 onXHRReceived @ idleDetector.js:11 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$receiveOverride$ @ aura_proddebug.js:36172 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 onReady @ aura_proddebug.js:27800 XMLHttpRequest.send (async) AuraClientService.send @ aura_proddebug.js:27821 sendOverride @ requestIdTransport.js:29 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 QueuedActionsMetricsPlugin.$actionSendOverride$ @ aura_proddebug.js:36306 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$sendOverride$ @ aura_proddebug.js:36139 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 AuraClientService.$sendActionXHRs$ @ aura_proddebug.js:27586 AuraClientService.$finishCollection$ @ aura_proddebug.js:27523 AuraClientService.$runClientActions$ @ aura_proddebug.js:27491 AuraClientService.$continueProcessing$ @ aura_proddebug.js:27282 AuraClientService.$process$ @ aura_proddebug.js:27242 AuraClientService.$postProcess$ @ aura_proddebug.js:27230 AuraClientService.$popStack$ @ aura_proddebug.js:27224 AuraInstance.$run$ @ aura_proddebug.js:34714 (anonymous) @ aura_proddebug.js:34280 Promise.then (async) initializeApp @ aura_proddebug.js:34279 Promise.then (async) (anonymous) @ aura_proddebug.js:34309 (anonymous) @ aura_proddebug.js:14297 (anonymous) @ aura_proddebug.js:23090 GlobalValueProviders.$loadFromStorage$ @ aura_proddebug.js:23219 GlobalValueProviders @ aura_proddebug.js:23087 Aura.$Context$.$AuraContext$.$initGlobalValueProviders$ @ aura_proddebug.js:14318 AuraContext @ aura_proddebug.js:14269 AuraInstance.$initAsync$ @ aura_proddebug.js:34274 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:159 setTimeout (async) (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:158 load (async) addScripts @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:42 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:152 xhr.onreadystatechange @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:112 XMLHttpRequest.send (async) requestApp @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 use @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:140 use @ lightning.out.js?v=2:59 (anonymous) @ runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=[{'name'%3A'ContactId'%2C'type'%3A'String'%2C'value'%3A"0033700000hnbUp"}]&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F%2Fair.lightning.force.com&nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=:48 11:02:18.611 navigationButtonFSC.js:33 running navigation for lightning desktop 11:02:18.611 navigationButtonFSC.js:36 destination type: url 11:02:18.611 navigationButtonFSC.js:37 URL: www.salesforce.com

Stack Trace:

handleClick (navigationButtonFSC.js:39) Action.$runDeprecated$ (aura_proddebug.js:24353) Component$getActionCaller (aura_proddebug.js:20261) Aura.$Event$.$Event$.$executeHandlerIterator$ (aura_proddebug.js:23857) Aura.$Event$.$Event$.$executeHandlers$ (aura_proddebug.js:23831) (anonymous) (aura_proddebug.js:23890) AuraInstance.$run$ (aura_proddebug.js:34706) Aura.$Event$.$Event$.$fire$ (aura_proddebug.js:23888) catchAndFireEvent (button.js:103) press (button.js:35) Action.$runDeprecated$ (aura_proddebug.js:24353) (anonymous) (aura_proddebug.js:21046) AuraInstance.$run$ (aura_proddebug.js:34706) $dispatchAction$ (aura_proddebug.js:21045) DomHandlersPlugin.$instrumentCallback$ (aura_proddebug.js:36552) Aura.$Utils$.$Override$.$continuation$ (aura_proddebug.js:17175) bound (aura_proddebug.js:17112) $domEventHandler$ (aura_proddebug.js:21041) callbackWrapper (aura_proddebug.js:34556)

The observed behavior was: -button clicked and appeared depressed and returned to indicate activation -no further visible action observed related to page changes or navigation, new tabs etc.

I have no idea why the code isn't working in lightning, but I've gotten basic support for classic working.

Also, for the life of me I can't figure out how to add a CSRF confirmation token to a lightning component without using visualforce/apex. Is there any documentation on this or suggested equivalent of URLFOR? The limited information I found was for recordid using navigateToSObject which doesn't really apply to visualforce pages or for apex Javascript for which I don't see a lightning component/app equivalent: https://help.salesforce.com/articleView?id=000268864&language=en_US&type=1

For example, when using Docusign for salesforce version 7 and trying to pass a link to create an envelope with parameters per info here: https://support.docusign.com/en/articles/DocuSign-for-Salesforce-7-0-This-page-requires-a-CSRF-confirmation-token I get the message "The link you followed isn’t valid. This page requires a CSRF confirmation token. Report this error to your Salesforce administrator. " Ideally I would be able to avoid this when launching a flow from a button (even if it only works in lightning it would be an improvement). My thought is if we fix the navigatetourl it may work in that instance but I have no way to test that yet.

alexed1 commented 6 years ago

I'm still worried that even though you're using lightning buttons, you're executing in the lesser lightning environment that doesn't provide the full lightning experience and thus doesn't use force events. Lots of environments that seem to be Lightning, such as running flows from the Setup Flows page, don't actually get to use force events.

If you're comfortable sharing credentials with me at aedelstein@salesforce.com, I'll take a look.

On Tue, Jun 19, 2018 at 8:15 AM datapharmer notifications@github.com wrote:

@alexed1 https://github.com/alexed1 Ok, so here are my finding:

-It just doesn't seem to work in lightning. I modified the code as follows and embedded it in a lightning button to test. Here is my modified code for debugging:

(function() { const {$A} = window;

return { "meta":{ "name":"c$navigationButtonFSC", "extends":"markup://aura:component" }, "controller":{ "handleClick":function(component, event, helper) { var destUrl = component.get("v.destinationURL"); var urlEvent = $A.get("e.force:navigateToURL"); var navigationGoal = component.get("v.navigationType");

    var destType = component.get("v.destinationType");
    if (destType == 'url') {
       urlEvent.setParams({
           "url": destUrl
       });        
    }
    if (destType == 'record') {
        console.log('in record');
        var destObject = component.get("v.targetRecordId");
        console.log('recordId is:' +destObject)
        urlEvent = $A.get("e.force:navigateToSObject");
        urlEvent.setParams({
          "recordId": destObject,
          "slideDevName": "related"
        });
    }
    if( (typeof sforce != 'undefined') && (sforce.one != null) ) {

                  console.log("running navigation for lightning desktop");
    }
    else {console.log("running lightning classic")}
    console.log("destination type: "+destType);
    console.log("URL: "+destUrl);
    urlEvent.fire();
    debugger;
    var navigate = component.get('v.navigateFlow');

    if (navigationGoal == 'finish') {
      navigate("FINISH");
    }

  if (navigationGoal == 'next') {
      navigate("NEXT");
    }
    if (navigationGoal == 'back') {
        navigate("BACK");
    }
}

}, "helper":{ "helperMethod":function() {

}

} };

}())

The console output was as follows:

11:02:15.560 aura_prod.js:579 XHR finished loading: POST " https://air.lightning.force.com/aura?r=155&aura.NavEventManager.getResolvedIntegrationUrl=1 ". z.send @ aura_prod.js:579 (anonymous) @ requestIdTransport.js:3 WA.zk @ aura_prod.js:241 z.un @ aura_prod.js:841 WA.zk @ aura_prod.js:241 WG.Fp @ aura_prod.js:833 WA.zk @ aura_prod.js:241 WA.start @ aura_prod.js:240 SE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 z.bb @ aura_prod.js:783 (anonymous) @ aura_prod.js:756 executeGlobalController @ aura_prod.js:756 Promise @ alohaUrlService.js:2 p @ alohaUrlService.js:2 _runURLNormalizers @ alohaUrlService.js:2 b.length.b.(anonymous function).call.then.a @ alohaUrlService.js:2 Promise.then (async) _runURLNormalizers @ alohaUrlService.js:2 normalize @ alohaUrlService.js:2 f @ alohaUrlService.js:2 async function (async) f @ alohaUrlService.js:2 a.getURLMappedPageRef @ alohaUrlService.js:2 doDefault @ action.js:7 (anonymous) @ action.js:5 b @ aura_prod.js:779 doAction @ action.js:6 triggerOrRejectAction @ action.js:4 press @ action.js:2 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 triggerAction @ actionsDropDown.js:4 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 fireSelectEvent @ menuItem.js:4 select @ menuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 onClick @ actionMenuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:363 z.bb @ aura_prod.js:783 Ci @ aura_prod.js:363 $G.Po @ aura_prod.js:850 WA.zk @ aura_prod.js:241 (anonymous) @ aura_prod.js:240 Yn @ aura_prod.js:363 b @ aura_prod.js:779 11:02:15.626 aura_prod.js:2 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 G @ aura_prod.js:2 addEventListener @ aura_prod.js:2 connectedCallback @ lightning-spinner.js:2 we @ aura_prod.js:2 st @ aura_prod.js:2 yt @ aura_prod.js:2 insert @ aura_prod.js:2 y.children @ aura_prod.js:2 kt @ aura_prod.js:2 ht @ aura_prod.js:2 ut @ aura_prod.js:2 Wt.call.r.(anonymous function) @ aura_prod.js:2 At @ aura_prod.js:2 replaceChild @ aura_prod.js:2 OC @ aura_prod.js:398 P.eb @ aura_prod.js:399 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:359 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 E.qe @ aura_prod.js:309 afterRender @ alohaPage.js:5 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 W.Nd @ aura_prod.js:644 W.Bp @ aura_prod.js:656 UE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 11:02:15.655 aura_prod.js:2 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 G @ aura_prod.js:2 addEventListener @ aura_prod.js:2 connectedCallback @ lightning-spinner.js:2 we @ aura_prod.js:2 st @ aura_prod.js:2 yt @ aura_prod.js:2 insert @ aura_prod.js:2 y.children @ aura_prod.js:2 kt @ aura_prod.js:2 ht @ aura_prod.js:2 ut @ aura_prod.js:2 Wt.call.r.(anonymous function) @ aura_prod.js:2 At @ aura_prod.js:2 replaceChild @ aura_prod.js:2 OC @ aura_prod.js:398 P.eb @ aura_prod.js:399 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:359 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 E.qe @ aura_prod.js:309 afterRender @ alohaPage.js:5 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 W.Nd @ aura_prod.js:644 W.Bp @ aura_prod.js:656 UE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 11:02:15.999 one.app#eyJjb21wb25lbnREZWYiOiJvbmU6YWxvaGFQYWdlIiwiYXR0cmlidXRlcyI6eyJhZGRyZXNzIjoiL2Zsb3cvTmV3X0VtcGxveWVlP0NvbnRhY3RJZD0wMDMzNzAwMDAwaG5iVXAifSwic3RhdGUiOnsiaW5Db250ZXh0T2ZSZWYiOiIxLmV5SjBlWEJsSWpvaWMzUmhibVJoY21SZlgzSmxZMjl5WkZCaFoyVWlMQ0poZEhSeWFXSjFkR1Z6SWpwN0ltOWlhbVZqZEVGd2FVNWhiV1VpT2lKRGIyNTBZV04wSWl3aWNtVmpiM0prU1dRaU9pSXdNRE16TnpBd01EQXdhRzVpVlhCQlFVa2lMQ0poWTNScGIyNU9ZVzFsSWpvaWRtbGxkeUo5TENKemRHRjBaU0k2ZTMxOSJ9fQ%3D%3D:1 Invalid 'X-Frame-Options' header encountered when loading ' https://air--c.na31.visual.force.com/flow/runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=%5B%7B%27name%27%3A%27ContactId%27%2C%27type%27%3A%27String%27%2C%27value%27%3A%220033700000hnbUp%22%7D%5D&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F%2Fair.lightning.force.com&nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=': 'ALLOW-FROM https://air.lightning.force.com' is not a recognized directive. The header will be ignored. 11:02:16.509 lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 XHR finished loading: GET " https://air--c.na31.visual.force.com/flowruntime/flowLightningOut.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT ". requestApp @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 use @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:140 use @ lightning.out.js?v=2:59 (anonymous) @ runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=[{'name'%3A'ContactId'%2C'type'%3A'String'%2C'value'%3A"0033700000hnbUp"}]&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F% 2Fair.lightning.force.com &nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=:48 11:02:16.687 BeaconLibrary.js:15 {RECEIVED = 16 , Topic = AILTN: {…}} 11:02:16.688 aura_prod.js:579 XHR finished loading: POST " https://air.lightning.force.com/aura?r=156&ui-instrumentation-components-beacon.InstrumentationBeacon.sendData=1 ". z.send @ aura_prod.js:579 (anonymous) @ requestIdTransport.js:3 WA.zk @ aura_prod.js:241 z.un @ aura_prod.js:841 WA.zk @ aura_prod.js:241 WG.Fp @ aura_prod.js:833 WA.zk @ aura_prod.js:241 WA.start @ aura_prod.js:240 SE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 idleDetectedCallback @ BeaconLibrary.js:4 l @ idleDetector.js:4 setTimeout (async) (anonymous) @ idleDetector.js:3 setTimeout (async) checkIfLoaded @ idleDetector.js:3 markLoaded @ ThirdPartyTracker.js:4 frameInitialized.b.onload @ alohaPage.js:2 load (async) bootFrame @ alohaPage.js:2 beenRendered.getComputedAddress.then.a @ alohaPage.js:2 Promise.then (async) renderedCallback @ alohaPage.js:2 we @ aura_prod.js:2 xt @ aura_prod.js:2 ht @ aura_prod.js:2 ut @ aura_prod.js:2 Wt.call.r.(anonymous function) @ aura_prod.js:2 At @ aura_prod.js:2 replaceChild @ aura_prod.js:2 OC @ aura_prod.js:398 P.eb @ aura_prod.js:399 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:359 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 afterRender @ aura_prod.js:347 E.eb @ aura_prod.js:325 E.qe @ aura_prod.js:309 afterRender @ alohaPage.js:5 E.eb @ aura_prod.js:325 W.eb @ aura_prod.js:644 W.Nd @ aura_prod.js:644 W.Bp @ aura_prod.js:656 UE @ aura_prod.js:575 NE @ aura_prod.js:574 KE @ aura_prod.js:566 JE @ aura_prod.js:565 z.Nc @ aura_prod.js:565 IE @ aura_prod.js:565 b @ aura_prod.js:779 Promise.then (async) createContent @ pageHost.js:11 changePage @ pageHost.js:9 onPageChange @ pageHost.js:3 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 E.set @ aura_prod.js:315 (anonymous) @ singlePaneWindowManager.js:13 b @ aura_prod.js:779 (anonymous) @ singlePaneWindowManager.js:20 V.Db @ aura_prod.js:639 hF @ aura_prod.js:637 V.Dg @ aura_prod.js:612 createWrapper @ singlePaneWindowManager.js:20 addNewContent @ singlePaneWindowManager.js:13 contentSelected @ singlePaneWindowManager.js:8 b @ aura_prod.js:779 (anonymous) @ standardLayoutContentSelector.js:2 Promise.then (async) selectContent @ standardLayoutContentSelector.js:2 selectContent @ standardLayoutContentSelector.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 processPage @ singlePaneWindowManager.js:7 processPage @ singlePaneWindowManager.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 commitPageChanges @ standardLayoutContainer.js:21 (anonymous) @ standardLayoutContainer.js:20 b @ aura_prod.js:779 Promise.then (async) processPage @ standardLayoutContainer.js:19 b @ aura_prod.js:779 Promise.then (async) chainPromises @ Helpers.js:5 changePage @ standardLayoutContainer.js:15 handlePageReferenceTransaction @ standardLayoutContainer.js:10 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 E.set @ aura_prod.js:315 handlePageReferenceTransaction @ appLayoutHost.js:4 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 c @ aura_prod.js:253 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 E.Zc @ aura_prod.js:317 E.set @ aura_prod.js:315 resolvePageChangeReference @ one.js:29 b @ aura_prod.js:779 Promise.then (async) chainPromises @ Helpers.js:5 onNavigateToState @ one.js:24 (anonymous) @ one.js:13 b @ aura_prod.js:779 d.then.c @ navigationService.js:2 Promise.then (async) navigateTo @ navigationService.js:2 (anonymous) @ appLayoutHost.js:39 b @ aura_prod.js:779 d.then.c @ navigationService.js:2 Promise.then (async) navigateTo @ navigationService.js:2 (anonymous) @ action.js:7 b @ aura_prod.js:779 f.then.then.a @ alohaUrlService.js:2 Promise.then (async) a.getURLMappedPageRef @ alohaUrlService.js:2 doDefault @ action.js:7 (anonymous) @ action.js:5 b @ aura_prod.js:779 doAction @ action.js:6 triggerOrRejectAction @ action.js:4 press @ action.js:2 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 triggerAction @ actionsDropDown.js:4 H.Pc @ aura_prod.js:469 c @ aura_prod.js:337 sD @ aura_prod.js:453 (anonymous) @ aura_prod.js:454 z.bb @ aura_prod.js:783 N.V @ aura_prod.js:454 fireSelectEvent @ menuItem.js:4 select @ menuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:337 onClick @ actionMenuItem.js:2 H.Pc @ aura_prod.js:469 (anonymous) @ aura_prod.js:363 z.bb @ aura_prod.js:783 Ci @ aura_prod.js:363 $G.Po @ aura_prod.js:850 WA.zk @ aura_prod.js:241 (anonymous) @ aura_prod.js:240 Yn @ aura_prod.js:363 b @ aura_prod.js:779 11:02:17.106 aura_proddebug.js:27821 XHR finished loading: POST " https://air--c.na31.visual.force.com/aura?r=0&ui-interaction-runtime-components-controllers.FlowRuntime.runInterview=1 ". AuraClientService.send @ aura_proddebug.js:27821 sendOverride @ requestIdTransport.js:29 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 QueuedActionsMetricsPlugin.$actionSendOverride$ @ aura_proddebug.js:36306 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$sendOverride$ @ aura_proddebug.js:36139 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 AuraClientService.$sendActionXHRs$ @ aura_proddebug.js:27586 AuraClientService.$finishCollection$ @ aura_proddebug.js:27523 AuraClientService.$runClientActions$ @ aura_proddebug.js:27491 AuraClientService.$continueProcessing$ @ aura_proddebug.js:27282 AuraClientService.$process$ @ aura_proddebug.js:27242 AuraClientService.$postProcess$ @ aura_proddebug.js:27230 AuraClientService.$popStack$ @ aura_proddebug.js:27224 AuraInstance.$run$ @ aura_proddebug.js:34714 (anonymous) @ aura_proddebug.js:34280 Promise.then (async) initializeApp @ aura_proddebug.js:34279 Promise.then (async) (anonymous) @ aura_proddebug.js:34309 (anonymous) @ aura_proddebug.js:14297 (anonymous) @ aura_proddebug.js:23090 GlobalValueProviders.$loadFromStorage$ @ aura_proddebug.js:23219 GlobalValueProviders @ aura_proddebug.js:23087 Aura.$Context$.$AuraContext$.$initGlobalValueProviders$ @ aura_proddebug.js:14318 AuraContext @ aura_proddebug.js:14269 AuraInstance.$initAsync$ @ aura_proddebug.js:34274 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:159 setTimeout (async) (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:158 load (async) addScripts @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:42 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:152 xhr.onreadystatechange @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:112 XMLHttpRequest.send (async) requestApp @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 use @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:140 use @ lightning.out.js?v=2:59 (anonymous) @ runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=[{'name'%3A'ContactId'%2C'type'%3A'String'%2C'value'%3A"0033700000hnbUp"}]&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F% 2Fair.lightning.force.com &nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=:48 11:02:17.448 BeaconLibrary.js:256 {RECEIVED = 3 , Topic = AILTN: {…}} 11:02:17.454 aura_proddebug.js:27821 XHR finished loading: POST " https://air--c.na31.visual.force.com/aura?r=1&ui-instrumentation-components-beacon.InstrumentationBeacon.sendData=1 ". AuraClientService.send @ aura_proddebug.js:27821 sendOverride @ requestIdTransport.js:29 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 QueuedActionsMetricsPlugin.$actionSendOverride$ @ aura_proddebug.js:36306 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$sendOverride$ @ aura_proddebug.js:36139 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 AuraClientService.$sendAsSingle$ @ aura_proddebug.js:27628 AuraClientService.$sendActionXHRs$ @ aura_proddebug.js:27602 AuraClientService.$finishCollection$ @ aura_proddebug.js:27523 AuraClientService.$runClientActions$ @ aura_proddebug.js:27491 AuraClientService.$continueProcessing$ @ aura_proddebug.js:27282 AuraClientService.$process$ @ aura_proddebug.js:27242 AuraClientService.$postProcess$ @ aura_proddebug.js:27230 AuraClientService.$popStack$ @ aura_proddebug.js:27224 callbackWrapper @ aura_proddebug.js:34590 idleDetectedCallback @ BeaconLibrary.js:36 doubleCheck @ idleDetector.js:48 setTimeout (async) doubleCheckMacrotask @ idleDetector.js:31 setTimeout (async) checkIfLoaded @ idleDetector.js:30 onXHRReceived @ idleDetector.js:11 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$receiveOverride$ @ aura_proddebug.js:36172 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 onReady @ aura_proddebug.js:27800 XMLHttpRequest.send (async) AuraClientService.send @ aura_proddebug.js:27821 sendOverride @ requestIdTransport.js:29 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 QueuedActionsMetricsPlugin.$actionSendOverride$ @ aura_proddebug.js:36306 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 TransportMetricsPlugin.$sendOverride$ @ aura_proddebug.js:36139 Aura.$Utils$.$Override$.$continuation$ @ aura_proddebug.js:17175 Aura.$Utils$.$Override$.start @ aura_proddebug.js:17153 AuraClientService.$sendActionXHRs$ @ aura_proddebug.js:27586 AuraClientService.$finishCollection$ @ aura_proddebug.js:27523 AuraClientService.$runClientActions$ @ aura_proddebug.js:27491 AuraClientService.$continueProcessing$ @ aura_proddebug.js:27282 AuraClientService.$process$ @ aura_proddebug.js:27242 AuraClientService.$postProcess$ @ aura_proddebug.js:27230 AuraClientService.$popStack$ @ aura_proddebug.js:27224 AuraInstance.$run$ @ aura_proddebug.js:34714 (anonymous) @ aura_proddebug.js:34280 Promise.then (async) initializeApp @ aura_proddebug.js:34279 Promise.then (async) (anonymous) @ aura_proddebug.js:34309 (anonymous) @ aura_proddebug.js:14297 (anonymous) @ aura_proddebug.js:23090 GlobalValueProviders.$loadFromStorage$ @ aura_proddebug.js:23219 GlobalValueProviders @ aura_proddebug.js:23087 Aura.$Context$.$AuraContext$.$initGlobalValueProviders$ @ aura_proddebug.js:14318 AuraContext @ aura_proddebug.js:14269 AuraInstance.$initAsync$ @ aura_proddebug.js:34274 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:159 setTimeout (async) (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:158 load (async) addScripts @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:42 (anonymous) @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:152 xhr.onreadystatechange @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:112 XMLHttpRequest.send (async) requestApp @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:126 use @ lightning.out.delegate.js?v=TXFMQFq0-RQOjOHaEO-bxg:140 use @ lightning.out.js?v=2:59 (anonymous) @ runtime.apexp?flowDevName=New_Employee&ltn_app_id=06m37000000MibnAAC&sfdcIFrameHost=web&arguments=[{'name'%3A'ContactId'%2C'type'%3A'String'%2C'value'%3A"0033700000hnbUp"}]&ContactId=0033700000hnbUp&isdtp=p1&clc=0&sfdcIFrameOrigin=https%3A%2F% 2Fair.lightning.force.com &nonce=7fc03d668bfbb455d33585857b87d2203796af1ac6853216f6a456c06f31360e&tour=:48 11:02:18.611 navigationButtonFSC.js:33 running navigation for lightning desktop 11:02:18.611 navigationButtonFSC.js:36 destination type: url 11:02:18.611 navigationButtonFSC.js:37 URL: www.salesforce.com

Stack Trace:

handleClick (navigationButtonFSC.js:39) Action.$runDeprecated$ (aura_proddebug.js:24353) Component$getActionCaller (aura_proddebug.js:20261) Aura.$Event$.$Event$.$executeHandlerIterator$ (aura_proddebug.js:23857) Aura.$Event$.$Event$.$executeHandlers$ (aura_proddebug.js:23831) (anonymous) (aura_proddebug.js:23890) AuraInstance.$run$ (aura_proddebug.js:34706) Aura.$Event$.$Event$.$fire$ (aura_proddebug.js:23888) catchAndFireEvent (button.js:103) press (button.js:35) Action.$runDeprecated$ (aura_proddebug.js:24353) (anonymous) (aura_proddebug.js:21046) AuraInstance.$run$ (aura_proddebug.js:34706) $dispatchAction$ (aura_proddebug.js:21045) DomHandlersPlugin.$instrumentCallback$ (aura_proddebug.js:36552) Aura.$Utils$.$Override$.$continuation$ (aura_proddebug.js:17175) bound (aura_proddebug.js:17112) $domEventHandler$ (aura_proddebug.js:21041) callbackWrapper (aura_proddebug.js:34556)

The observed behavior was: -button clicked and appeared depressed and returned to indicate activation -no further visible action observed related to page changes or navigation, new tabs etc.

I have no idea why the code isn't working in lightning, but I've gotten basic support for classic working.

Also, for the life of me I can't figure out how to add a CSRF confirmation token to a lightning component without using visualforce/apex. Is there any documentation on this or suggested equivalent of URLFOR? The limited information I found was for recordid using navigateToSObject which doesn't really apply to visualforce pages or for apex Javascript for which I don't see a lightning component/app equivalent: https://help.salesforce.com/articleView?id=000268864&language=en_US&type=1

For example, when using Docusign for salesforce version 7 and trying to pass a link to create an envelope with parameters per info here: https://support.docusign.com/en/articles/DocuSign-for-Salesforce-7-0-This-page-requires-a-CSRF-confirmation-token I get the message "The link you followed isn’t valid. This page requires a CSRF confirmation token. Report this error to your Salesforce administrator. " Ideally I would be able to avoid this when launching a flow from a button (even if it only works in lightning it would be an improvement). My thought is if we fix the navigatetourl it may work in that instance but I have no way to test that yet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/40#issuecomment-398436501, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_tEzhLiOgrRvVQeUEjmetZZKnWgDBTks5t-RWcgaJpZM4Uofm- .

-- Alex Edelstein Sr. Dir. Product Management - Lightning Flow and Einstein Next Best Action Salesforce.com

http://smart.salesforce.com/sig/aedelstein//us_mb/default/link.html

datapharmer commented 6 years ago

Hi Alex,

I just emailed over access to one of our developer sandboxes as well as some testing info. Let me know if you have any further questions.

dleland commented 6 years ago

Hello Alex and datapharmer - I'm a Salesforce Admin and "light" developer. I would really like to be able to use the navigateToURL and navigatetosObject local actions on my Flows but I'm experiencing the same as datapharmer - they just don't work. And, I've made double-sure that I'm only running them in the Lightning enviroment. I would really like to know if you come up with a fix for them. Thanks.

alexed1 commented 6 years ago

I'm looking at the org, Keith. The first thing I notice is that your button instance doesn't have a destination set in the attributes:

screen shot 2018-06-24 at 5 17 49 pm

I suspect that's just because you've been testing it.

When I configured it like this, the embedded flow (the non-button one) worked fine: image

Part of the problem is that the docs I wrote were confusing/wrong. You need to set the "Target Type"field to "record" if you're navigating to a record. I've updated the docs, although the video may still be out of date.

===== 2) Now, the reason the button didn't navigate when you launched the flow from your Test Button is that you created that button using the older Custom Button technology instead of the newer Quick Action technology. Custom Button causes the flow to get executed by the lesser Lightning runtime, where Force events don't work. I added a Quick Action button next to it and verified that the button navigation works well.

I've recorded a video explanation that talks about the different ways to launch flows and how the behavior varies: https://youtu.be/t1X0k9Le84o

dleland commented 6 years ago

Alex - I had the same problem as Keith - I was using the older Custom Button instead of the Quick Action and once I made the change to a Flow Action button, it worked perfectly.

ericrsmith35 commented 6 years ago

I still have the need to pass parameters. Any idea on where this is in the roadmap?

On Mon, Jun 25, 2018 at 10:03 PM dleland notifications@github.com wrote:

Alex - I had the same problem as Keith - I was using the older Custom Button instead of the Quick Action and once I made the change to a Flow Action button, it worked perfectly.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/40#issuecomment-400153055, or mute the thread https://github.com/notifications/unsubscribe-auth/AXlD378UIPYfiPdCLAdu0ezJI_kojudxks5uAZZTgaJpZM4Uofm- .