• ALL STAR
  • 20541 Points
  • Member since 

  • Chatter
    Feed
  • 621
    Best Answers
  • 0
    Likes Received
  • 12
    Likes Given
  • 0
    Questions
  • 2631
    Replies
I am trying to understand why I cannot query the 'Notes' object directly, but can only use it via the Account relationship.

Below query does not work.
select CreatedBy.Name from Notes.

But this query works
select Name, (select CreatedBy.Name from Notes) from Account
Hello,
I'm not able to connect my org with my salesforce credential. It was working fine until sometime back I was getting message to merge the account and something got messed up. I'm not able to verify my challenge. Please let me know how it can be resolved

Thanks.
Hi All. I have written a lightning component to search records based on input given.

Please let me know to how to search records based on picklist value selected like if new cases picklist value selected then cases with new status should be displayed, if closed cases picklistvalue selected then closed cases should be displayed. Please help. Thanks in advance.
 
Controller:

public class caseList1 {
	@AuraEnabled
    public static List<sObject> fetchData() {
        //Query and return list of Contacts
        List<SObject> objRecords = [SELECT Status, Subject from Case LIMIT 10];
        return objRecords;
    }
}
 
Lightning component:

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" 
                controller="caseList1">
    <!-- attributes -->
    <aura:attribute name="data" type="Map"/>
    <aura:attribute name="filteredData" type="Map"/>
    <aura:attribute name="columns" type="List"/>


    <!-- handlers-->
    <aura:handler name="init" value="{!this }" action="{!c.init }"/>

    	<span>
        	<lightning:input onchange="{!c.searchTable}" type="search" label="Searh" variant="label-hidden" placeholder="Enter search term" aura:id="SearchBox"/>
        </span>
    	<br/>
               
                <lightning:datatable
            columns="{!v.columns}"
            data="{!v.filteredData}"
            keyField="id"
        />
    
</aura:component>

js
({
    init: function (cmp, event, helper) {
        cmp.set('v.columns', [
            { label: 'Status', fieldName: 'Status', type: 'text' },
            { label: 'Subject', fieldName: 'Subject', type: 'text' }
        ]);
        var action = cmp.get("c.fetchData");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                cmp.set("v.data", response.getReturnValue());
                cmp.set("v.filteredData", response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    searchTable : function(cmp,event,helper) {
        var allRecords = cmp.get("v.data");
        var searchFilter = event.getSource().get("v.value").toUpperCase();
        
        var tempArray = [];
        var i;

        for(i=0; i < allRecords.length; i++){
            if((allRecords[i].Status && allRecords[i].Status.toUpperCase().indexOf(searchFilter) != -1) ||
               (allRecords[i].Subject && allRecords[i].Subject.toUpperCase().indexOf(searchFilter) != -1 ))
            {
                tempArray.push(allRecords[i]);
            }
        }
        cmp.set("v.filteredData",tempArray);
    }
})

controller
Hi There,

I'm having trouble getting CSS tags to work in a screen flow.  I've got the Flow itself to work (dispalying 3 fields from all Opportunities associated with an Account) but the formatting displays like this on the screen element, (i.e. it is not picking up the CSS tags):
 
<style>

table, th, td {

 border: 1px solid black;

}

</style>

<table>

<tr>

<th>Opp name</th>

<th>Stage</th>

<th>Type</th>

</tr>

<tr>

<td>Test Opp 2</td><td>Test Opp 2</td><td>Existing Customer - Upgrade</td>

</tr>

<tr>

<td>Test Opp 1</td><td>Test Opp 1</td><td>Existing Customer - Replacement</td>

</tr>

<tr>

<td>Dickenson Mobile Generators</td><td>Dickenson Mobile Generators</td><td>New Customer</td>

</tr>

</table>

Any help would be greatly appreciated.
User-added image
I tried authorizing the project using dev 
VF RAMEWORK ==>
<apex:page showheader="false" tabstyle="Opportunity" controller="Acnt_Rltd_CntctClass1">
<apex:sectionHeader title="RECORDS DISPLY" subtitle="ACCOUNTS DISPLAY"/>
<apex:form >
<apex:pageblock title="MAIN BLOCK">
<apex:PageBlockTable value="{!acclist}" var="a">
<apex:column headerValue="ACCOUNT NAME">
<apex:commandlink >
{!a.name}
</apex:commandlink>
</apex:column>
<apex:column headerValue="PHONE">
{!a.phone}
</apex:column>
<apex:column headerValue="RATING">
{!a.rating}
</apex:column>
</apex:PageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
VF CONTROLLER==>
public class Acnt_Rltd_CntctClass1 
{
    public List<Account> acclist{set;get;}
    public Acnt_Rltd_CntctClass1()
    {
      acclist = new List<Account>();
      acclist = [select name, phone, rating from account];
    }
}
Think my Google skills have failed today!

I'm trying to write a C# app to access the Rest API and I have the following SOQL, It gives me all accounts as expected.
 
SELECT id FROM Account

Now I want only live accounts, however, the following isn't working, am I missing something?
 
SELECT id FROM Account WHERE Status = 'Live'

Cheers for any assistance!

 
1. Query and display all the accounts in a tabular format on a visualforce page.
2. Display the columns name, phone, address.
3. The name should be a hyperlink and on click of the link display contacts and opportunity records
related to the account in different page block tables.
4. The page should be partially rendered and it should not reload. 

plz help me i am new for vf page
managed package expiration date missing why; I am looking for the expiration date of package, Salesforce Communities Management (for Communities with Chatter. I found it a free package, does this mean that it will never expire...I wanted to track if it is active in the organization too.. check the below mentioned article, but it did not help:

https://help.salesforce.com/articleView?id=distribution_package_detail.htm&type=5
Is there any way of displaying a picklist within an aura datatable?

I've read that only certain data types can be used within a datatable, but there must be a way of displaying a picklist or something similar where the user can select a value from a list of values?

Anybody managed to do this?
 
  • November 28, 2019
  • Like
  • 0
I am trying to create a custom URL button , through which i want to set field value.. is there any way to do it?
 
I am somehow new to developing and currently working on Apex Integration Services module in Trailhead am on the third unit (Apex SOAP Callouts). I happen to have issues in downloading and saving a WSDL file to my PC. When I click the provided link on Trailhead it redirects me to a webpage that has a code without any button to download and save the file in my PC. I will appreciate if I can get any assist to work around this.The page I get that does have dowloading instructions.
Hi,
my custom object has a lookup with USer object-- createdBY
i am trying to fetch the data from custom object as
createdby.name but the field is not fetching, please help with this.
Thanks
Someone can tell me why im getting this error? Its seems a good code for me.

public class AccountHandler {
    public static Account insertNewAccount (String Nome){
        try
        {
               Account acct = new Account();
            acct.Name = Nome;
            insert acct;
            return acct;
        } catch (DmlException e){
            System.debug('A DML exception has ocurred: '+ e.getMessage());
            return null;
        }
    }
}
In my Requirement, Parent Object  is  Contact and child Object is Hippa__c.  Here i need to get the Parent Id when ever i am creating a new records from Releated list of Contact. 
If any Know Plz help me....
Hi All,

I wrote to code to trigger to calculate the total opportunity amount on Account but the trigger is not working for After Insert event. It throwing the below error. 

"AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object:"

Here is my trigger:

trigger Opportunity_AIUD on Opportunity (after insert, after update, after delete) {
    Map<Id, List<Opportunity>> acctIdOpptyListMap = new Map<Id, List<Opportunity>>();
    Map<Id, Opportunity> OldList = new Map<Id, Opportunity>();
    Set<Id> acctIds = new Set<Id>();
    List<Opportunity> opptyList = new List<Opportunity>();
    if(trigger.isUpdate || trigger.isInsert){
        for(Opportunity oppty : trigger.New){
            if(oppty.AccountId != null){
                acctIds.add(oppty.AccountId);
            }
        }    
    }
    
    If(trigger.isafter){
    if(trigger.isDelete){
        for(Opportunity oppty : trigger.old){
            if(oppty.AccountId != null){
                acctIds.add(oppty.AccountId);
                system.debug('*******acctIds*******'+acctIds);
             
            }
        }    
    }
  }
    
   
        System.debug('*****acctIdOpptyListMap ***'+acctIdOpptyListMap);
        System.debug('*********acctIds.size()***'+acctIds.size());
  
        if (acctIds.Size()>0){
        opptyList = [SELECT ID,Amount,AccountId FROM Opportunity WHERE AccountId IN : acctIds];
        System.debug('*****opptyList'+opptyList);
        for(Opportunity oppty : opptyList){
            if(!acctIdOpptyListMap.containsKey(oppty.AccountId)){
                acctIdOpptyListMap.put(oppty.AccountId, new List<Opportunity>());
                System.debug('acctIdOpptyListMap1'+ acctIdOpptyListMap);
            }
            acctIdOpptyListMap.get(oppty.AccountId).add(oppty); 
            System.debug('acctIdOpptyListMap2'+ acctIdOpptyListMap);
        } 
        
        List<Account> acctList = new List<Account>();
        acctList = [SELECT Total_Opportunity_Amount__c FROM Account WHERE Id IN: acctIds];
        System.debug('*******acctList' + acctList);
        if (acctList.size()>0){
        for(Account acct : acctList){
            List<Opportunity> tempOpptyList = new List<Opportunity>();
            tempOpptyList = acctIdOpptyListMap.get(acct.Id);
            System.debug('******** tempOpptyList' +tempOpptyList);
            Double totalOpptyAmount = 0;
            for(Opportunity oppty : tempOpptyList){
                if(oppty.Amount != null){
                    totalOpptyAmount += oppty.Amount;
                    System.debug('********totalOpptyAmount' +totalOpptyAmount);
                }
            }
            acct.Total_Opportunity_Amount__c = totalOpptyAmount;
        }
      }
        if (acctList.size()>0){
        update acctList;
        }
    }

}

I will appreciate any help. Thanks.
Im learning the usefulness of LDS.but having a problem to understand the work of  targetRecord in recordData. can we use targetRecord attribute as {!V.targetRecord} ?
I read the documentations, but still not clear with it
I need guidance in creating an app, installing an app or something that allows for a scrolling news feed relating to the account.
User-added image
While clicking on button called Visualforce page.
Hi,

I am trying to solve a  trail challeng on Visualforce standard list controller (Visualforce standard list controller trail (https://trailhead.salesforce.com/content/learn/modules/visualforce_fundamentals/visualforce_standard_list_controllers)). I have written the following code for the same:
 
<apex:page standardController="Account" recordSetVar="accounts"> 
<apex:pageBlock> 
<apex:repeat value="{! accounts }" var="a"> 
 <li><apex:outputLink value="{! a.id}"></apex:outputLink> </li> 
</apex:repeat> 
</apex:pageBlock> 
</apex:page>


Here while checking, I am getting following error:
 
The page does not bind to the record ID value (in order to link to the record detail page)
Hi all,

I need to embed external webiste in vf page and also in lightning component using iframe. So do i need to disbale "Enable clickjack protection for non-Setup Salesforce pages"  cgeckbox  in salesforce.

Thanks in advance
I am currently doing business specialist super badge trailhead and I imported the rows using data import wizard .

when I click Check Challenge I am getting the following error

error screenshot

The package is already installed in TrailHead Playground1 but still I am facing an issue.

Anybody who has worked on this badge do please let me know how to complete challenge 1.

I have added "Residentail" and "Other" to the account Type picklist and activated it.

I have given 2 rows of the CSV file for understanding purpose.
Account NameTypeRatingBilling State/ProvinceAccount PhonewebsiteBilling CityBilling Zip/Postal CodeAnnual Revenue
Sam Heath Household  ResidentialHotNM1.23E+09https://twitter.com/trailheadOdessa9411445000
Imran Pope Household  OtherMedium CO3.46E+09https://twitter.com/salesforceDenver8020670000


 
Hey Guys,
Would someone assista newby and point me where can I find documentation on connecting SF schema (Objects and fields) from remote application?
Thanks a lot.
Hi All,
I'm getting the following error, can someone please help me
"An update to an account record failed to update the mailing address fields of all child contact records. Make sure that the process is correct and that it is activated."
User-added image
Thanks in Advance
Kasi

 
I am trying to understand why I cannot query the 'Notes' object directly, but can only use it via the Account relationship.

Below query does not work.
select CreatedBy.Name from Notes.

But this query works
select Name, (select CreatedBy.Name from Notes) from Account
I have names of few aura components for code review. Post making small fixes, i want to do functional testing. However, i can't determine where the aura component has been utilized ,as in, where a quick action/lightning page used etc..
Does salesforce provide 'Where is this used' kind of functionality for aura components? It's really a pain for a developer who is working on a new application/project. 
Calculate the no.of.working day,sick leave,?
can anybody suggest or idea to me?

I'm attempting to create a scratch org using CLI commands and I'm getting this error:

The request to create a scratch org failed with error code: C-1033.

Hello,
I'm not able to connect my org with my salesforce credential. It was working fine until sometime back I was getting message to merge the account and something got messed up. I'm not able to verify my challenge. Please let me know how it can be resolved

Thanks.
I've made some changes to the Campaign page layout, primarily adding some quick actions.  This all works fine when logged in as admin.  However, when login as standard user page doesn't have these actions.
Both profiles have the same layout assigned (there is only one) and there is only one record type.
I've been in to the object settings for both profiles and are identical.
I've tried creating a the page layout from scratch and assigning but that doesn't work.
Any ideas what I am missing?
error id: TNKLHHYW
cannot procced to completion
Hi All. I have written a lightning component to search records based on input given.

Please let me know to how to search records based on picklist value selected like if new cases picklist value selected then cases with new status should be displayed, if closed cases picklistvalue selected then closed cases should be displayed. Please help. Thanks in advance.
 
Controller:

public class caseList1 {
	@AuraEnabled
    public static List<sObject> fetchData() {
        //Query and return list of Contacts
        List<SObject> objRecords = [SELECT Status, Subject from Case LIMIT 10];
        return objRecords;
    }
}
 
Lightning component:

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" 
                controller="caseList1">
    <!-- attributes -->
    <aura:attribute name="data" type="Map"/>
    <aura:attribute name="filteredData" type="Map"/>
    <aura:attribute name="columns" type="List"/>


    <!-- handlers-->
    <aura:handler name="init" value="{!this }" action="{!c.init }"/>

    	<span>
        	<lightning:input onchange="{!c.searchTable}" type="search" label="Searh" variant="label-hidden" placeholder="Enter search term" aura:id="SearchBox"/>
        </span>
    	<br/>
               
                <lightning:datatable
            columns="{!v.columns}"
            data="{!v.filteredData}"
            keyField="id"
        />
    
</aura:component>

js
({
    init: function (cmp, event, helper) {
        cmp.set('v.columns', [
            { label: 'Status', fieldName: 'Status', type: 'text' },
            { label: 'Subject', fieldName: 'Subject', type: 'text' }
        ]);
        var action = cmp.get("c.fetchData");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                cmp.set("v.data", response.getReturnValue());
                cmp.set("v.filteredData", response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    searchTable : function(cmp,event,helper) {
        var allRecords = cmp.get("v.data");
        var searchFilter = event.getSource().get("v.value").toUpperCase();
        
        var tempArray = [];
        var i;

        for(i=0; i < allRecords.length; i++){
            if((allRecords[i].Status && allRecords[i].Status.toUpperCase().indexOf(searchFilter) != -1) ||
               (allRecords[i].Subject && allRecords[i].Subject.toUpperCase().indexOf(searchFilter) != -1 ))
            {
                tempArray.push(allRecords[i]);
            }
        }
        cmp.set("v.filteredData",tempArray);
    }
})

controller
Create a Hierarchical custom setting “TriggerSetting“. Create fields for all triggers developed in your system.This custom setting should be used to enable/disable any trigger from your org.
help me in this question.
thank you
Hi All,

We have a request to delete the record type in our organization. Is there any way to check the dependencies on record type and page layouts?

Any ideas or suggestions on this? Thanks!
Hi There,

I'm having trouble getting CSS tags to work in a screen flow.  I've got the Flow itself to work (dispalying 3 fields from all Opportunities associated with an Account) but the formatting displays like this on the screen element, (i.e. it is not picking up the CSS tags):
 
<style>

table, th, td {

 border: 1px solid black;

}

</style>

<table>

<tr>

<th>Opp name</th>

<th>Stage</th>

<th>Type</th>

</tr>

<tr>

<td>Test Opp 2</td><td>Test Opp 2</td><td>Existing Customer - Upgrade</td>

</tr>

<tr>

<td>Test Opp 1</td><td>Test Opp 1</td><td>Existing Customer - Replacement</td>

</tr>

<tr>

<td>Dickenson Mobile Generators</td><td>Dickenson Mobile Generators</td><td>New Customer</td>

</tr>

</table>

Any help would be greatly appreciated.
VF RAMEWORK ==>
<apex:page showheader="false" tabstyle="Opportunity" controller="Acnt_Rltd_CntctClass1">
<apex:sectionHeader title="RECORDS DISPLY" subtitle="ACCOUNTS DISPLAY"/>
<apex:form >
<apex:pageblock title="MAIN BLOCK">
<apex:PageBlockTable value="{!acclist}" var="a">
<apex:column headerValue="ACCOUNT NAME">
<apex:commandlink >
{!a.name}
</apex:commandlink>
</apex:column>
<apex:column headerValue="PHONE">
{!a.phone}
</apex:column>
<apex:column headerValue="RATING">
{!a.rating}
</apex:column>
</apex:PageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
VF CONTROLLER==>
public class Acnt_Rltd_CntctClass1 
{
    public List<Account> acclist{set;get;}
    public Acnt_Rltd_CntctClass1()
    {
      acclist = new List<Account>();
      acclist = [select name, phone, rating from account];
    }
}
I am not able to create scratch org in DevHub using the following command:
sfdx force:org:create -s -f config/project-scratch-def.json -a lwc-recipes
 
Getting error -
The request to create a scratch org failed with error code: C-1033.
Think my Google skills have failed today!

I'm trying to write a C# app to access the Rest API and I have the following SOQL, It gives me all accounts as expected.
 
SELECT id FROM Account

Now I want only live accounts, however, the following isn't working, am I missing something?
 
SELECT id FROM Account WHERE Status = 'Live'

Cheers for any assistance!

 
I am trying to write a batch apex to schedule and delete cases that were created before 18 months along with the related files. Can someone help me with formulating the query, please?
Hi, everyone.

I'm a Salesforce beginner and I need help with this code. I want to this "Don't show this again checkbox" makes the modal to stop showing up instead of the handler doInit. I thought that I could only change the function position on the component, but it doesn't work. Can any of you help me step by step to make this works, please? I appreciate your time and patience. Here is my code:

Component
<aura:component implements="flexipage:availableForAllPageTypes"
                access="global">
    
<!--<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>-->
<aura:attribute name="isModalOpen" type="boolean" default="false"/> 
    
	<div class="demo-only">
        <!--Use aura:if tag to display/hide popup based on isModalOpen value-->  
        <aura:if isTrue="{!v.isModalOpen}">
  <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal_small" aria-labelledby="welcome-mat-95-label" aria-describedby="welcome-mat-95-content" aria-modal="true">
    <div class="slds-modal__container">
      <header class="slds-modal__header slds-modal__header_empty">
        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{! c.closeModel }"
                                              alternativeText="close"
                                              variant="bare-inverse"
                                              class="slds-modal__close"/>
      </header>
      <div class="slds-modal__content" id="welcome-mat-95-content" style="overflow: hidden">
        <div class="slds-welcome-mat slds-welcome-mat_splash">
          <div class="slds-welcome-mat__content slds-grid">
            <div class="slds-welcome-mat__info slds-size_1-of-1">
              <div class="slds-welcome-mat__info-content">
                <h2 class="slds-welcome-mat__info-title" id="welcome-mat-95-label">The Lightning Experience is here!</h2>
                <div class="slds-welcome-mat__info-description slds-text-longform">
                  <p>Welcome to Lightning Experience, the modern, beautiful user experience from Salesforce. With a sales-and service-centric mindset, we focused on reinventing the desktop environment to better support your business processes.</p>
                </div>
                <div class="slds-welcome-mat__info-actions">
                  <button class="slds-button slds-button_brand">Learn More</button>
                 <div class="slds-m-top_large">
                    <div class="slds-form-element">
                      <div class="slds-form-element__control">
                        <div class="slds-checkbox">
                          <input type="checkbox" name="init" id="checkbox-8" onchange="{!c.doInit}" value="{!this}" />
                          <label class="slds-checkbox__label" for="checkbox-8">
                            <span class="slds-checkbox_faux"></span>
                            <span class="slds-form-element__label">Don&#x27;t show this again</span>
                          </label>
                        </div>
                      </div>
                    </div>
                  </div> 
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
            
  <div class="slds-backdrop slds-backdrop_open"></div>
     </aura:if>
</div>
</aura:component>

Controller
({
   doInit: function(component, event, helper) { 
 var temperorySession = sessionStorage.getItem('tempSession');
  if(temperorySession == '1')
        {  
      console.log('===== in If');
            component.set("v.isModalOpen", false);
  }
        else
        {
      console.log('===== in else');
      component.set("v.isModalOpen", true);
  }
   sessionStorage.setItem('tempSession', '1');
 },
  
   closeModel: function(component, event, helper) {
      // Set isModalOpen attribute to false  
      component.set("v.isModalOpen", false);
   },
})

Style
 
.THIS.pop-up {
    display: block;
    opacity: 1;
    visibility: visible;
    background-color: transparent;
}

.THIS .slds-modal__inner {
    background: yellow;
    padding: 20px;
    text-align:left;
}

.THIS .slds-modal__pinner {
    background: #fff;
    padding: 20px;
}

Best Regards,

Camila Camargo
Full Stack Developer
Hello All,

I am very new to Lightning development and salesforce in general.

I am trying to make a simple component that consists of tabs with a graph in each one. I have directly copied and pasted the example of a simple tabset from (https://developer.salesforce.com/docs/component-library/bundle/lightning:tabset/example

My issue is that the styling looks like it is entirely missing. Below is a picture of the result: 
User-added image

I have noticed that I am getting an error that may or may not be related to this but I have been unable to find anything about it other than to modify our CSP which doesn't sound right to me. paste of the  error below: 

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-[removed as im not sure if this is sensitive]' chrome-extension: 'unsafe-inline' 'unsafe-eval' https://sfdc.azureedge.net *.cs19.visual.force.com https://ssl.gstatic.com/accessibility/". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.

This error is repeated each time I click on an item in the tabset.

Has anyone had this issue or know what is possibly causing it? Any help would be greatly appreciated.

Thanks,
Travis
Hi, I'm trying to create a new empty project using the Salesforce CLI and I receive the message "ERROR running force:project:create  Cannot read property 'create' of undefined".    Does anyone know what might be causing this or how to further troubleshoot it? 

The command I'm entering in the terminal is "sfdx force:project:create --projectname VSCodeQuickStart".   I've tried "sfdx force:project:create --projectname VSCodeQuickStart --manifest" as well.


Thank you


 
We have a VisualForce page that needs to be displayed on our website through an iframe. The problem is that both Mozilla and Chrome are displaying error message, saying that the connection is not secured. 

"Your connection is not secure
The owner of xyz.force.com has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website."

I checked the configuration of our site in Salesforce. It looks like HTTPS is enabled. We have a self-signed certificate, but that's it. 

We're using Salesforce Classic and for the moment there's no project to use tools like Canvas or Lightning out...  
Any suggestions? 
Thanks.  

Good Morning folks,

I have a component to inset case, but is experiencing an error of  log:
 

"first error: INVALID_FIELD, Cannot specify both an external ID reference Account and a salesforce id, AccountId: []"


Basically this code :
 

Component.cmp

 <aura:attribute name="caseObj" type="case" default="{'sobjectType': 'Case',
                         'AccountId': '',
                         'MSISDN__c': '',
                         'Status': ''
                    }"/>



<label>Montadora</label>
       <force:inputField aura:id="AccountId"  value="{!v.caseObj.AccountId}"/>
           
</div>
<div class="form-group">
            <label>MSISDN</label>
            <ui:inputText class="form-control" value="{!v.caseObj.MSISDN__c}"/>
</div>  
    
    
    <div class="form-group">
            <label>Status</label>
            <force:inputField aura:id="Status"  value="{!v.caseObj.Status}"/>
</div>   


-----------------------------------------------------------

controller.js

  create: function(component, event, helper)    {
        
        console.log('Create record');
    
        var caseObj = component.get("v.caseObj");
        
        
        var action = component.get("c.createRecord");
      
        
        action.setParams({
            caseObj : caseObj
        });



-------------------------------------------------------------------

Class.apxc

 @AuraEnabled
    public static void createRecord (Case caseObj){
        
        try{
            System.debug('NovoCasoComponentController::createRecord::caseObj'+ caseObj);
            
            if(caseObj != null){
                insert caseObj;
            }
            
        } catch (Exception ex){
            
        }
        
    }    




Thanks

I'd like to get the Sites domain that configured for an org via Apex in order to automate some setup work.  I haven't found a way to do that.  It's probably not there but just in case I missed it in the documentation I figured I'd ask if anyone knows if there's any kind of metadata call to get it.

This is not specific to any one site and VF is not in place so anything that only exists in the context of an executing Site will not work.
I'm trying to create a button that will toggle a checkbox (i.e. if checked then uncheck, if unchecked then check). This checkbox will trigger a workflow rule that will send an email to the contact 24 hours later.

I realize that these buttons may become obsolete in Lightning, but my org does not wish to switch in the forseeable future (not my decision).

Any help is much appreaciated!
I am using google crome browser and performing inline editing on lightning datatable.

I am able to display the field values but when I edit Opportunity Name and click save its not saving.

Please let me know the issue.
 
public class DataTableController {

    @AuraEnabled
    public static List<Opportunity> getOpportunities()
    {
        List<Opportunity> oppList=new List<Opportunity>();
        
        oppList=[select Name,Account.Name,StageName,CloseDate,Amount from Opportunity
                 where Amount != NULL];
        
        return oppList;
    }
    
    @AuraEnabled
    public static void updateOpportunities(List<Opportunity> oppsList){
        try
        {
            Database.update(oppsList);
            
          }
        catch(Exception ex)
        {
            system.debug(ex.getMessage());
        }
    }
}

<aura:component implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes" 
                controller="DataTableController"
                access="global">
	
        <!-- Three important parts of datatable is Key , data and columns
         so we need attribute for data and columns(metatadata)-->
    <!-- attributes -->
    <aura:attribute name="data" 
                    type="Object"/>
    
    <aura:attribute name="columns" 
                    type="List"/>
    
<aura:attribute name="updatedRecord" type="Object[]" />

    <!-- handlers-->
    <aura:handler name="init" 
                  value="{!this}" 
                  action="{!c.doInit}"/>
    
    <lightning:card title="OpportunityDatatable">
        
        <lightning:datatable aura:id="opportunitydatatable"
                             keyField="id"
                             data="{!v.data}"
                             columns="{!v.columns}"
                             onsave="{!c.handleSaveOpps}"
                             hideCheckboxColumn="true"/>
        
</lightning:card>
    
    {!updatedRecord}

</aura:component>

({
	doInit : function(component, event, helper) {
        
        helper.queryColumns(component,event,helper);
        
        helper.queryContacts(component,event,helper);
  	},
    
    handleSaveOpps: function (component, event, helper) {
        debugger;    
        var draftValues = event.getParam('draftValues');
console.log(draftValues);
        var action = component.get('c.updateOpportunities');
        action.setParams({ 
            "oppsList": draftValues
        });
        action.setCallback(this, $A.getCallback(function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                helper.fireSuccessToast(component);  
                helper.fireRefreshEvt(component);
            } else if (state === "ERROR") {
                var errors = response.getError();
                console.error(errors);
                helper.fireFailureToast(component);  
            }
        }));
        $A.enqueueAction(action);
    }
     
})


({
	queryColumns : function(component,event,helper) {
        
		  component.set('v.columns', [
            {label: 'Opp Name', fieldName: 'Name', editable : 'true', type: 'text'},
            {label: 'Acc Name', fieldName: 'AccountName', type: 'text'},
            {label: 'StageName', fieldName: 'StageName', type: 'text'},
            {label: 'CloseDate', fieldName: 'CloseDate', type: 'date'},
            {label: 'Amount', fieldName: 'Amount', type: 'currency', cellAttributes: { alignment: 'left' }} 
        ]);
	},
    
    queryContacts : function(component,event,helper) {
        
        var action=component.get('c.getOpportunities');
        
        action.setParams({
        });
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                
                  //the following code will display the parent account name
                 var rows = response.getReturnValue();
                 for (var i = 0; i < rows.length; i++) {
                    var row = rows[i];
                    if (row.Account) row.AccountName = row.Account.Name;
                }
                //component.set("v.data", response.getReturnValue());
                 component.set("v.data", rows);
            }
        });
        $A.enqueueAction(action);
    },
    
     fireSuccessToast : function(component) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({ 
            'title' : 'Success', 
            'message' : 'Opportunities updated sucessfully.' ,
            'type':'success'
        }); 
        toastEvent.fire(); 
    },
    
    fireFailureToast : function(component) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({ 
            'title' : 'Failed', 
            'message' : 'An error occurred. Please contact your administrator.',
            'type':'error'
        }); 
        toastEvent.fire(); 
    },
    
    fireRefreshEvt : function(component) {
        var refreshEvent = $A.get("e.force:refreshView");
        if(refreshEvent){
            refreshEvent.fire();
        }
    }
       
})