• Alain Cabon
  • ALL STAR
  • 9413 Points
  • Member since 2016

  • Chatter
    Feed
  • 303
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1872
    Replies
I work for a non profit and need to periodically export a large number (60) of CSV files for gov't reporting.   I have looked through a lot tools to do this and for those that I reviewed, they all have short comings - mostly you need to do them one at a time.   Exporting them one at a time is too labor intensive when you have to do so many of them so often.  So far, I haven't found any solution so am wondering if someone has some ideas on how to do this or know of already developed solutions.  Additionally the names of these csv files change every month so would like to manage the naming under program control.   Thank you.   Steve 
Hi! I'm wanting to make a custom page layout. No Header. No Footer. One left small (~30% or 4 SLDS columns) component section and three stacked right side bar which should take up the rest of the page. I tried this code and it doesn't come out the way I want it to.
<aura:component implements="lightning:appHomeTemplate" description="Main small column
 and three right sidebar. On a phone, the regions are of equal width">
    <aura:attribute name="left" type="Aura.Component[]" />
    <aura:attribute name="topRight" type="Aura.Component[]" />
    <aura:attribute name="middleRight" type="Aura.Component[]" />
    <aura:attribute name="bottomRight" type="Aura.Component[]" />
	<div>
        <lightning:layout>
    		<lightning:layoutItem class="slds-m-right_small">
                {!v.left}
            </lightning:layoutItem>
        </lightning:layout>
    </div>
    
    <div>
        <lightning:layout>
            <lightning:layoutItem flexibility="grow" class="slds-m-left_small">
                {!v.topRight}
            </lightning:layoutItem>
            <lightning:layoutItem flexibility="grow" class="slds-m-left_small">
                {!v.middleRight}
            </lightning:layoutItem>
            <lightning:layoutItem flexibility="grow" class="slds-m-left_small">
                {!v.bottomRight}
            </lightning:layoutItem>
        </lightning:layout>
    </div>
    
</aura:component>
 
<design:component label="Two Column, three right sidebar Custom App Page Template">
    <flexipage:template >
        <!-- The default width for the "left" region is "MEDIUM". In tablets,
        the width is "SMALL" -->
            <flexipage:region name="left" defaultWidth="SMALL">
                <flexipage:formfactor type="MEDIUM" width="SMALL" />
            </flexipage:region>
            <flexipage:region name="topRight" defaultWidth="MEDIUM" />
        	<flexipage:region name="middleRight" defaultWidth="MEDIUM" />
        	<flexipage:region name="bottomRight" defaultWidth="MEDIUM" />
       </flexipage:template>
</design:component>

User-added image

The above image is my result. What I'm trying to do is below. Where the two columns are equal in height but the right side is elongated. 

User-added image

I'm really new to App Page layouts and feel kind of lost.
Hi,
I am trying to read the body of attachment and writing in a text file using Python. Below is the sample code. 
import urllib
import requests
import base64
import json
from simple_salesforce import Salesforce
import urllib.request as urllib



instance = ''

sf = Salesforce(username='username', password='password', security_token='security_token')
sessionId = sf.session_id

attachment = sf.query("SELECT id, name,Body FROM Attachment where parentID =''")
body = ""

req = urllib.Request('https://%s.salesforce.com/services/data/v38.0/sobjects/Attachment/<id>/Body/' % instance,
    headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % sessionId })
f = urllib.urlopen(req)
f1 = open("demofile.txt", "wb")
for x in f:
    f1.write(x)
f.close()
f1.close()
But, I am getting below error.
f1.write(x)
TypeError: write() argument must be str, not bytes
Please correct me, if something is wrong.

Thanks and Regards,
Diwakar G
Hi everyone, I'm started to learn Lightning and recently faced one problem. I want to create a trivial application. My application has one picklist and one button. I select records in the picklist and output it with the button. But it does not work. 
Please help me solve this problem.
Component:
<aura:component controller="MyObjController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:handler name="init" value="{!this}" action="{!c.fetchListOfRecordTypes}"/>
    <aura:attribute name="lstOfRecordType" type="String[]"/>
	<aura:attribute name="atrOgj" type="Sensor__c"/>
    <aura:attribute name="isOpen" type="boolean" default="false"/>
    <div class="slds-modal__container">
    	<div class="slds-modal__content slds-p-around--medium">
                    <div class="slds-grid slds-wrap">
                        <div class="slds-size--1-of-2 slds-large-size--1-of-2">
                             <div class="slds-align--absolute-center">Select a Record Type</div>                            
                        </div>
                        <div class="slds-size--1-of-2 slds-large-size--1-of-2">
                            <ui:inputSelect aura:id="selectid">
                                <aura:iteration items="{!v.lstOfRecordType}" var="contact">                            
                                    <ui:inputSelectOption text="{!contact}" label="{!contact}"  />
                                </aura:iteration>
                            </ui:inputSelect>
                        </div>&nbsp; &nbsp;
                    </div>                   
        </div>
        <div class="slds-modal__footer">
        	<lightning:button class="slds-button slds-button--brand" onclick="{!c.createRecord}">Next</lightning:button>
        </div>
        <aura:if isTrue="{!v.isOpen}">
              
					{!atrOgj.Name}
        </aura:if>
        
       
    </div>
</aura:component>
Controller:
({
    fetchListOfRecordTypes: function(component, event, helper) {
      var action = component.get("c.fetchRecordTypeValues");
      action.setCallback(this, function(response) {
         component.set("v.lstOfRecordType", response.getReturnValue());
      });
      $A.enqueueAction(action);
   },
    
    
    createRecord: function(component, event, helper) { 
      
      var action1 = component.get("c.getRecTypeId");
      var recordTypeLabel = component.find("selectid").get("v.value");
      action1.setParams({
         "recordTypeLabel": recordTypeLabel
      });
        alert(recordTypeLabel);
      action1.setCallback(this, function(response) {
         	var state = response.getState();
          if (state === "SUCCESS")  {
             component.set('v.atrOgj', response.getReturnValue());   
             component.set("v.isOpen", true);
          }
          else {alert('Error');}
      });
      $A.enqueueAction(action1);
   }
})
Apex class:
public with sharing class MyObjController {
    public static Map<Id, String> recordtypemap {get;set;}
    
   @AuraEnabled        
    public static List<String> fetchRecordTypeValues(){
       	List<Sensor__c> recordtypes = [SELECT ID,Name FROM Sensor__c];    
        recordtypemap = new Map<Id, String>();
        for(Sensor__c rt : recordtypes){
            recordtypemap.put(rt.Id, rt.Name);
        }
        system.debug(recordtypemap.values());
        return recordtypemap.values();
    }  
        @AuraEnabled
    public static Sensor__c getRecTypeId(String recordTypeLabel){
        return [SELECT Max_Vectors_Difference__c FROM Sensor__c WHERE Name =:recordTypeLabel Limit 1];
    }
}



 
Hi All,

I'm trying to source a formula that works correctly. I need to display the period between two date fields in Words (Year(s), Month(s), Day(s).
I have found a number of suggessted formulas here and also I have been offered solutions here but they don't seem to work with all date periods. For example, I have a Lease Start Date 01.12.2018 and a Lease End Date 30.11.2021. I was using a formula which was suggested to me in the past but it returns a value of 3 Years, - 1 Month, 29 Days when it should be 2 Years 11 Months 29 Days.
The formula that I have used is below. Maybe it needs some kind of adjustment, I don't really know. 

IF(ISBLANK(End_Date__c),

TEXT(Year(  TODAY()  )- Year(  Start_Date1__c  )) &" "&"Years"&" "&
TEXT(Month(  TODAY()  )-Month(  Start_Date1__c  )) &" "&"Months"&" "&
TEXT(Day(  TODAY()  )-Day(  Start_Date1__c  ))&" "&"Days",

TEXT(Year(  End_Date__c  )- Year(  Start_Date1__c  )) &" "&"Years"&" "&
TEXT(Month(  End_Date__c  )-Month(  Start_Date1__c  )) &" "&"Months"&" "&
TEXT(Day(  End_Date__c  )-Day(  Start_Date1__c  ))&" "&"Days")
 
Hi Friends,

I have a method that updates a lookup field on the task object. The task field is updated based on the value in a lookup field on the Contact. I  know it is inefficient and it fails my bulk test class. But I am not sure how to optimize the SOQL query to get my code under the  100 SOQL query limit. Any tips or pointers would be great.  The tasks are getting passed into the Method through trigger.new in a trigger handler. I am sure that putting the WhoIds into a list and doing a query to get the contacts and add them to a Map is pretty sub-optimal. 
public static void assignTasksToRelationshipOwnersInsert(List<Task> taskList) {
        //assign contacts owner to task look up field
        Set<Id> contactIds = new Set<Id>();
        for (Task t : taskList) {
            if (t.WhoId != null && t.Subject.contains('Pardot List Email')) {
                contactIds.add(t.WhoId);
            }
        }
        //create a map of contacts and regions
        //Fails SOQL limit here
        List<Contact> contactList = [
                SELECT Id, New_Relationship_owner1__c
                FROM CONTACT
                WHERE Id IN:contactIds
                AND New_Relationship_owner1__c != Null
        ];
        Map<Id, ID> contactMap = new Map<Id, Id>();
        for (Contact c : contactList) {
            contactMap.put(c.Id, c.New_Relationship_owner1__c);
        }
        for (Task updatedTask : taskList) {
            if (contactMap.containsKey(updatedTask.WhoId) && contactMap.size() > 0) {
                updatedTask.Relationship_Owner__c = contactMap.get(updatedTask.WhoId);
            }
        }
    }


 
hello all, 

i put together a lighenting componet with a control to present the lead record fields in table format, however, it is not working. the table came correct but not responsive. i need to be able to edit the fields on it and also save and cancel if edited. i tried lightening data table but it does not list the data/fields in the format it need it. here is my code so far: 

component: 
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global">
    <aura:attribute name="lead" type="Lead"/>
			<lightning:recordViewForm aura:id="viewForm" recordId="{!v.lead.Id}" objectApiName="Lead">
                 <div class="slds-media">
                  <div class="slds-scope">
    <lightning:buttonIcon iconName="utility:edit" class="slds-col_bump-left" iconClass="slds-button__icon_hint" variant="bare" alternativeText="Edit Record" onclick="{!c.editRecord}" />
    <div class="slds-table_edit_container slds-is-relative">
       <table class="slds-table slds-table_bordered slds-table_edit slds-table_fixed-layout slds-table_cell-buffer"> 
        <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-table_col-bordered"> 
        <thead>
            <tr class="slds-text-title_caps slds-text-heading--label">
                <th scope="col" class="slds-cell-buffer_left">
                  <div class="slds-truncate" title="Class">Class</div>  
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                  <div class="slds-truncate" title="Scheduled">Scheduled</div>      
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                 <div class="slds-truncate" title="Claimed">Claimed</div>      
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                 <div class="slds-truncate" title="Allowed">Allowed</div>       
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                  <div class="slds-truncate" title="CUD">CUD</div>      
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                 <div class="slds-truncate" title="Status">Status</div>       
                </th>     
            </tr>
        </thead>
        <tbody>
            <tr>
                <td scope="row" >
                    Secured
                </td>
                <td>
                 <lightning:outputField fieldName="Secured_Scheduled_Amount__c"/>
                </td>
                <td> 
                  <lightning:outputField fieldName="Secured_Claimed_Amount__c"/>
                </td>
                <td>
                  <lightning:outputField fieldName="Secured_Allowed_Amount__c"/>
                </td>
                <td>
                    <lightning:outputField fieldName="Secured_CUD__c"/>
                </td>
                <td>
                    <lightning:outputField fieldName="Secured_Claim_Status__c"/>
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Unsecured 
                </td>
                <td>
                  <lightning:outputField fieldName="Unsecured_Scheduled_Amount__c"/>
                </td>
                <td> 
                  <lightning:formattedNumber value="{!v.Lead.Unsecured_Claimed_Amount__c}" style="currency"/>
                </td>
                <td>
                  <lightning:formattedNumber value="{!v.Lead.Unsecured_Allowed_Amount__c}" style="currency"/>
                </td>
                <td>
                    {!v.Lead.UnSecured_CUD__c}
                </td>
                <td>
                    {!v.Lead.Unsecured_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Priority 
                </td>
                <td>
                  <lightning:formattedNumber value="{!v.Lead.Priority_Scheduled_Amount__c}" style="currency"/>
                </td>
                <td> 
                  <lightning:formattedNumber value="{!v.Lead.Priority_Claimed_Amount__c}" style="currency"/>
                </td>
                <td>
                  <lightning:formattedNumber value="{!v.Lead.Priority_Allowed_Amount__c}" style="currency"/>
                </td>
                <td>
                    {!v.Lead.Priority_CUD__c}
                </td>
                <td>
                    {!v.Lead.Priority_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Admin 
                </td>
                <td>
                <lightning:formattedNumber value="{!v.Lead.Admin_Scheduled_Amount__c}" style="currency"/> 
                </td>
                <td> 
                 <lightning:formattedNumber value="{!v.Lead.Admin_Claimed_Amount__c}" style="currency"/>
                </td>
                <td>
                 <lightning:formattedNumber value="{!v.Lead.Admin_Allowed_Amount__c}" style="currency"/>
                </td>
                <td>
                    {!v.Lead.Admin_CUD__c}
                </td>
                <td>
                    {!v.Lead.Admin_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Admin503B 
                </td>
                <td>
                 <lightning:formattedNumber value="{!v.Lead.Admin503B_Scheduled_Amount__c}" style="currency"/>
                </td>
                <td> 
                 <lightning:formattedNumber value="{!v.Lead.Admin503B_Claimed_Amount__c}" style="currency"/>
                </td>
                <td>
                 <lightning:formattedNumber value="{!v.Lead.Admin503B_Allowed_Amount__c}" style="currency"/>
                </td>
                <td>
                    {!v.Lead.Admin503B_CUD__c}
                </td>
                <td>
                    {!v.Lead.Admin503B_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Totals  
                </td>
                <td>
                   <lightning:formattedNumber value="{!v.Lead.Scheduled_Total__c}" style="currency"/> 
                </td>
                <td>
                  <lightning:formattedNumber value="{!v.Lead.Claimed_Total__c}" style="currency"/>
                </td>
                <td>
                   <lightning:formattedNumber value="{!v.Lead.Allowed_Total__c}" style="currency"/>
                </td>
                <td>
                    
                </td>
                <td>
                    
                </td>
            </tr>
        </tbody> 
    </table>
    </table>
                      </div>
    </div>
                </div>
	</lightning:recordViewForm>
</aura:component>
controller: 
 
({
    navToRecord : function (component, event, helper) {
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "recordId": component.get("v.lead.Id")
        });
        navEvt.fire();
    },
    editRecord : function(component, event, helper) {
    var editRecordEvent = $A.get("e.force:editRecord");
    editRecordEvent.setParams({
        "recordId": component.get("v.lead.Id")
    });
    editRecordEvent.fire();
}
})


 
Hello there,

I am having a hard time trying to get lightning:select component selected value in controller :

Here is my code :
component :
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    
        <!-- handlers-->
        <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
            <lightning:select name="distance" label="Distance ?" onchange="{!c.onChange}">
                <option value="10km">10</option>
                <option value="25km">25</option>
                <option value="50km">50</option>
                <option value="100km">100</option>
            </lightning:select>
           
</aura:component>
controller:
({
     
init: function (component, event, helper) {
    
    	console.log('distance ' + component.find("distance").get("v.value"));

    },
    
    onChange: function (component, event, helper) {
    	console.log(component.find("distance").get("v.value"));
    }
})
wheh the page loads or when I change the picklist value, I get his error message :
 
Action failed: c:map$controller$init [component.find(...) is undefined]

Thanks a lot for your help !

 

Hi all,

Having a big amount of campaign members which I`m trying to import in a timely manner, but unsuccessfully. The records are ~55M, initially i tried with my default bulk settings (parallel mode) and I got locking errors for ~30% of the records. This is key quote from one of the salesforce documentation which offers all possible workaounds for my scenario, but i can`t use any of these: "For optional lookup fields, you can avoid the locks by setting the "Clear the value of this field" option, which does more than just tell Salesforce what to do if your lookup record is deleted. When you set this option, whenever a record that has a lookup field to this lookup record is inserted or updated, Salesforce doesn't lock the lookup records; instead it only validates that the lookup values exist. To avoid unnecessary locks, it’s best to set this option for your lookup fields whenever possible. If it isn’t possible to configure your lookup fields with this option, use a workaround similar to the one you would use for master-detail relationships: Ensure that no lookup values span multiple batches or order your loads by their lookup values to minimize how often the records being inserted in multiple, concurrent batches reference a single lookup value."

For the lookups I use CampaignId and ContactId and both fields doesn`t have that option "Clear the value of this field", I assume because they`re standart fields. I can`t really play with my files to adjust, because having ~7000 campaigns, 10M contacts and 55M members is a big thing. Therefor the only working solution that I currently have is to use serial concurency mode, however the speed is really not acceptable because it will take me ~2 weeks to import all members. 

Please do let me know if you have such issue before and/or if you know an alternative. Thank you!

I am using some simple code to execute an EditAccount method after an apex commandLink is clicked. But, I can't get the method to execute and cannot find a good solution after searching existing questions. Is there something wrong that I'm doing? Thanks

Visualforce page:
<apex:page controller="IMS_CP_Projects_controller1">
    <html>

    <body>
        <apex:form>
            <apex:outputPanel id="editaccounts">

                <table id="dataTable">
                    <thead>
                        <tr>
                            <th>Account Name</th>
                            <th>id</th>
                            <th>Edit</th>
                        </tr>
                    </thead>
                    <tbody>

                        <apex:repeat value="{!Accounts}" var="A">
                            <tr>
                                <td data-label="Name">{!A.Name}</td>
                                <td data-label="id">{!A.id}</td>
                                <td data-label="Edit">
                                    <apex:commandLink action="{!EditAccount}" value="Edit" id="editcmd">
                                        <apex:param assignTo="{!editid}" value="{!A.id}" name="editid" /> {!A.id}
                                    </apex:commandLink>
                                </td>
                            </tr>
                        </apex:repeat>
                    </tbody>
                </table>

            </apex:outputPanel>
        </apex:form>
    </body>

    </html>
</apex:page>

Custom Controller:
public class IMS_CP_Projects_controller1 {

	public string editid { get; set; }

	public transient List<Account> Accounts { get; set; }

	public IMS_CP_Projects_controller1() {
		Accounts = [SELECT id, name	FROM account LIMIT 20];
	}
  
	public void EditAccount() {
		System.debug('-------- Edit Account --------');
	}
	}

Thanks so much for helping.
is there any other alternative for the following code to work ? i need lightening component instead. 
 
<apex:page standardController="Lead" tabStyle="Lead" sidebar="false" lightningStylesheets="true" docType="HTML-5.0" >

    <script src="/soap/ajax/43.0/connection.js" type="text/javascript"/>
    
    <script>
        function ReloadPage(){
            setTimeout(function(){ window.top.location='/{!Lead.Id}'; }, 100);
        }
    </script>
 
 <apex:form >
    <apex:inlineEditSupport showOnEdit="SaveButton" /> 
    <apex:slds />
    <div class="slds-scope">
    <center>
        <apex:commandButton value="Save" action="{!Save}" onclick="ReloadPage()" style="display: none;" id="SaveButton" />
    </center>
    
    <table class="slds-table slds-table_bordered slds-table_cell-buffer"> 
    
        <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-table_col-bordered"> 
    
        <thead>
            <tr class="slds-text-title_caps slds-text-heading--label">
                <th scope="col" class="slds-cell-buffer_left">
                  <div class="slds-truncate" title="Class">Class</div>  
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                  <div class="slds-truncate" title="Scheduled">Scheduled</div>      
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                 <div class="slds-truncate" title="Claimed">Claimed</div>      
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                 <div class="slds-truncate" title="Allowed">Allowed</div>       
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                  <div class="slds-truncate" title="CUD">CUD</div>      
                </th>
                <th scope="col" class="slds-cell-buffer_left">
                 <div class="slds-truncate" title="Status">Status</div>       
                </th>     
            </tr>
        </thead>
        <tbody>
            <tr>
                <td scope="row" >
                    Secured
                </td>
                <td>
                    {!Lead.Secured_CUD__c}
                </td>
                <td>
                    {!Lead.Secured_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Unsecured 
                </td>
                <td>
                    {!Lead.UnSecured_CUD__c}
                </td>
                <td>
                    {!Lead.Unsecured_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Priority 
                </td>
                <td>
                    {!Lead.Priority_CUD__c}
                </td>
                <td>
                    {!Lead.Priority_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Admin 
                </td>
                <td>
                    {!Lead.Admin_CUD__c}
                </td>
                <td>
                    {!Lead.Admin_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Admin503B 
                </d>
                <td>
                    {!Lead.Admin503B_Claim_Status__c}
                </td>
            </tr>
            <tr>
                <td scope="row" >
                    Totals  
                </td>
                <td>
                    <apex:outputfield value="{!Lead.Scheduled__c}"/>
                </td>
                <td>
                    <apex:outputfield value="{!Lead.Claimed-__c}"/>
                </td>
                <td>
                    <apex:outputfield value="{!Lead.Allowed__c}"/>
                </td>
                <td>
                    
                </td>
                <td>
                    
                </td>
            </tr>
        </tbody> 
    </table>
    </table>
    </div>
  </apex:form>
</apex:page>

 
 say if we have 100 objects
[
{“ECN”:10001, “PCN”:”2131932199”, “RoleType”=”PNI”},
{“ECN”:10002, “PCN”:”2131932199”, “RoleType”=”PNI”},
.
.
.
{“ECN”:10099, “PCN”:”2131932199”, “RoleType”=”SNI”},
{“ECN”:10100, “PCN”:”2131932199”, “RoleType”=”SNI”}
]
 
If I want to take the object having the ECN value as 10099, how should I take it using single line of code instead of looping all the elements.
 
In JAVA, it can be done through lambda expression in one line of code. Please check the feasibility.
I am sometimes successful in creating a new IDE Project, and have deployed changes in the past.  But getting the metadata is pretty much a hit or miss thing.  Today I am unable to create a new Project after multiple attempts with select content.  When I click to add selected metadata I get:
"Unable to determine if resource is force managed: Resource  does not exist. Cause:   (1) Resource does not exist."

When I pull up an old Project (that I've been successful in deploying changes to in the past) when I click "Add/Remove", error I get (before adding anything) is:  Unable to refresh metadata:  An unexpected error has occurred."  

To create a new Project I follow the instructions to Select File | New | Force.com Project.  I've tried Switch Workspace.  I created a new project without contents, which was successful, but then ran into the errors when I tried to "Add" select content.
Hello,

I am having issues with my Lightning Component in Flow. I for some reason can't pass any data from my Flow to my Lightning Component. I can absolutely grab the data from my Lightning Component and use that.

Basically all my flow does is compose an email based on information from the record that it is pointing at. Before the email is sent, it shows the Subject and Body of the email and allows someone to edit the information prior to sending the email. I cannot get the Lightning Component to work in my flow if I am inputting values from my flow into my component, it just fails to load. 

Any suggestions on how to get around this? I want to avoid building something custom but I might have to.

No inputs into Lightning Component via Flow:
Component Showing / No Input into Lightning Component in Flow


Input for Lightning Component via Flow, component no longer visible:
Component Not Showing / Have value input into Lightning Component

Input for those curious:
Simple Input into Body Attribute on Lightning component

Component Code:
<aura:component implements="lightning:availableForFlowScreens" access="global">
    <aura:attribute name="subject" type="String" access="global" />
    <aura:attribute name="body" type="String" access="global" />
    <div id="subject-editor">
        <lightning:input value="{!v.subject}" /> 
    </div><br/>
    <div id="body-editor">
        <lightning:inputRichText value="{!v.body}" /> 
    </div>
</aura:component>

Component Design Code:
<design:component>
    <design:attribute name="subject" label="Subject" />
    <design:attribute name="body" label="Body" />
</design:component>

 
Hello I have this apex class and I tried to write a good test class. I obtain a 78% code coverage but I want to know what is missing and what I  have to do to improve it and to improve my skills on test class.

apex class:
public class SearchWithWrapperC {
    
    public  Date StartDate {get;set;}
    public  Date EndDate {get;set;}
  
    
    public List<WrapperClass> listBD {get;set;}
   
    
    public void loadData() {
        listBD = new List<WrapperClass>();
        for(Billing_Detail__c  cr : [Select Id,SF_Opportunity_Id__c,Account_Name__c,Billing_Detail__c, Name,Billing_Type__c, Billing_Period__c , Monthly_Forecast__c,End_of_Billing__c, Amount__c, Billing_Status__c   from Billing_Detail__c Where Billing_Status__c='Authorized for Billing'AND Monthly_Forecast__c>=:StartDate AND Monthly_Forecast__c <= :EndDate  Order by Account_Name__c, Monthly_Forecast__c]){
            listBD.add(new WrapperClass (cr, false));
        }
    }
    
        public List<WrapperClass> getBilling() {
            if(listBD == null) {

        listBD = new List<WrapperClass>(); 
        for(Billing_Detail__c  cr : [Select Id,SF_Opportunity_Id__c,Account_Name__c,Billing_Detail__c, Name,Billing_Type__c, Billing_Period__c , Monthly_Forecast__c,End_of_Billing__c, Amount__c, Billing_Status__c   from Billing_Detail__c Where Billing_Status__c='Authorized for Billing'AND Monthly_Forecast__c>=:StartDate AND Monthly_Forecast__c <= :EndDate  Order by Monthly_Forecast__c ]){
            listBD.add(new WrapperClass (cr, false));
        }
        }       
         return listBD;
        }
    
        
   public PageReference processSelected() {
       Integer m = Date.Today().Month();
       List<Billing_Detail__c> selectedBD = new List<Billing_Detail__c>();
       for(WrapperClass bd: getBilling()){
           if(bd.check_box== true){
               selectedBD.add(bd.cs);
           } 
       }
        for(Billing_Detail__c cs: selectedBD) {
         cs.Monthly_Forecast__c = Date.newinstance(  cs.Monthly_Forecast__c.year() , m ,  cs.Monthly_Forecast__c.day() );
          update selectedBD;
            System.debug('The value is: ' + cs.Monthly_Forecast__c );   
       }
       return null;     
   }
    

    public class WrapperClass {
        public Billing_Detail__c  cs {get; set;}
        public Boolean check_box {get; set;}
        
        public WrapperClass(Billing_Detail__c  c, Boolean check_box){
            this.cs = c;
            this.check_box = false;
        }
    }
}

Test class:
@isTest private class SearchWithWrapperCTest {
@isTest static void testController() {
    Test.startTest();
    		// create the object in input of the class 
        Account a= new Account();
        a.name='Account test t';
        a.RecordTypeId='012w0000000iROM';
        a.Branch__c='Italy';
        a.Status__c='Customer';
        a.BillingCountry='Italy';
        a.Public_Administration_Account__c='No';
        insert a;

		Opportunity testOpportunity = new Opportunity(
		AccountID = a.Id,
		Name = 'Test Opportunity',
		StageName = 'Needs Analysis',
		CloseDate = date.today().addDays(15)        

		);
		insert testOpportunity;
    
    
    
    Billing_Detail__c c= new Billing_Detail__c(); 
		c.Amount__c= 100;
		c.Billing_Type__c='FEE';
		c.Billing_Period__c='monthly';
		c.Billing_Status__c='Authorized for Billing'; 
		c.Product_Line__c='Interactive Experience (iX)'; 
		c.Product__c='Chat Delivery'; 
		c.Monthly_Forecast__c=Date.newInstance(2018, 7, 9); 
		c.End_of_Billing__c=Date.newInstance(2019, 7, 9); 
		c.Billing_Detail__c=testOpportunity.Id;

		insert c;
		Date StartDate= Date.newInstance( 2018, 10,1);
    	Date EndDate= Date.newInstance(  2018,10,18 );
    
    list<WrapperClassTest> wrp= new  list<WrapperClassTest>();
    	ApexPages.StandardController sc = new ApexPages.StandardController(c);
		 SearchWithWrapperC x =new  SearchWithWrapperC();
    	x.loadData();
    	x.getBilling();
    for(WrapperClassTest wTest :wrp)
  {
   wTest.check_box=true;    
  }
    	x.processSelected();  
    
	
	System.assert(wrp.size() > 1);
     Test.stopTest();
}
    Public class WrapperClassTest{
        public Billing_Detail__c  cs {get;set;}
        public Boolean check_box {get;set;}
        public WrapperClassTest(Billing_Detail__c  c, Boolean check_box)
        {
            this.cs = c;
            this.check_box = false;
        }
    }
}


Thanks
Hi everyone.

Would really appreciate some help with this problem.     

Summary I want to develop a VisualForce page to display a list of records from a few custom objects and then allow the users to filter and sort the list of records.  This is a new implementation so nothing will be used in classic.  The results are only required in the Salesforce mobile app at present but likely they will be required on the desktop version in the future.  Reading around the subject the recomended solution seems to be a Visualforce page using the slds to display the data.  Given its for mobile then tiles rather than tables should be used.   Again as its mobile its recommended to use a remoteAction call from VF to a APEX controller.   

Issue I am not able to get the data to return back from the remoteCall back to the slds tiles.  If I use apex:remoteObjects call in VF, rather than a javacsript remoteAction call I am able to get the data to appear on the page in the tiles.   

Code Notes:  1. I have simplified the code below to try and make it easier to understand.   2. You will see there is code in there in two places (marked with ***remoteObects***) to highlight the code which I was able to use to get it to work with that technology for reference purposes.   

I have also highlighted the code in two places which is for the remoteAction bits. 

Thanks
--Visualforce page
------------

<apex:page standardController="XXCC_COA_Coaching_Contacts__c" extensions="XXCC_COA_Coaching_Contacts_VF" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
        <head>
            <meta charset="utf-8" />
            <meta http-equiv="x-ua-compatible" content="ie=edge" />
            <title>Coaching Contacts</title>
            <meta name="viewport" content="width=device-width, initial-scale=1" />
            <!-- Import the Design System style sheet -->
            <apex:slds />
        </head>
        	<!--     ***********remoteObject code******************
            <apex:remoteObjects >
    		<apex:remoteObjectModel name="XXCC_COA_Coaching_Contacts__c" fields="Id,Name,XXCC_COA_Status__c,LastModifiedDate"/>
    		</apex:remoteObjects> -->
        <body>
            <!-- REQUIRED SLDS WRAPPER -->
            <div class="slds-scope">
                <!-- MASTHEAD -->
                <p class="slds-text-heading_label slds-m-bottom_small"> Coaching Contacts </p>
                <!-- / MASTHEAD -->
                <div class="slds-page-header">
                    <div class="slds-grid">
                        <div class="slds-col slds-has-flexi-truncate">
                        </div>
                    </div>
                </div>
                <!-- PRIMARY CONTENT WRAPPER -->
                <div class="myapp slds-p-horizontal_medium">
                    <ul id="contact-list" class="slds-has-dividers_bottom-space"></ul>
                </div>
                <!-- / PRIMARY CONTENT WRAPPER -->
            </div>
            <!-- / REQUIRED SLDS WRAPPER -->
            <!-- JAVASCRIPT -->
            <script type="text/javascript">
            (function () {
                //***********remoteObject code******************
                //var contact = new SObjectModel.XXCC_COA_Coaching_Contacts__c();
                //***********remoteAction code******************
                var contact = getRemoteContact();
                var contactList = document.getElementById('contact-list');
                /* FUNCTION createTile */
                function createTile(record) {
                    return ['<li class="slds-item">', '<div class="slds-tile slds-media">',
                            '<div class="slds-media__body">', '<h3 class="slds-truncate" title="', record.get('Name'),
                            '"><a href="javascript:void(0);">', record.get('Name'), '</a></h3>',
                            '<div class="slds-tile__detail slds-text-body_small">', '<p class="slds-truncate">', record.get(
                                'Title'), '</p>', '</div>', '</div>', '</div>', '</li>'
                           ].join('');
                }
                /* FUNCTION createTile */
                contact.retrieve({
                    orderby: [{
                        LastModifiedDate: 'DESC'
                    }],
                    limit: 810
                }, function (error, records) {
                    if (error) {
                        alert(error.message);
                    } else {
                        contactList.innerHTML = records.map(createTile).join('');
                    }
                });
            })();
            
            //***********remoteAction code******************
            Visualforce.remoting.timeout = 120000; // Set timeout at page level
            function getRemoteContact() {
                //var contactName = document.getElementById('ccSearch').value;
                var contactName = 'CSTEST';
                Visualforce.remoting.Manager.invokeAction(
                    '{!$RemoteAction.XXCC_COA_Coaching_Contacts_VF.getContactsStatus}',
                    contactName,
                    function (result, event){
                        if (event.status) {
                            // Get DOM IDs for HTML and Visualforce elements like this
                            document.getElementById("remoteCCId").innerHTML = result.Id;
                            document.getElementById('remoteCCName').innerHTML = result.Name;
                            
                        } else if (event.type === 'exception') {
                            document.getElementById("responseErrors").innerHTML =
                                event.message + "<br/>\n<pre>" + event.where + "</pre>";
                        } else {
                            document.getElementById("responseErrors").innerHTML = event.message;
                        }
                    }
                )
            };
            </script>
            <!-- JAVASCRIPT -->       
        </body>
    </html>
</apex:page>

------
--APEX Controller 
------

public with sharing class XXCC_COA_Coaching_Contacts_VF {
	public List<XXCC_COA_Coaching_Contacts__c> Records {get; set;}
	public XXCC_COA_Coaching_Contacts_VF(ApexPages.StandardController stdController){
	}
    @RemoteAction
    public static List<XXCC_COA_Coaching_Contacts__c> getContactsStatus(String contactName){
    List<XXCC_COA_Coaching_Contacts__c> coachingContactsStatus = [select Id, Name 
                                                             	  from  XXCC_COA_Coaching_Contacts__c 
                                                             	  limit 1];
    system.debug('Total contacts in the data return: '+coachingContactsStatus.size()); 
    return(coachingContactsStatus);
	}
}


Chris
Is it possible to
1.create a list button on the related list for opportunity products 
2.call a flow from that list button. 

This is the visualforce page I constructed, but it says that List Controllers are not supported for OpportunityLineItem. If this is the case, is there any way around this, where I could have a list button that allows me to take action on multiple opportunity line items from within the opportunity?

<apex:page standardController="OpportunityLineItem" lightningStylesheets="true" tabStyle="OpportunityLineItem" recordSetVar="AllOpportunityLineItems">
  <apex:repeat value="{!AllOpportunityLineItems}" var="row" rendered="false">
  {!row.id}
  </apex:repeat>
  <flow:interview name="Opp_close_lose"
  finishLocation="{!URLFOR($Action.OpportunityLineItem.Tab, $ObjectType.OpportunityLineItem)}">
  <apex:param name="recordId" value="{!Selected}"/>
  </flow:interview>
</apex:page>

Let me know and thank you in advance for your help!

Tasia
Hello,
I need help on vf search page. How To do to hide checkbox select all before the search? All the column are hidden except checkbox:
User-added image
piece of code
<apex:pageBlock id="pgblk">
            <apex:pageBlockTable value="{!listBD}" var="b">
                <apex:column >
                    <apex:facet name="header">
                        <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                    </apex:facet>
                    <apex:inputCheckbox value="{!b.check_box}" id="inputId" />
                </apex:column>
                
                <apex:column value="{!b.cs.Name}"/>

Thanks.
Hello,
I need help. I have a method that receives a list of custom object. In this object there is a date field already valued. I want update only the month of this date with the current month.
I tried with:
Integer m = Date.Today().Month();

 for(Custom_Object__c co: selectedCO) {
                                 
           co.date__c.Month()=m;

Error: Expression cannot be assigned

Can Someone hepl me?


Thanks,
Francesco
Hi 
I am calling a datatable from the action button on the detail page, the pop window width is very less, i want to increase it to.
Please complete full procedure how can i fix this problem.
Thanks
Hello,

I'm trying populate a lightning combobox with a value from a specific PickList Fiel. Could anyone help me?
 
I'm running into the dreaded too many query rows error on an iterable batch.  No matter the batch size I use, it immediately errors out; even if I set the batch size to 1.  Looking at the logs, it seems to happen while still in the start() method.

This is driving me nuts - I look forward to your insights...

Thanks!

Here's the batch...
global with sharing class update_MBI implements Database.Batchable<AggregateResult> {
	global update_MBI() { }
    global string mbiQuery = 'select account__c, sum(spend__c) spendLast12 from spend__c where age__c < 0 and age__c >= -12 group by account__c ';

	global Iterable<AggregateResult> start(Database.BatchableContext BC) {  
		return new mbiIterable(mbiQuery);
	}

   	global void execute(Database.BatchableContext BC, List<AggregateResult> scope) {
		list<account> u = new list<account>();
		for (AggregateResult ar : scope){
			id acctID = id.valueOf(string.valueOf(ar.get('account__c')));
			decimal newMBI = decimal.valueOf(string.valueOf(ar.get('spendLast12'))) / 12;
			u.add(new account(id=acctID, MBI_Monthly_Spend_Current__c = newMBI));
		}
		update u;
	} 

	global void finish(Database.BatchableContext BC) {	}
}

The Iterable 
public with sharing class mbiIterable implements Iterable<AggregateResult> {
    private String query;

    public mbiIterable(String soql){
		query = soql;
    }

    public Iterator<AggregateResult> Iterator(){
		return new mbiIterator(query);
    }
}

The iterator
public class mbiIterator implements Iterator<AggregateResult> {

  AggregateResult[] results { get;set; }
  Integer index { get;set; }

  public mbiIterator(String query) {
	  index = 0;
	  results = Database.query(query);
  }

  public Boolean hasNext(){
	  return results != null && !results.isEmpty() && index < results.size();
  }

  public AggregateResult next() {
	  return results[index++];
  }
}

 
Hi 
How can i format the currency to french currency format while displaying on VF page.
as $111,112,123.00
Replace to 111 112 123,00 $(Fench Format)
Thanks
I work for a non profit and need to periodically export a large number (60) of CSV files for gov't reporting.   I have looked through a lot tools to do this and for those that I reviewed, they all have short comings - mostly you need to do them one at a time.   Exporting them one at a time is too labor intensive when you have to do so many of them so often.  So far, I haven't found any solution so am wondering if someone has some ideas on how to do this or know of already developed solutions.  Additionally the names of these csv files change every month so would like to manage the naming under program control.   Thank you.   Steve 
I'm using substring to extract valid user timezone picklist values using below code. It does match .. but I get to results.
String text= 'Australian Central Standard Time ((South Australia) Australia/Adelaide)';

String RegEx = '(\\w+[/]\\w+[/]?\\w+)||GMT';
Pattern regexPattern = Pattern.compile(regex);
Matcher mymatcher= regexPattern.matcher(text);
If (myMatcher.find()){
  system.debug(LoggingLevel.Info,'*** Match ' + myMatcher.group());
}
What I expect in the log is Australia/Adelaide. The RegEx seems ok ... https://regexr.com/43hi9
Hello awesome Devs!

I have the following Vf Page, Extension Controller and Test Class that I am attempting to get into Production.  The VF page and controller acts as it should and does the job awesomly, however I get the following error when attempting to run the test class....How can I get past this and resolve?

Thank you all in advance for any help you can provide,

Shawn


Extension Class -
 
public with sharing class ABMDashboardController {

    public List<Account> acc{get;set;}
    public List<Account> acc2{get;set;}
    public List<Account> acc3{get;set;}
    public List<Account> acc4{get;set;}
    public List<Account> acc5{get;set;}
    public List<Account> acc6{get;set;}
    public List<Account> acc7{get;set;}
    public List<Account> acc8{get;set;}
    public List<Account> acc9{get;set;}
    public List<Account> acc10{get;set;}
    public List<Account> acc11{get;set;}
    public List<Account> acc12{get;set;}
    public List<Account> acc13{get;set;}
    public List<Account> acc14{get;set;}
    public List<Account> acc15{get;set;}
    public List<Account> acc16{get;set;}
    public List<Account> acc17{get;set;}
    public List<Account> acc18{get;set;}
    public List<Account> acc19{get;set;}
    public List<Account> acc20{get;set;}
    public List<Account> acc21{get;set;}
    public List<Account> acc22{get;set;}
    public List<Account> acc23{get;set;}
    public List<Account> acc24{get;set;}
    public List<Account> acc25{get;set;}
    public List<Account> acc26{get;set;}
    public List<Account> acc27{get;set;}
    public List<Account> acc28{get;set;}
    public List<Account> acc29{get;set;}
    public List<Account> acc30{get;set;}
    public List<Account> acc31{get;set;}
    public List<Account> acc32{get;set;}
    public List<Account> acc33{get;set;}
    public List<Account> acc34{get;set;}
    public List<Account> acc35{get;set;}
    public List<Account> acc36{get;set;}
    public List<Account> acc37{get;set;}
    public List<Account> acc38{get;set;}
    
    public ABMDashboardController(APexPages.StandardSetController controller1)
    {
        controller1.setPageSize(40);
        acc = new List<Account>();
        acc = [SELECT Id, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Northwest' AND Status__c = 'Active'];
        acc2 = new List<Account>();
        acc2 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Northwest' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc3 = new List<Account>();
        acc3 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Southwest' AND Status__c = 'Active'];
        acc4 = new List<Account>();
        acc4 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Southwest' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc5 = new List<Account>();
        acc5 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Upper South Central' AND Status__c = 'Active'];
        acc6 = new List<Account>();
        acc6 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Upper South Central' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc7 = new List<Account>();
        acc7 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Lower South Central' AND Status__c = 'Active'];
        acc8 = new List<Account>();
        acc8 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Lower South Central' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc9 = new List<Account>();
        acc9 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Upper North Central' AND Status__c = 'Active'];
        acc10 = new List<Account>();
        acc10 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Upper North Central' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc11 = new List<Account>();
        acc11 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Lower North Central' AND Status__c = 'Active'];
        acc12 = new List<Account>();
        acc12 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Lower North Central' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc13 = new List<Account>();
        acc13 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Mid Atlantic' AND Status__c = 'Active'];
        acc14 = new List<Account>();
        acc14 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Mid Atlantic' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc15 = new List<Account>();
        acc15 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Southeast' AND Status__c = 'Active'];
        acc16 = new List<Account>();
        acc16 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Southeast' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc17 = new List<Account>();
        acc17 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Florida' AND Status__c = 'Active'];
        acc18 = new List<Account>();
        acc18 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Florida' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc19 = new List<Account>();
        acc19 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'NYNJ' AND Status__c = 'Active'];
        acc20 = new List<Account>();
        acc20 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'NYNJ' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc21 = new List<Account>();
        acc21 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Northeast' AND Status__c = 'Active'];
        acc22 = new List<Account>();
        acc22 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Northeast' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc23 = new List<Account>();
        acc23 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'MIOH' AND Status__c = 'Active'];
        acc24 = new List<Account>();
        acc24 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'MIOH' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc25 = new List<Account>();
        acc25 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'HI,AK,PR' AND Status__c = 'Active'];
        acc26 = new List<Account>();
        acc26 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'HI,AK,PR' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc27 = new List<Account>();
        acc27 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Canada East' AND Status__c = 'Active'];
        acc28 = new List<Account>();
        acc28 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Canada East' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc29 = new List<Account>();
        acc29 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Canada West' AND Status__c = 'Active'];
        acc30 = new List<Account>();
        acc30 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Canada West' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc31 = new List<Account>();
        acc31 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'APAC' AND Status__c = 'Active'];
        acc32 = new List<Account>();
        acc32 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'APAC' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc33 = new List<Account>();
        acc33 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'EMEA' AND Status__c = 'Active'];
        acc34 = new List<Account>();
        acc34 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'EMEA' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc35 = new List<Account>();
        acc35 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Latin America' AND Status__c = 'Active'];
        acc36 = new List<Account>();
        acc36 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'Latin America' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
        acc37 = new List<Account>();
        acc37 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'South America' AND Status__c = 'Active'];
        acc38 = new List<Account>();
        acc38 = [SELECT ID, Name, OwnerId, Armor_Territory__c, Status__c,Average_TAM_Score__c FROM Account WHERE Armor_Territory__c = 'South America' AND Status__c != 'Active' ORDER BY Average_TAM_Score__c DESC];
    }
    
    public PageReference save(){
        update acc;
        return null;
    }
    
    
    
}

And finally the test class, where the error is being reported when ran...
 
@isTest(SeeAllData = True)
public class ABMDashboardControllerTest {

    
    static testMethod void tm1() {
        
        Integer Score = 50;
        
        List<Account> accts = new List<Account>();
        
        Account a1 = new Account();
        a1.Name = 'Test 1';
        a1.Armor_Territory__c = 'Northwest';
        a1.Anywhere_Score__c = Score;
        a1.Complete_Score__c = Score;
        a1.Territory_Bypass__c = True;
        accts.add(a1);
        
        Account a2 = new Account();
        a2.Name = 'Test 2';
        a2.Armor_Territory__c = 'Northwest';
        a2.Anywhere_Score__c = Score;
        a2.Complete_Score__c = Score;
        a2.Territory_Bypass__c = True;
        accts.add(a2);
        insert accts;
        
       Test.startTest();
        Test.setCurrentPage(Page.ABMDashboard);
        ApexPages.StandardSetController stdSetController = new ApexPages.StandardSetController(accts);
        stdSetController.setSelected(accts);
        ABMDashboardController ext = new ABMDashboardController(stdSetController);
        ext.save();
        Test.stopTest();
    }
    
    
}

The error that is returned is as follows - 

Error: System.VisualforceException: Modified rows exist in the records collection!

Stack Trace: External entry point
Class.ABMDashboardControllerTest.tm1: line 32, column 1
Hi Friends,

I have a requirement to find all contacts with no related tasks or if they do have a task to filter out certain types.  When I start with a base SOQL Query on the workbench I get an error that Task is not supported from Semi Join inner select.  The base query is:  

SELECT Id, Name FROM Contact WHERE Id NOT IN (SELECT WhoID FROM Task). Is there another way to do this? 
We are having issues with some integration packages that query some of our salesforce objects and transfer the data to other platforms; however, occasionally there are fields that are deleted without our knowledge and we would like to find out before the packages run and break when a field is no longer found, so we would like to create a query to find Deleted custom fields.
We can see the CustomField object shows us new and/or changed fields but we don’t know how to query for recently deleted fields. Do you know of any soql query that will tell us that? 
Iunderstand that I will need to first  delete dashboard-components from dashboards but I don't see this object in DATALOADER when using delete.
Same questions with Report:  Is there a mehtod I could use to mass delete reports ? 
 Could you help me pls? thankyou 
I am using some simple code to execute an EditAccount method after an apex commandLink is clicked. But, I can't get the method to execute and cannot find a good solution after searching existing questions. Is there something wrong that I'm doing? Thanks

Visualforce page:
<apex:page controller="IMS_CP_Projects_controller1">
    <html>

    <body>
        <apex:form>
            <apex:outputPanel id="editaccounts">

                <table id="dataTable">
                    <thead>
                        <tr>
                            <th>Account Name</th>
                            <th>id</th>
                            <th>Edit</th>
                        </tr>
                    </thead>
                    <tbody>

                        <apex:repeat value="{!Accounts}" var="A">
                            <tr>
                                <td data-label="Name">{!A.Name}</td>
                                <td data-label="id">{!A.id}</td>
                                <td data-label="Edit">
                                    <apex:commandLink action="{!EditAccount}" value="Edit" id="editcmd">
                                        <apex:param assignTo="{!editid}" value="{!A.id}" name="editid" /> {!A.id}
                                    </apex:commandLink>
                                </td>
                            </tr>
                        </apex:repeat>
                    </tbody>
                </table>

            </apex:outputPanel>
        </apex:form>
    </body>

    </html>
</apex:page>

Custom Controller:
public class IMS_CP_Projects_controller1 {

	public string editid { get; set; }

	public transient List<Account> Accounts { get; set; }

	public IMS_CP_Projects_controller1() {
		Accounts = [SELECT id, name	FROM account LIMIT 20];
	}
  
	public void EditAccount() {
		System.debug('-------- Edit Account --------');
	}
	}

Thanks so much for helping.
While MavensMate is riding off into the sunset, it's going to remain relevant for a bit.  That said, what's The Thing to use moving forward to connect VS Code, Atom, or Sublime to the Salesforce backend?

Thanks,

Steve 
I created a lightning component to override the standard "new" opportunity. The problem is that when I implement the force:hasRecordId interface, the recordId shows in my debugger as "undefined". I need to use the current id of the account or contact to pre-populate fields in my component. How can I do this?

Here is the documentation I found, which seems to explain that recordId is undefined in my situation.

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_interfaces_force_hasrecordid.htm

The recordId attribute is set only when you place or invoke the component in an explicit record context. For example, when you place the component directly on a record page layout, or invoke it as an object-specific action from a record page or object home. In all other cases, such as when you invoke the component as a global action, or create the component programmatically inside another component, recordIdisn’t set, and your component shouldn’t depend on it.
These unsupported contexts include a few contexts that might seem like they should have access to the current record. Examples of these other contexts include the following:
Invoking the component from a global action (even when you’re on a record page)
Invoking the component from header or footer navigation in a community (even if the page shows a record)
force:hasRecordId and force:hasSObjectName are unsupported in these contexts. While the marker interfaces still add the relevant attribute to the component, accessing either attribute generally returns null or undefined.

Thanks for helping.

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.