• Daniel Glaser 5
  • NEWBIE
  • -1 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Here is what i am trying to do:
1. I setup the New button to call a lightning component using the lightning override. I left Skip record type selection page unchecked.
2. Under Service console i select the new button and the Record type selector appears. The lightning page is setup for a custom create page for one record type, for all others a perform a var urlEvent = $A.get("e.force:navigateToURL"); and set the URL to the account create URL with the record type.
3. For my selected record type the window has a save and cancel. The cancel i use:
            var workspaceAPI = component.find("CreateIDaccount");
            workspaceAPI.getFocusedTabInfo().then(function(response) {
                var focusedTabId = response.tabId;
                console.log('cancelDialog tab '+focusedTabId);
                workspaceAPI.closeTab({tabId: focusedTabId});
            })
This works perfectly in Service Console.
for save I use:
      var workspaceAPI = component.find("CreateIDaccount");
        workspaceAPI.openTab({
            url: '/lightning/r/Account/'+recId+'/view',
            focus: true
        }).then(function(response) {
            workspaceAPI.getTabInfo({
                tabId: response
            }).then(function(tabInfo) {
            console.log("The recordId for this tab is: " + tabInfo.recordId);
            });
And this opens a tab for the new account.

Now the problem,
This does not work for Sales. I had to determine what type of app i am using, either Console or Non-Console. Which I did.
I feel the code i created was a cobb job. The page has to be refreshed in order to have a return page, because if i cancelled the create the page would show a blank area under the account tab. For the recordtype i have the custom page with works fine because i can call the account list view. I have no control when the standard account returns.

3. The final issue, when the Custom Record type screen information is saved I have it return to the Account that was created. 
       var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "recordId": recId
        });
        navEvt.fire();

This works fine if you are creating a new account from the list view, but when you are trying to create a Contact and on the contact screen you select Create Account, it returns to the new account record. How can i get it to return to the Create Contact screen? 
I did try window.history.back(); but that doesn't work.

 Any suggestion? I can provide if anyone think they can help.
thank you,
I am writting APEX email to case handler. The current version is storing the email attachments into the Attachment Object. I want to use the new FILES object that summer 19 and winter 19 use, so the attachments show up in the Files related list. What is the object being used? If someone has test code to show how to fill in the fields of that object with the Case and email information.

Thank you
I am writting APEX email to case handler. The current version is storing the email attachments into the Attachment Object. I want to use the new FILES object that summer 19 and winter 19 use, so the attachments show up in the Files related list. What is the object being used? If someone has test code to show how to fill in the fields of that object with the Case and email information.

Thank you
I am doing the Handling Events with Client-Side controllers for the Lightning components study. I created the following:
the javascript modules : PhoneNumberInput and PhoneNumberOutput
The phone number input file contains
<aura:component >
    <aura:registerEvent name="PhoneNumEvent" type="c:PhoneNumEvent"/>
    <ui:inputPhone aura:id="phone" label="phone" />
    <ui:button label="Show Phone" press="{!c.postphone}" />
</aura:component>

The event fle PhoneNumberEvent.evt  - I believe that this is the file name I was supposed to use.
and the application file PhoneNumber.app  - Not sure what file name to use.
 
Everything runs fine, the problem is when I check the results I get the error:
Challenge not yet complete... here's what's wrong:
The 'PhoneNumberEvent' event is not of type 'APPLICATION'.