• ALL STAR
  • 12478 Points
  • Member since 

  • Chatter
    Feed
  • 360
    Best Answers
  • 0
    Likes Received
  • 11
    Likes Given
  • 0
    Questions
  • 1592
    Replies
Schedulbale Class:

User-added image

global class DeletAccount implements Schedulable
{
     
     global void execute(SchedulableContext ctx)
     {
         list<Account> acc=new list<Account>();
         for(Account acc1:[Select id,name from account where name like '%Demo%'])        
             acc.add(acc1);--------------->Error Line
             
   
         delete acc;      
     }
       
}

Test Class:

@isTest
public class Testclass {
 public static testmethod void test1()
 {
     Test.startTest();
           list<account> acc=new list<Account>(); 
        Account a1 = new Account();
          a1.name='Dummy account';
         acc.add(a1);    
         insert acc; 
        String CRON_EXP = '0 0 0 3 9 ? 2022';
        String jobId = System.schedule('test111', CRON_EXP, new DeletAccount());
         CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
          System.debug('ct'+ct);
        System.assertEquals(0, ct.TimesTriggered);
        System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime));
     Test.stopTest();  
 }
                
}
 
Can I Get number of api calls made in the last 24 hours via the API. This is to check if we are close to the limit before making bulk calls.

Please note this needs to be via the API I know how to access this via the UI but im looking to modify a windows service to check before making bulk calls. 
Hi Guys- can anyone help out on this, I want to schedule a batch so it runs thrice at 23:00, 1:40 & 4:00

String cronStr = '0 45 23,1,4 * * ?';

Hours I can specify comma seperated but minutes it's not taking, pls suggest
Hi all,

I want to invoke a lightning component from a list button.

Everything works fine except if I use "e.force:createRecord".

Here's the error message: 
This page has an error. You might just need to refresh it. Action failed: c:leadCollector$controller$createRecordHelper [Cannot read property 'setParams' of undefined] Failing descriptor: {c:leadCollector$controller$createRecordHelper}

Any piece of advice would be greatly appreciated.
Thanks
Lightning component to update contact record with checkbox field=true
Hi all,
I am new to coding.I am stuck here can any one please help me.Your help is appreciated.

My requirement is to display 10 contact records with checkbox beside to it , with update button at last.After clicking on the update button ,selected record should get updated.
Below is my code

***************************APEX CODE***********************************
public class getAllContactRecords 
{
    @AuraEnabled
    public static List<contactListWrapper> getContacts()
    {
        List<contactListWrapper> lstContactWrap=new List<contactListWrapper>();
        for(Contact con:[select id,Name from Contact limit 10])
        {
            lstContactWrap.add(new contactListWrapper(false,con));
        }
        return lstContactWrap;
    }
    
    /* wrapper class */  
    public class contactListWrapper 
    {
        @AuraEnabled public boolean isChecked ;
        @AuraEnabled public  contact objContact ;
        public contactListWrapper(boolean isChecked, contact objContact)
        {
            this.isChecked = isChecked;
            this.objContact = objContact;
        }
    }
    
}

***************************Lightning component***********************************
<aura:component controller="getAllContactRecords" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
   <!-- aura attributes to store data/values --> 
    <aura:attribute name="ContactList" type="Contact[]"/>
    <!-- call doInit method on component load -->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:iteration items="{!v.ContactList}" var="obj">
        
        <tr>
            <td>  <ui:inputCheckbox text="{!obj.objContact.Id}"
                                    value="{!obj.isChecked}"
                                    change="{!c.checkboxSelect}" aura:id="chkBoxId"/>
            </td>
            <td>
                {!obj.objContact.Name} <br/> 
            </td>
        </tr>

    </aura:iteration>
    
    <lightning:button label="Update" onclick="{!c.updateSelectedRecords}"/> 
</aura:component>

***************************Lightning controller***********************************

({
    doInit : function(component, event, helper) 
    {
        var action=component.get("c.getContacts");
        action.setCallback(this, function(data){
            
            component.set("v.ContactList",data.getReturnValue());
            
        });  
        $A.enqueueAction(action);
    },
    
    
    checkboxSelect : function(component, event, helper) 
    {
         alert('test');
        var selectedHeaderCheck = event.getSource().get("v.text");
        var checkVar=component.find("v.chkBoxId");
        alert(selectedHeaderCheck);
     //  $A.enqueueAction(action);
    },
    
    updateSelectedRecords : function(component, event, helper) 
    {
        alert('test 1')
       var check=component.find("v.chkBoxId");
         if (check.get("v.value") == true)
         {
          //         updateId.push(getAllId.get("v.text"));
         }
      // $A.enqueueAction(action); 
    } 
})
I have created a visualforce page when a new case is created.
When i assign the VF page to the new button of case, the community users cannot see the new button.
I have checked in VF page creation the box "Available for Lightning Experience, Lightning Communities, and the mobile app"
Scenario: To count the the total cases in the account whenever creating a new case and up[date the case count field in account object through trigger and class
Issue: Case Count field is not updated in account record when the new case getting created 

trigger newCaseInsert on Case (after insert) {
    for(Case cs: trigger.new)
    getCaseCount.getupdatedCount(cs.Account.id);
    }

public class getCaseCount {
     public static Integer CountValue;
     public static Integer getupdatedCount(String AccountId){
         CountValue =[Select COUNT() from Case where Account.id=:AccountId];
         List<Account> record= [Select id,Name,Case_Count__c from Account where Account.id=:AccountId];
         for(Account acts: record){
           acts.Case_Count__c=CountValue;
         }
         update record;
         return CountValue ; 
    }  
}
I am doing this advanced formula trail head. creating validation rule. need to create validation rule. i kept like below on validation rule. testing working. but challenge saying failed. can somebody help
Create a validation rule formula that does not allow a user to mark a case as escalated unless the priority is set to 'High', the case was not Closed when Created, and the case isn’t closed.
AND(
  ISCHANGED( IsEscalated ),
  OR( 
     ISPICKVAL(PRIORVALUE( Status ), "Closed"), 
     NOT( ISPICKVAL(PRIORVALUE( Priority), 
          "High")), ( PRIORVALUE( IsClosedOnCreate ) = true)),
  (IsEscalated = true)
)

<lightning:button variant="brand" label="Yes" title="Brand action" iconName="utility:check" iconPosition="left" disabled="true" aura:id="yesID" />

 var DisYes=cmp.find("v.yesID");

DisYes.set("v.disabled", false);  

We're working on a migration from Classic to LEX. However, it will be a long transition, so we need the ability to work in both for as long as possible. The documentation states/strongly implies that there should be an ability to leave an action override in place in Salesforce Classic, whilst removing it in Lightning/Mobile:

Remove Overrides for Standard Buttons and Tab Home Pages (https://help.salesforce.com/articleView?id=links_customize_override_remove.htm&type=5)

However, step 3 describes options which not available within our org:

"Select No override (default behavior) for the experience whose override you want to remove (Salesforce Classic, Lightning Experience, or mobile)."

User-added image
We've had a case open with Salesforce for a few weeks now and I can't seem to make any headway (they say the documentation team say that their documentation is correct, but also can't explain why I don't see the options that the documentation says should be there)
Being able to switch off the override in LEX would be ideal.

As we're in Lightning Console, using Lightning Components to override the override behaviour specifically for LEX still results in unwanted behaviours (tabs being opened unnecessarily, no access to inline editing, etc.) The only option remaining to us may be to have to re-build an object model specifically for LEX, which I'm sure isn't the desired approach when migrating to LEX

Is anybody able to confirm which is the expected behaviour and best practice for dealing with it?
HI All,

Am trying to simplify the sales force Mobile Users objects layout.
If the user logged in the browser it should be actual page layout. If the same user logged in Mobile App should be a Simplified layout.
How to display a different page layout for Mobile and browser based.

Kindly assist me how to accomplish this.


Thanks,
Shakila
 
Hi,
I have a lightning component which has started giving below compile error for User.ContactId Field referenced in the apex controller.

Failed to save VV_Circles.cmp : Invalid definition for null: VV_BookingsController: SELECT ID, ContactId FROM User LIMIT 1 ^ ERROR at Row:1:Column:12 No such column 'ContactId' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

The lightning component was working fine till Spring 19 release was rolled out in the Development sandbox. 

This issue has also impacted the Community Builder Page where this component is being used and causing internal server error in Community Builder.
An internal server error has occurred Error ID: 1138818950-215153 (403527751)

Please provide your suggestions for this issue.
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,
We are getting "No such column 'AccountId' on entity 'User'.If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.: Source" error when we are trying to save a controller class. We have been using this controller for a while and it just worked fine. But yesterday we had to change it and we couldn't save it again. Does anyone have this issue before?
//1.its not changing address in contact automatically
trigger trgbillingupdate on Account(after update)
{
  List<Contact> colistupdate = new list<Contact>();
  
   for(Account a :[select id,name,billingstreet,(select id,name,accountid,otherstreet from Contacts)from Account where id IN:trigger.new])
   {
      if(trigger.oldmap.get(a.id).billingstreet!=a.billingstreet)
      {
       Contact c = new Contact();
       c.accountid = a.id;
       c.otherstreet = a.billingstreet;
       colistupdate.add(c);
      }

   }
  update colistupdate;
 }


//2
trigger trgotherstreetdate on Contact(before update)
 {
 
 
   for(Contact c :[select id,name,otherstreet,Account.id,Account.name,Account.billingstreet from Contact where id IN:trigger.new])
   {
     if(trigger.oldmap.get(c.id).otherstreet!= c.otherstreet)
      {
       Account a = new Account();
       a.id=c.id;
       a.billingstreet=c.otherstreet;
       update a;
     }
   
   }
 }

In Account object we have a field called opportunity status and in opportunity object we have a field called 
Stage so when stage value will change the new value should display in the 
Account object field called opportunity status using trigger.
I am a system admin and do not understand much about apex coding. Would like to clarify if it is an apex limitation that disallow uploading of document more than 6MB?

The VF page coding as below.
<apex:tab label="2. Upload File" name="step2" id="tabTwo" styleClass="upload-content" disabled="{!IF(ValidToken == false, true, (IF(gc.size == 0, false, true)))}">
                        <div class="standard-padding">
                            <apex:form id="form-upload">
                                <apex:pageBlock >
                                    <div class="action-container">
                                        <apex:actionFunction name="ChangeCount_JS" action="{!ChangeCount}"/>
                                        <apex:pageblocksection >
                                            <apex:pageBlockSectionItem >
                                                <apex:outputLabel value="How many files you want to upload?"/>
                                                <apex:selectList onchange="ChangeCount_JS() ;" multiselect="false" size="1" value="{!FileCount}">
                                                    <apex:selectOption itemLabel="--None--" itemValue=""/>
                                                    <apex:selectOptions value="{!filesCountList}"/>
                                                </apex:selectList>
                                            </apex:pageBlockSectionItem>
                                            
                                        </apex:pageblocksection>
                                        
                                        <apex:pageBlockSection title="Select Files (5mb per file max)" rendered="{!IF(FileCount != null && FileCount != '', true , false)}">
                                            <apex:repeat value="{!allFileList}" var="AFL">
                                                <apex:inputfile value="{!AFL.Body}" filename="{!AFL.Name}" contentType="{!AFL.ContentType}"/>
                                                <br/>
                                            </apex:repeat>
                                        </apex:pageBlockSection>
                                            
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <center>
                                            <apex:commandButton styleClass="submit" onclick="this.value = 'Uploading...'" value="Upload file" action="{!UploadFile}" />
                                        </center>
                                        <br/>
                                        <br/>
                        
                                        <br/>
                                    </div>
                                </apex:pageBlock> 
                            </apex:form>
                        </div>

 
Hello,

When a lead is converted, how can i find out the lead whcih is associated with the Contact.
I want t find out the leadfrom the contact.

Wthank you for suggestion

Hi Folks,


As we know that we can't built Apex controller in Professional Edition Box, still is there a way to built Lightning web component with Apex call.
Every thought is appriciatable,thanks in advance.


Regards,

Anitha

I want to connect two orgs using REST API and retrieve one org data and save it in a object in other org.
I need to save data in a certain object of other org.
Please Help
I want to develop a button in my page. Let's say that button name is "Print". When you click on that "Print" button it should print the page in a PPT / PDF format. 

I want your inputs to get an idea about this. I really don't know where to start and how to start. Can you guys help me?
Schedulbale Class:

User-added image

global class DeletAccount implements Schedulable
{
     
     global void execute(SchedulableContext ctx)
     {
         list<Account> acc=new list<Account>();
         for(Account acc1:[Select id,name from account where name like '%Demo%'])        
             acc.add(acc1);--------------->Error Line
             
   
         delete acc;      
     }
       
}

Test Class:

@isTest
public class Testclass {
 public static testmethod void test1()
 {
     Test.startTest();
           list<account> acc=new list<Account>(); 
        Account a1 = new Account();
          a1.name='Dummy account';
         acc.add(a1);    
         insert acc; 
        String CRON_EXP = '0 0 0 3 9 ? 2022';
        String jobId = System.schedule('test111', CRON_EXP, new DeletAccount());
         CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
          System.debug('ct'+ct);
        System.assertEquals(0, ct.TimesTriggered);
        System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime));
     Test.stopTest();  
 }
                
}
 
Hello Friends.
I ran into problems querying a custom metadata object. I found the query was not working as expected when filtering on a picklist field. To test I then created a text field and put the same value as the picklist field. The query on the text field works.  Just wondering anybody else has ran into this. 


picklist field: Record_Type__c
text field: Record_Type2__c

non-working query:
select Id,
                      MasterLabel,
                      VF_Display_Name__c,
                      Component_Name__c,
                      PDF_Page_Factory__r.VF_Page__c,
                    PDF_Page_Factory__r.Object__c,
                    PDF_Page_Factory__r.Record_Type__c 
               from PDF_Component_Factory__mdt
             where  PDF_Page_Factory__r.Object__c = 'Quote'
and PDF_Page_Factory__r.Record_Type__c = 'Research'

working query:
select Id,
                      MasterLabel,
                      VF_Display_Name__c,
                   	 Component_Name__c,
                      PDF_Page_Factory__r.VF_Page__c,
                     PDF_Page_Factory__r.Object__c,
                     PDF_Page_Factory__r.Record_Type__c 
               from PDF_Component_Factory__mdt
             where  PDF_Page_Factory__r.Object__c = 'Quote'
and PDF_Page_Factory__r.Record_Type2__c = 'Research'

 
Challenge Not yet complete... here's what's wrong: 
John Wiseman must be subscribed to receive the Opportunities Pipeline report every Monday at 8 am.


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

I cannot subscribe John Wiseman to the report through the report's "Subscribe" menu or by going to his user profile and logging in as him:
User-added imageUser-added image

I'm not sure what I'm doing wrong.
I need help getting this to work. I've followed all API documentation and can't get anything to happen. There are no errors, just nothing happens when it's run:

 Case c = new Case();
 Case[] cases = new Case[1];

c.Id = id;
c.Subject = "Test";
cases[0] = c;
SaveResult[] check = binding.update(cases);

Any ideas would be great. I can successfully login and pull data, but update() and create() do nothing.
I am having issues with this challenge
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: HKXULUEI
Can I Get number of api calls made in the last 24 hours via the API. This is to check if we are close to the limit before making bulk calls.

Please note this needs to be via the API I know how to access this via the UI but im looking to modify a windows service to check before making bulk calls. 
Received this error on the second to last step of the Reports Superbadge for Lightning.  Looking for some help to resolve this issue, as I do not want to start over for the superbadge. 


There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: CTHDYZYM
 
Hi Guys- can anyone help out on this, I want to schedule a batch so it runs thrice at 23:00, 1:40 & 4:00

String cronStr = '0 45 23,1,4 * * ?';

Hours I can specify comma seperated but minutes it's not taking, pls suggest
Hi all,

I want to invoke a lightning component from a list button.

Everything works fine except if I use "e.force:createRecord".

Here's the error message: 
This page has an error. You might just need to refresh it. Action failed: c:leadCollector$controller$createRecordHelper [Cannot read property 'setParams' of undefined] Failing descriptor: {c:leadCollector$controller$createRecordHelper}

Any piece of advice would be greatly appreciated.
Thanks
Hi all, I have been having this issue for two days now and I cannot find any fix for it. Everything was running fine a few days ago, I did not run any updates or anything, and then the CLI started giving me this error in VS Code and in command prompt. I have tried uninstalling the CLI and manually deleting all of the leftover folders several times, uninstalling VSC and all extensions, and reinstaling all with no luck. Any ideas?User-added image
I want to send JWT token in soap api calls, we have to send in http header or body....? I am new to SOAP can any one help me...
Hi, 

When I reload the custom lightning component page in community pick-list values are not showing drop-down values. It is showing the pick-list values for the first time when page load without any issue. But Problem is when I do manual reload of the page i missing the picklist dropdown values .And It is working fine with Internet Explorer.

Not working in crome and firefox
User-added image
I have to add a new values to multi select picklist field dynamically.


As per the image i have to add new ValuesThanks in Advance
Creating record with attach file in single lightning component.the record
  and acttach file are should be with the same id.how can achive this please let me know.
my code is;;
Component::
<aura:component controller="AttchfileData" implements="lightning:actionOverride,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
     <aura:attribute name="Attach" type="Custom_Attchment__c" 
                        default="{'sobjectType': 'Custom_Attchment__c'}"/>

    Name: <force:inputField value="{!v.Attach.Name}"/><br/><br/>
   Type: <force:inputField value="{!v.Attach.Type__c}"/><br/><br/>
    Description: <force:inputField  value="{!v.Attach.Description__c}"/><br/>
            <lightning:button variant="base" label="Save" onclick="{! c.handleClickk }"/>

         
   <!-- <lightning:fileUpload label="Upload File" 
                          multiple="true" accept=".pdf, .png ,  .docx" 
                          recordId="{!v.recordId}" 
                           disabled="false"
                          aura:id="multifileUpload" 
                          onuploadfinished="{!c.handleUploadFinished}" />-->
       <!--<aura:attribute name="edgeRecordId" type="String" description="Record to which the files should be attached" />
   <div class="wrapper">
        <lightning:fileUpload label="Upload Attachments" 
        multiple="true" 
        accept=".pdf, .png"
        recordId="{!v.edgeRecordId}" 
        onuploadfinished="{!c.handleAfterUpload}" />
    </div>-->
      <aura:attribute name="accept" type="List" default="['.pdf', '.png']"/>
    <aura:attribute name="multiple" type="Boolean" default="true"/>
    <aura:attribute name="disabled" type="Boolean" default="false"/>

    <lightning:fileUpload  name="fileUploader"
                           label= "Demo Upload"
                           multiple="{!v.multiple}"
                           accept="{!v.accept}"
                           disabled="{!v.disabled}"
                           recordId="abcd"
                           onuploadfinished="{! c.handleUploadFinished }"/>
         
</aura:component>

Controller js::
({
  handleClickk : function(component, event) {
    var newAcc = component.get("v.Attach");
    var action = component.get("c.Attinfo");
    action.setParams({ 
        "CustAt": newAcc
    });
    action.setCallback(this, function(a) {
           var state = a.getState();
            if (state === "SUCCESS") {
                var name = a.getReturnValue();
               alert("hello from here"+name);
            }
        });
    $A.enqueueAction(action)
},

  
    handleUploadFinished: function (cmp, event) {
        // This will contain the List of File uploaded data and status
        var uploadedFiles = event.getParam("files");
        alert("Files uploaded : " + uploadedFiles.length);
    }
})

Apex controller;;;
public class AttchfileData {

  @AuraEnabled    
  /* public static void Attinfo(Custom_Attchment__c CustAt , String fileName, String base64Data, 
                               String contentType){
        //CustAt=New Custom_Attchment__c();
                         insert CustAt;
     Attachment    att = new Attachment();  
        att.parentId = CustAt.id;
        att.Body = EncodingUtil.base64Decode(base64Data);
        att.Name = fileName;
        att.ContentType = contentType;
        Insert att;
        
        
       
    }  */
 public static void Attinfo(Custom_Attchment__c CustAt,String fileName, String base64Data, String contentType ){
        //CustAt=New Custom_Attchment__c();
                         insert CustAt;
     string aa='this is siraj';
     
     Attachment    att = new Attachment();  
        att.parentId = CustAt.id;
        att.Body = Blob.valueOf(aa);
        att.Name = 'hi';
        att.ContentType = 'pdf';
        Insert att;

        
      
    
    
       
    }

     }
When running a flow in Classic, lightning runtime works great to allow uploading files. When the same flow is wrapped in a VisualForce page (so that you can use the button override), lightning runtime does not work. How can i either A) override a button with a flow NOT using Visualforce or B) enable lightning runtime on a flow wrapped in a VisualForce page?
Hi, 
Im doing the Superbadge for "Lightning Experience Reports & Dashboards Specialist" and geeting this error on the "Create the SolarBot dashboard", #7:
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ROYGENRE


Its a new org for this challange...
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();
        }
    }
       
})