• Sampath Suranji
  • SMARTIE
  • 780 Points
  • Member since 2018
  • Associate Tech Lead(salesforce)
  • EFutures


  • Chatter
    Feed
  • 26
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 0
    Questions
  • 146
    Replies
 {!v.BatchInstance.Discount_Type__c}
         <td>
            <ui:inputselect class="slds-input" value="{!v.BatchInstance.Discount_Type__c}" aura:id="disctype" change="{!c.discountvalidation}">
             <option value=""> - </option> 
             <option value="ServicePremium"> ServicePremium </option> 
             <option value="Service Rapide"> Service Rapide </option> 
              <option value="MOD/MOQ">     MOD/MOQ </option> 
        
             </ui:inputselect>   
        </td>

I cant able to show  "{!v.BatchInstance.Discount_Type__c}" value in ui:inputselect 

Outside of ui:inputselect it is showing the value .this value is retrieving from the database  
 
Here in this code below I have an opportunities array. When I click on diffferent tabs of the component the array should get filtered with the appropriate selection of the tab. When the page loads, clicking on the first tab loads the right data, but clicking on another one returns an empty list. I know the original items of the array will get overwritten when you click on the second tab. How do I do the filtering from the original items of the array? How do I go about coding that?. New to programming.

Please advise!
tabSelect: function (component, event, helper) {
        var sup = component.get("v.selTabId");
        let oppsAll = component.get("v.opps");            
        let oppsbySup = oppsAll.filter(x => { 
            return x.sumchans__Owner_Manager__c === sup;
        });       
        component.set("v.opps", oppsbySup);
    }
<apex:pageBlockSection collapsible="true">
<apex:pageBlockTable title="Leave record" value="{!lrs}" var="lr">
<apex:column >
<Apex:outputText value="{!lr.from_date__c}" />
</Apex:column>
 </apex:pageBlockTable>
</apex:pageBlockSection>




Controller extension for the code:

public with sharing class LeaveControllerExtension {

    public List<Leave_Request__c> lrs { get; set; }
    public LeaveControllerExtension(ApexPages.StandardController controller) {
         Leave_Request__c lr = (Leave_Request__c)controller.getRecord();
         lr.from_date__c = Date.Today();
         lr.to_date__c = Date.Today() + 1;
        
       String cui = UserInfo.getUserId() ;
       List<Leave_Request__c> lrs = [SELECT From_date__c , To_date__c , Approver__c 
                                     FROM Leave_request__c
                                    WHERE Resource__c = :cui] ;
        
    }    

}
Can we have space in the Multi select picklist value? On UI, it works and creates the record with this field however, using apex, if I pass space in the multiselect picklist field, it shows bad value error. Is there any limitation of multi picklist field? Please help.
can you please anyone help me how to write test class for below code.

public class UpdateOpptyController {

    @AuraEnabled
    public static void updateOpportunity(Opportunity oppty){
        UPDATE oppty;
    }
    
      @AuraEnabled
    public static Opportunity fetchOpportunityDetails(Id oppId) {
        List<Opportunity> lstOfStd = new List<Opportunity>();
        system.debug('=='+oppId);
        if(oppId != null) {
            lstOfStd = [SELECT Id, Name,checkbox1__c,Checkbox2__c,Checkbox3__c FROM Opportunity WHERE Id = :oppId];
            system.debug('=='+lstOfStd);
        }   
         
        if(!lstOfStd.isEmpty()){
            return lstOfStd.get(0);
        }
         
        
        return null;
    }
}
Hi,

I'm a bit stuck with a toggle checkbox in a lighting component datatable that should reflect a checkbox on the sobject (Contact.Active__c) in the datatable and update the specific checkbox when changed.

The datatable is a list of contacts related to the account that is opened in the screen. I would like to achieve the following scenarios:
  1. When the datatable is loaded the Toggle checkboxes in the SWITCH pane should reflect the true or false checkbox in the ACTIVE pane
  2. When the toggle checkbox is switched this should update the ACTIVE checkbox on the contact record to reflect the switched toggle checkbox
I cannot find a good example how to achieve this. Unfortunately the documentation regarding the ui:inputCheckbox is limited. I hope someone can help me with examples.

User-added image

APEX Controller
public class AccountsController1 {
    @AuraEnabled
    public static List <Contact> getAccounts(String aid) {
        system.debug('aid: ' +aid);
        List <Contact> Contacts = [SELECT Id, name,Email,Phone,Active__c  FROM Contact where AccountId=:aid ORDER BY createdDate ASC];
        System.debug('Contacts: ' +Contacts);
        return Contacts;
    }
}
Lightning component
<aura:component controller="AccountsController1" Implements="flexipage:availableForRecordHome,force:hasRecordId" >
    
    <aura:attribute name="contacts" type="List" />
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <!-- Use a data table from the Lightning Design System: https://www.lightningdesignsystem.com/components/data-tables/ -->
    <table class="slds-table slds-table_bordered slds-table_striped slds-table_cell-buffer slds-table_fixed-layout">
        <thead>
            <tr class="slds-text-heading_label">
                <th scope="col"><div class="slds-truncate" title="ID">ID</div></th>
                <th scope="col"><div class="slds-truncate" title="Name">Name</div></th>
                <th scope="col"><div class="slds-truncate" title="Email">Email</div></th>
                <th scope="col"><div class="slds-truncate" title="Phone">Phone</div></th>
                <th scope="col"><div class="slds-truncate" title="Active__c">Active</div></th>
                <th scope="col"><div class="slds-truncate" title="Switch">Switch</div></th>
                
            </tr>
        </thead>
        <tbody>
            <!-- Use the Apex model and controller to fetch server side data -->
            <aura:iteration items="{!v.contacts}" var="contact">
                <tr>
                    <th scope="row"><div class="slds-truncate" title="{!contact.Id}">{!contact.Id}</div></th>
                    <td><div class="slds-truncate" title="{!contact.Name}">{!contact.Name}</div></td>
                    <td><div class="slds-truncate" title="{!contact.Email}">{!contact.Email}</div></td>
                    <td><div class="slds-truncate" title="{!contact.Phone}">{!contact.Phone}</div></td>
                    <td><div class="slds-truncate" title="{!contact.Active__c}">{!contact.Active__c}</div></td>
                    <td>
                        <div class="slds-m-around--large">
                            <!--PART 1 for create toggle switch/checkbox form element-->    
                            <div class="slds-form-element">
                                <label class="slds-checkbox_toggle slds-grid">
                                    <span class="slds-form-element__label slds-m-bottom_none"></span>
                                    <ui:inputCheckbox change="{!c.selectChange}"/>
                                    
                                    <span id="toggle-desc" class="slds-checkbox_faux_container" aria-live="assertive">
                                        <span class="slds-checkbox_faux"></span>
                                        <span class="slds-checkbox_on">Active</span>
                                        <span class="slds-checkbox_off">Inactive</span>
                                    </span>
                                    
                                </label>
                            </div>
                            
                        </div>
                        
                    </td>
                    
                </tr>
            </aura:iteration>
        </tbody>
    </table>
</aura:component>

Lightning Component Controller
({
      doInit: function(component, event, helper) {
        // Fetch the account list from the Apex controller
        helper.getContactList(component);
      }
})
Lightning Component Helper
({
// Fetch the accounts from the Apex controller
      getContactList: function(component) {
        var action = component.get('c.getAccounts');
        action.setParams({
            "aid": component.get("v.recordId")
        });
        // Set up the callback
        var self = this;
        action.setCallback(this, function(actionResult) {
         component.set('v.contacts', actionResult.getReturnValue());
        });
        $A.enqueueAction(action);
      }
})


 
Hi All,
public class GenericClass {
    public static List<Contact> newContact = new List<Contact>();
    public static List<Contact> oldContact = new List<Contact>();
    public static Map<Id, Contact> newMapContact = new Map<Id, Contact>();
    public static Map<Id, Contact> oldMapContact = new Map<Id, Contact>();
    
    public static void GenericClassMethod(Map<Id, Contact> oldMapContact, Map<Id, Contact> newMapContact){
        List<History_Tracking__c> historiesToInsert = new List<History_Tracking__c>();
        for(Contact con : newMapContact.values()){
            Contact OldCon = oldMapContact.get(con.Id);
            
            
            for (String conField : ContactHistory()) {
                
                History_Tracking__c conHistory = createUpdateHistory(conField, oldCon, con);
                historiesToInsert.add(conHistory);
                
            }
            
        }
        
        
        if(!historiesToInsert.isEmpty()) {
            List<History_Tracking__c> historiesToInsertWithoutDuplicates = new List<History_Tracking__c>();
            Set<History_Tracking__c> historiesSet = new Set<History_Tracking__c>();
            historiesSet.addAll(historiesToInsert);
            historiesToInsertWithoutDuplicates.addAll(historiesSet);
            
            insert historiesToInsertWithoutDuplicates;
        }
    }
    
    
    private static History_Tracking__c createUpdateHistory(String field, Contact oldCon, Contact newCon) {
        History_Tracking__c      conHistory = new History_Tracking__c();
        conHistory.FieldName__c = field;
        conHistory.ObjectName__c = 'Contact';
        conHistory.ObjectId__c = oldCon.Id;
        String oldValue = String.ValueOf(oldCon.get(field));
        String newValue = String.ValueOf(newCon.get(field));
        
        conHistory.OldValue__c = oldValue;
        conHistory.NewValue__c = newValue;
        if (conHistory.OldValue__c != null) conHistory.OldValue__c = conHistory.OldValue__c.abbreviate(255);
        if (conHistory.NewValue__c != null) conHistory.NewValue__c = conHistory.NewValue__c.abbreviate(255);
        return conHistory;
    }

    public static  List<String> ContactHistory(){
        Map<String,FieldTracking__c> MapToFieldHistory = new Map<String,FieldTracking__c>();
        for(FieldTracking__c ft: [Select  Id, selectedField__c,Selectedobject__c from FieldTracking__c]){
            MapToFieldHistory.put(ft.Selectedobject__c, ft);
        }
        List<String> ListFieldTracking = new List<String>();
        String fieldValues =  String.valueOf(MapToFieldHistory.get('Contact').selectedField__c);
        ListFieldTracking.addAll(fieldValues.split(','));
        return ListFieldTracking;
    }
}
how to write a test class for it?
Any suggestions?
String jsonText = '{"Data": [{"attributes": {"type": "Contact","url":"/services/data/v35.0/sobjects/Contact/0036100000JUXKkAAP"},"Email":"positi@gmail.com","Description": "","Phone":"9999999","LastName": "sasumi"},{"attributes": {"type": "Contact","url":"/services/data/v35.0/sobjects/Contact/0036100000JUXKkAAP"},"Email":"edge@gmail.com","Description": "","Phone":"88888","LastName": "pavanTL"}]}';

Map<String, Object> deserialized = (Map<String, Object>)JSON.deserializeUntyped(jsonText);
List<Map<String, Object>> data = new List<Map<String, Object>>();
for (Object instance : (List<Object>)deserialized.get('Data')){
    data.add((Map<String, Object>)instance); 
}

String dataSerialize=JSON.serialize(data);
System.debug('dataSerialize...'+dataSerialize);
try
{
   SObject customObject = (SObject)JSON.deserialize(dataSerialize, Sobject.class);
    Database.upsert(customObject);
    System.debug(' customObject...: '+customObject);
}
catch(Exception ex)
{
    System.debug(' @@@@@ Don\'t visible '+ex.getMessage());
}

 
  • August 15, 2018
  • Like
  • 0
Hello All,

I have made two lightning component my example is when I select Account Rating it should display related Account record, I am not sure where I am doing mistake , can someone please help me.
My code is below:
// class
public with sharing class AccountRating {
	
    @AuraEnabled
    public static List<Account> AccMethod(RatParam){
        return [select Id,name,site,Rating from Account where Rating = : RatParam];        
    }
}
Lightning Component:
<aura:component >
    
    <aura:attribute name ="Acc" type="Account" />
    
    <div class="demo-only" style="width: 30rem;">
      <article class="slds-tile">
        <h3 class="slds-tile__title slds-truncate" title="Account Name"><a href="javascript:void(0);">{!v.Acc.Name}</a></h3>
        <div class="slds-tile__detail">
          <dl class="slds-list_horizontal slds-wrap">
            <dt class="slds-item_label slds-text-color_weak slds-truncate" title="First Label">Rating:</dt>
            <dd class="slds-item_detail slds-truncate" title="Description for first label">{!v.Acc.Rating}</dd>
            <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Second Label">Site:</dt>
            <dd class="slds-item_detail slds-truncate" title="Description for second label">{!v.Acc.Site}</dd>
          </dl>
        </div>
      </article>
    </div>
</aura:component>

Component: 2
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <aura:attribute Name = "Rating" type = "List" />
    
    <div class="slds-form-element">
      <label class="slds-form-element__label" for="select-01">Select Label</label>
      <div class="slds-form-element__control">
        <div class="slds-select_container">
          <select class="slds-select" id="select-01">
            <option value="selVal">Please select</option>
            <option>Hot</option>
            <option>Warm</option>
            <option>Cold</option>
          </select>
        </div>
      </div>
    </div>
    
    <aura:iteration items = "{!Rating}" var = "Rat" >
        <c:AccountRatingTile Acc = "{!Rat}" />
    </aura:iteration>
    
</aura:component>
Clientside Controller:
 
({
	AccRating : function(AccCom, event, helper) {
		var selValVal = AccCom.find("v.selVal");
        console.log(selValVal);
        var RatParam = selValVal.get("v.value");
        
        var searchAction =AccCom.get("c.AccMethod");
         searchAction.setParam("RatParam",RatParam);
        searchAction.setCallback(this,function(resp){
            AccCom.set("v.Acc",resp.getReturnValue());
            
        });
        $A.enqueueAction(searchAction);
	}
})

App:
<aura:application extends = "force:slds">
    <c:AccountRating />
</aura:application>


​Thanks.
 
  • August 15, 2018
  • Like
  • 0
event :recordDetailpage
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="BoatRecord_Id" type="String"/>
</aura:event>
component 1
<aura:registerEvent name="RecDetail_Event" type="c:recordDetailpage"/>


Helper Class
imgclick_helper:function(component,event,recId){
        var appEvent = $A.get("e.c:recordDetailpage");
        alert('recId from boat search..'+recId);
        appEvent.setParams({
            "BoatRecord_Id" : recId});
        appEvent.fire();
}

component 2
 
<aura:handler name="RecDetail_Event" event="c:recordDetailpage" action="{!c.Controller_RecDetail}"/>
controller_RecDetail
var selecteRecodID=event.getParam("BoatRecord_Id");
        component.set("v.selectedRec_id", selecteRecodID);


  • August 08, 2018
  • Like
  • 0
I have a lightning component that includes an apex class to return a string. I would like the string that is returned to set a value in an event listener in the component's doInit function.

I can tell that communityURL is eventually getting set with the right string, so my connection to the apex class is working. However, I believe because I'm using $A.enqueueAction(action), it's happening AFTER I've already tried to set vfOrigin. So my vfOrigin is null, instead of the returned string. But if I don't use $A.enqueueAction(action), it doesn't appear to call the apex class at all.

Any suggestions for what I'm missing?
 
({
    doInit : function(component, event, helper) {
        // create a one-time use instance of the getCommunityURL action
        // in the server-side controller
        var action = component.get("c.getCommunityURL");
        console.log("[mf] action: " + action);

        var communityURL = '';
        action.setCallback(this, function(response){
        	var state = response.getState();
            if (state === "SUCCESS"){
                // alert the user with the value returned from the server
                alert("From server: " + response.getReturnValue());
                communityURL = response.getReturnValue();
                
            } else {
                console.log(state);
            }
        });
        $A.enqueueAction(action);

		// this section handles the reCaptcha that is in the embedded VF page
		// when the reCaptcha passes, make the submit button clickable
        // TODO: update with correct origin for production     
        //let vfOrigin = "https://mflei-eventbritecommunity.cs61.force.com";
        alert('[MF] communityURL: ' + communityURL);
        let vfOrigin = communityURL;
        window.addEventListener("message", function(event) {
            console.log(event.data);
            if (event.origin !== vfOrigin) {
                // Not the expected origin: Reject the message!
                alert('vfOrigin: ' + vfOrigin);
                alert('Not the expected origin: ' + event.origin);
                return;
            } 
            if (event.data==="Unlock"){ 
              let myButton = component.find("myButton");
              myButton.set('v.disabled', false);
            }            
        }, false);
    },

 
Hello Community,

I am stuck to find the solution on my Trigger . I want to Optimize my trigger code because some one use Query in for loop and nested for loop. I am abel to run code for single record but not in bulk.
Here My code please help on this, Thanks In advance.
try{
            for(opportunity opportunityobj:trigger.new)
            {
                opportunity opptyofoldmap=trigger.oldmap.get(opportunityobj.id);
              if(opptyofoldmap.closeDate!=null&opptyofoldmap.closeDate!=opportunityobj.closeDate)
                {
                    Integer dueDate=opptyofoldmap.closeDate.daysBetween(opportunityobj.closeDate);
                     if(dueDate!=0 && dueDate > 0 )
                    {
                        
                        list<OpportunityLineItem> newopp=[select id,Revenue_Start_Date__c,Opportunityid, UnitPrice, 
                                                          Revenue_Exchange_Rate__c, TCV__c, contract_term__c, CYR__c, NYR__c
                                                          from OpportunityLineItem where Opportunityid=:opportunityobj.id AND Revenue_Start_Date__c < :opportunityobj.closeDate];
                        for(OpportunityLineItem OpportunityProductobject:newopp)
                        {
                            integer i=0;
                            OpportunityProductobject.Revenue_Start_Date__c=OpportunityProductobject.Revenue_Start_Date__c+dueDate;
                            
                            OpportunityProductupdate.add(OpportunityProductobject);
                        }
                    }
                }
            }    
        }

Thanks
Accky​
Hi All,
My task is  to create a visual force page by using apex class. In visualforce page there should be only id field and search butoon 
and my requirment as follows
there are 6 objects obj1,obj2,obj3,obj4,obj5,obj6
in which obj1 has realtion with obj2 & obj2 has realtion with obj3
& obj3 has realtion with obj4 & obj4 has realtion with obj5 & obj5 has realtion with obj6
but when i paste an record id in the search box i must get the related lists of all 6objects in one page.............

Thanks inadvance..........
Hi All,
I am trying to create new contact using Lightning component.
Here is my code:
<aura:component controller="CreateContact">
    <aura:attribute name="contacts" type="Contact[]"/>
    <aura:attribute name="contact" type="Contact" default="{'sobjectType': 'Contact',
                         'FirstName': '',
                         'LastName': ''
                         
                       }"/>
    <form class="slds-form--stacked">   
    <p>Name:
        <ui:inputText value="{!v.contact.Name}"/>
    </p>
       <div class="slds-form-element slds-is-required">
        <div class="slds-form-element__control">
    <p>FirstName:
        <ui:inputText aura:id="fstname"  value="{!v.contact.FirstName}"/>
    </p>
        </div>
        </div>
    <p>LastName:
        <ui:inputText value="{!v.contact.LastName}"/>
    </p>
    <p>Email:
        <ui:inputText value="{!v.contact.Email}"/>
    </p>
    <p>Phone:
        <ui:inputText value="{!v.contact.Phone}"/>
    </p>
    <div class="slds-form-element">
          <ui:button label="Submit"
              class="slds-button slds-button--brand"
              press="{!c.clickSubmit}"/>
      </div>
    </form>
</aura:component>

JS:
({
    clickSubmit : function(component, event, helper) {
        console.log('inside controller');
        var action=component.get("c.savecontact");
        console.log(" inside action variable");
        action.setParams({
        "Contact": contact
        //component.get("v.contacts")
         
    });
        action.setCallback(this,function(response){
         var state=response.getstate();
         var contacts = component.get("v.contacts");
            
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.contacts", response.getReturnValue());
            alert('Contact is created successfully');
        }
                           });
        $A.enqueueAction(action);
        
    }
})
apex:
public class CreateContact {
   @AuraEnabled
    public static void savecontact(){
        //account acc = new account();
       contact contact1;
        //contact1.accountId = acc.id;
        insert contact1;
        system.debug('contact1' +contact1);
    }

}

When I click on the submit button it is showing error as Action failed: c:CreateContacts$controller$clickSubmit [contact is not defined].
Failing descriptor: {c:CreateContacts$controller$clickSubmit}.Can anyone help me to fix this problem.

Thanks,
Sirisha
public class UploadAttachments
{
   @AuraEnabled
    public static Id saveChunk(Id parentId, String fileName, String base64Data, String contentType, String fileId) {
        // check if fileId id ''(Always blank in first chunk), then call the saveTheFile method,
        //  which is save the check data and return the attachemnt Id after insert, 
        //  next time (in else) we are call the appentTOFile() method
        //   for update the attachment with reamins chunks   
        if (fileId == '') {
            fileId = saveTheFile(parentId, fileName, base64Data, contentType);
        } else {
            appendToFile(fileId, base64Data);
        }
 
        return Id.valueOf(fileId);
    }
 
    public static Id saveTheFile(Id parentId, String fileName, String base64Data, String contentType) {
        base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8');
        
        Attachment oAttachment = new Attachment();
        oAttachment.parentId = parentId;
 
        oAttachment.Body = EncodingUtil.base64Decode(base64Data);
        oAttachment.Name = fileName;
        oAttachment.ContentType = contentType;

        insert oAttachment;
 
        return oAttachment.Id;
    }
 
    private static void appendToFile(Id fileId, String base64Data) {
        base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8');
 
        Attachment a = [
            SELECT Id, Body
            FROM Attachment
            WHERE Id =: fileId
        ];
 
        String existingBody = EncodingUtil.base64Encode(a.Body);
 
        a.Body = EncodingUtil.base64Decode(existingBody + base64Data);
 
        update a;
    }
    
    @AuraEnabled
    public static String return_account()
     {
         Schema.DescribeSObjectResult result = account.SObjectType.getDescribe();
         String objectIdPrefix = result.getKeyPrefix();
         
         String returnprtab ='/'+objectIdPrefix+'/o';
         
      
         return returnprtab;
     } 
}
public class Contact_Trigger_Handler {
	//whenever a new contact is created, create an event for it.
    public static void eventOnContact(List<contact> conList) {
        List<Event> eventList = new List<Event>();
        For(Contact c : conList){
            Event e = new Event();
            e.Subject=c.LastName;
            e.WhatId = c.accountId;
            e.whoId = c.Id;
            e.Type = 'Contact';
            e.IsAllDayEvent = true;                 	
        	e.StartDateTime = DateTime.now();
            e.EndDateTime=DateTime.now();
            eventList.add(e);            
        }
        insert eventList;        
    }
Test Class
-------------------------------------------------------
@isTest
    static void event(){
        Contact c = new Contact();
        c.lastName='Pawan';
        insert c;   
        Event e = new Event();
            e.Subject=c.lastName;
            e.WhatId = c.accountId;
            e.whoId = c.Id;
            e.Type = 'Contact';
            e.IsAllDayEvent = true;                 	
            e.StartDateTime = DateTime.now();
            e.EndDateTime=DateTime.now();           
        insert e;
        Integer count = [select count() from event limit 1];
        system.assertEquals(count, 1);
        system.assertEquals(e.Subject, c.lastName);
    }

 
Hi There, i am trying to work out how to produce a formula that will calculate the fee due based on the total fund value which can be populated in. The currency field which will be populated is called 'Total transfer value for Tiered Fee'. 

when this field is populated with a value i need the formula to calculate the following:

3% of the first £500k
2% of the next £250k
1% thereafter. If the total after calculating this, exceeds £30,000, i need this to deliver £30k as the maximum.

Any help would be greatly appreciated!

thanks,

Khan



 
Hi,
I'm trying to have dynamic dropdown list but I'm not sure how to communicate with controller. It shows error as "Invalid attribute "name": Source" in aura:attribute and aura:handler
UserDetails.cmp:
<aura:component implements="force:appHostable" >
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="standard:scan_card" alternativeText="Add User"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Add User</h1>
                <h2 class="slds-text-heading--medium">Add User</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
        <div aria-labelledby="newexpenseform">
        <!-- BOXED AREA -->
        <fieldset class="slds-box slds-theme--default slds-container--small">
        <legend id="newexpenseform" class="slds-text-heading--small 
          slds-p-vertical--medium">
          Add User
        </legend>
        <form class="slds-form--stacked">
            <aura:attribute name="users" type="List" />
    		<aura:attribute name="selectedUser" type="String" />
            <aura:handler name="init" value="{!this}" action="{!c.loadOptions}" />
            <lightning:select name="mySelect1" label="Select Role:" aura:id="mySelect1" value="{!v.selectedValue}">
        		<aura:iteration items="{!v.options}" var="item">
            		<option text="{!item.label}" value="{!item.value}" selected="{!item.selected}"/>
         		</aura:iteration>
    		</lightning:select>
        </form>
  
      </fieldset>
    </div>
</lightning:layoutItem>
</lightning:layout>
</aura:component>

UserDetailsController.js:
({
    loadOptions: function (component, event, helper) {
        var roles = [
            { value: "Manager", label: "Manager" },
            { value: "team", label: "team" }
         ];
         component.set("v.options", roles);
        
        var users = [
            { value: "x", label: "x" },
            { value: "y", label: "y" },
            { Value: "z" , label: "z"}
         ];
         component.set("v.users", users);
    }
})

 
I'm trying to clean up my SalesForce a bit, and realized I have many Opportunities that are duplicates of each other. For me, duplicate Opps means multiple opportunities with the same "Job Number" which is a custom field. I tried to make it a unique field, but it won't allow me to do that until all duplicates are deleted.

So I'm trying to write some code that finds all duplicates at once and lists them so I can go through and delete the redundant ones.

I would like to just write a function that loops through all the Opps and checks like this. (pseudo code)
 
for ( Opportunity O: All Opportunities)
    {
        for ( Opportunity I: All Opportunities)
        {
            if O.jobNumber == I.jobNumber
                display I;
        }
    }
I just don't know if theres anywhere to plug that in. A report maybe? Is there anywhere I can access the entire database of opportunities and find specific ones in this manner?
 
Hi,

Is it possible to get groupId and memberId when getting a groupMemberId from /sobjects/groupmember/deleted API ?

I am using this API to get notified regarding deleted group members.
The response is just groupMemberId, but since it was already deleted, its not in the groupMember table anymore.
How can I get the information about this ID (groupID, memberID) ?

Thanks in advance!
Hi!

I have a field against the Product object, Tags, which contains data such as the following, imported from a thrid-party system:
age:< 12 Months, assetcondition:BRONZE, location:LAVERTON, make:POS SYSTEM, model:3212, power:SIN10AMP, rentalstatus:AVAIL-W, serial:100285954, subcatcode:Swift Assets
When these Product records are created I want to use formulas in a Process Builder Workflow action to extract each "key:<value>" pair, storing all <value>'s in custom fields.

As an example based on the above, one of the formulas would search for "location:" and store "LAVERTON" as the value in a "location__c" field against the Product record. I'd want to do this for age, assetcondition, assetlocation, make etc etc.

I can see lots of examples of using LEFT and MID but haven't been able to create a dynamic enough formula - data in this tags field will vary a lot, so I can't specifiy exact start and end text positions.

Any advice appreciated!

Thanks
my code where it ppopulate the hourly rate field of team object from user hourly rate field if team hourly rate is null
trigger populate1 on Team__c (before insert , before update){ 
   Set<Id> idOwnerSet = new Set<Id>();
    List<Team__c> projectList = new List<Team__c>(); 
    for(Team__c obj : trigger.new)
    {
        if(obj.hourly_rate__c == null) {
            
            idOwnerSet.add(obj.Id);
            projectList.add(obj);
        }
       
    }    
    
    if(projectList.isEmpty()) return;
    
    Map<Id, User> userMap = new Map<Id, User>([SELECT Id, hourly_rate__c FROM User WHERE Id = :idOwnerSet]);
    
    if(userMap.isEmpty()) return;
    
    for(Team__c proj : projectList)
    {
        proj.hourly_rate__c = null;
        if(userMap.get(proj.Id).City != null)
        {
            proj.hourly_rate__c = userMap.get(proj.Id).hourly_rate__c;
        }
    }
      
}
my test class
@istest
public class testpopulate1 {
   @istest static  void checkrate(){
    team__c  proj= new team__c();
       proj.hourly_rate__c = null;
       insert proj;
      Profile pf= [Select Id from profile where Name='System Administrator'];

       User u = new User(
     LastName = 'last',
     Email = 'puser000@amamama.com',
     Username = 'puser000@amamama.com' + System.currentTimeMillis(),
     CompanyName = 'TEST',
     Title = 'title',
     Alias = 'alias',
     TimeZoneSidKey = 'America/Los_Angeles',
     EmailEncodingKey = 'UTF-8',
     LanguageLocaleKey = 'en_US',
     LocaleSidKey = 'en_US',
     city = 'Usa',
     hourly_rate__c = 30,
     ProfileId = pf.Id);
      insert u;
      
     system.assert(proj.hourly_rate__c == 30 );
      
   }


}
Consider the below code:
Page :
<apex:form >
      <table>
          <tr>
              <td>
                  Description: &nbsp;&nbsp;
              </td>
              <td>
                  <apex:inputTextarea value="{!dsc}" >
                      <apex:actionSupport reRender="searchResultPanel" event="onKeyUp"/>
                  </apex:inputTextarea>
              </td>
          </tr>
      </table>
<div>
          <apex:outputPanel id="searchResultPanel">
          {!dsc}
</apex:outputPanel>
      </div>

</apex:form>
</apex:page>

Controller :
public with sharing class BotPageController {
    public String dsc { get; set; }
    public BotPageController() {
        
    }


I want that whenever input is given in the textArea , it should be reflected on outputPanel in real time. without any submit button.
How to achieve this?
Basically I want the String to be stored in the controller variable as soon as it is changed on the page.
Hi All,
         my test class is giving following error:-Constructor not defined: [CloneOpportunityController].<Constructor>()
Test class is given below:-

@istest
public class CloneOpportunityControllerTest {
    Static testmethod void cloneOppTest(){
        String currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        test.startTest();
        Account a = new Account(Name='newAcct'); 
        insert a; 
        
        Opportunity oppt = new Opportunity(Name ='New opp',
                                           AccountID = a.ID,
                                           StageName = 'Customer Won',
                                           CloseDate = System.today()+10,
                                           Amount = 3000
                                          );
        insert oppt;
        
        Opportunity_Qualifier__c oq = [Select id, Opportunity_Name__c 
                                       from Opportunity_Qualifier__c 
                                       where Opportunity_Name__r.Id =: oppt.Id];
        
        Top_Business_Priorities_and_Outcomes__c tb  = new Top_Business_Priorities_and_Outcomes__c();
        tb.Opportunity_Qualifier__c = oq.Id;
        insert tb;
        
        Identified_Pain_MEDDIC__c ipMedicToInsert = new Identified_Pain_MEDDIC__c();
        ipMedicToInsert.Opportunity_Qualifier__c = oq.Id;
        insert ipMedicToInsert;
        
        Decision_Making_Role_MEDDICC__c dmRoleToInsert = new Decision_Making_Role_MEDDICC__c();
        dmRoleToInsert.Opportunity_Qualifier__c = oq.Id;
        insert dmRoleToInsert;
        
        Decision_Criteria__c dcToInsert = new Decision_Criteria__c();
        dcToInsert.Opportunity_Qualifier__c = oq.Id;
        insert dcToInsert;
        
        Competition_MEDDICC__c cmMedicToInsert = new Competition_MEDDICC__c();
        cmMedicToInsert.Opportunity_Qualifier__c = oq.Id;
        insert cmMedicToInsert;
        
        Relevant_Case_Studies_MEDDICC__c rcsMedicToInsert = new Relevant_Case_Studies_MEDDICC__c();
        rcsMedicToInsert.Opportunity_Qualifier__c = oq.Id;
        insert rcsMedicToInsert;
        
        Decision_Process_MEDDICC__c dpMedicToInsert = new Decision_Process_MEDDICC__c();
        dpMedicToInsert.Opportunity_Qualifier__c = oq.Id;
        insert dpMedicToInsert;
        
        UA_Teammate_Role__c uateamMateToInsert = new UA_Teammate_Role__c();
        uateamMateToInsert.Opportunity_Qualifier__c = oq.id;
        insert uateamMateToInsert;
         
        PageReference pageRef = Page.CloneOpportunity; 
        pageRef.getParameters().put('id', oppt.id);
        Test.setCurrentPage(pageRef);
        CloneOpportunityController co = new CloneOpportunityController();
        co.cloneOpportunity();
        test.stopTest();
     }          
     }
how to sove this error?
Any suggestions?
Hello everyone, i have the following trigger test class. When i run the test I get the System.NullPointerException: Attempt to de-reference a null object error in line 59,
@isTest
private class accountNameDupePreventer {

    static testMethod void myUnitTest() {
        // TO DO: implement unit test
        Test.startTest();
        // First make sure there are no accounts already in the system
        // that have the Accounts used for testing
        Set<String> testAccountNames = new Set<String>();
        testAccountNames.add('Test1Dup Inc.');
        testAccountNames.add('Test2Dup Inc.');
        testAccountNames.add('Test3Dup Inc.');
        System.assert([SELECT count() FROM Account WHERE Name IN :testAccountNames] == 0);
    
        // Seed the database with some accounts, and make sure they can be bulk inserted successfully.
        Account account1 = new Account(Name = 'Test1Dup Inc.', BillingCountry = 'United States', BillingState = 'Texas');
        Account account2 = new Account(Name = 'Test4Dup Inc.', BillingCountry = 'United States', BillingState = 'California');
        Account account3 = new Account(Name = 'Test5Dup Inc.', BillingCountry = 'United States', BillingState = 'Florida');
        Account[] accts = new Account[] { account1, account2, account3 };
        insert accts;
        
        // Now make sure that some of these accounts can be changed and
        // then bulk updated successfully. Note that account1 is not
        // being changed, but is still being passed to the update
        // call. This should be OK.
        account2.Name = 'Test2Dup Inc.';
        account3.Name = 'Test3Dup Inc.';
        update accts;
        
        // Make sure that single row account duplication prevention works on insert.
        Account dup1 = new Account(Name='Test1Dup Inc.', BillingCountry = 'United States');
        try {
            insert dup1;
            System.assert(false);
        } catch (DmlException e) {
            System.assert(e.getNumDml() == 1);
            System.assert(e.getDmlIndex(0) == 0);
            System.assert(e.getDmlFields(0).size() == 1);
            System.assert(e.getDmlFields(0)[0] == Account.Name);
            System.assert(e.getDmlMessage(0).indexOf(
            'An account with this account\'s name already exists.') > -1);
        }
        
        // Make sure that single row account duplication prevention works on update.
        dup1 = new Account(Id=account1.Id, Name='Test3Dup Inc.', BillingCountry = 'United States');
        try {
            update dup1;
            System.assert(false);
        } catch (DmlException e) {
            System.assert(e.getNumDml() == 1);
            System.assert(e.getDmlIndex(0) == 0);
            System.assert(e.getDmlFields(0).size() == 1);
            System.assert(e.getDmlFields(0)[0] == Account.Name);
            System.assert(e.getDmlMessage(0).indexOf(
            'An account with this account\'s name already exists.') > -1);
        }
        
        // Make sure that bulk account duplication prevention works on
        // insert. Note that the first item being inserted is fine,
        // but the second and third items are duplicates. Note also
        // that since at least one record insert fails, the entire
        // transaction will be rolled back.
        dup1 = new Account(Name='Test4Dup Inc.', BillingCountry = 'United States');
        Account dup2 = new Account(Name='Test2Dup Inc.', BillingCountry = 'United States');
        Account dup3 = new Account(Name='Test3Dup Inc.', BillingCountry = 'United States');
        Account[] dups = new Account[] {dup1, dup2, dup3};
        try {
            insert dups;
            System.assert(false);
        } catch (DmlException e) {
            // Num=2 because dup1 not fails
            System.assert(e.getNumDml() == 2);
            // dup2 fails
            System.assert(e.getDmlIndex(0) == 1);
            System.assert(e.getDmlFields(0).size() == 1);
            System.assert(e.getDmlFields(0)[0] == Account.Name);
            System.assert(e.getDmlMessage(0).indexOf(
            'An account with this account\'s name already exists.') > -1);
            // dup3 fails
            System.assert(e.getDmlIndex(1) == 2);
            System.assert(e.getDmlFields(1).size() == 1);
            System.assert(e.getDmlFields(1)[0] == Account.Name);
            System.assert(e.getDmlMessage(1).indexOf(
            'An account with this account\'s name already exists.') > -1);
        }
        
        // Make sure that bulk account duplication prevention works on
        // update. Note that the first item being updated is fine,
        // because the name is new, and the second item is
        // also fine, but in this case it's because the 
        // name doesn't change. The third case is flagged as an
        // error because it is a duplicate of the name of the
        // first account's value in the database, even though that value
        // is changing in this same update call. It would be an
        // interesting exercise to rewrite the trigger to allow this
        // case. Note also that since at least one record update
        // fails, the entire transaction will be rolled back.
        dup1 = new Account(Id=account1.id, Name='Test5Dup Inc.', BillingCountry = 'United States');
        dup2 = new Account(Id=account2.id, Name='Test2Dup Inc.', BillingCountry = 'United States');
        dup3 = new Account(Id=account3.id, Name='Test1Dup Inc.', BillingCountry = 'United States');
        dups = new Account[] {dup1, dup2, dup3};
        try {
            update dups;
            System.assert(false);
        } catch (DmlException e) {
            System.debug(e.getNumDml());
            System.debug(e.getDmlMessage(0));
            System.assert(e.getNumDml() == 1);
            System.assert(e.getDmlIndex(0) == 2);
            System.assert(e.getDmlFields(0).size() == 1);
            System.assert(e.getDmlFields(0)[0] == Account.Name);
            System.assert(e.getDmlMessage(0).indexOf(
            'An account with this account\'s name already exists.') > -1);
        }
        
        // Make sure that duplicates in the submission are caught when
        // inserting accounts. Note that this test also catches an
        // attempt to insert an account where there is an existing
        // duplicate.
        dup1 = new Account(Name='Test4Dup Inc.', BillingCountry = 'United States');
        dup2 = new Account(Name='Test4Dup Inc.', BillingCountry = 'United States');
        dup3 = new Account(Name='Test3Dup Inc.', BillingCountry = 'United States');
        dups = new Account[] {dup1, dup2, dup3};
        try {
                insert dups;
                System.assert(false);
        } catch (DmlException e) {
            System.assert(e.getNumDml() == 2);
            System.assert(e.getDmlIndex(0) == 1);
            System.assert(e.getDmlFields(0).size() == 1);
            System.assert(e.getDmlFields(0)[0] == Account.Name);
            System.assert(e.getDmlMessage(0).indexOf(
            'Another inserted/updated account from bulk operation has the same name.') > -1);
            System.assert(e.getDmlIndex(1) == 2);
            System.assert(e.getDmlFields(1).size() == 1);
            System.assert(e.getDmlFields(1)[0] == Account.Name);
            System.assert(e.getDmlMessage(1).indexOf(
            'An account with this account\'s name already exists.') > -1);
        }
        
        // Make sure that duplicates in the submission are caught when
        // updating accounts. Note that this test also catches an attempt
        // to update an account where there is an existing duplicate.
        dup1 = new Account(Id=account1.id, Name='Test4Dup Inc.', BillingCountry = 'United States');
        dup2 = new Account(Id=account2.id, Name='Test4Dup Inc.', BillingCountry = 'United States');
        dup3 = new Account(Id=account3.id, Name='Test2Dup Inc.', BillingCountry = 'United States');
        dups = new Account[] {dup1, dup2, dup3};
        try {
            update dups;
            System.assert(false);
        } catch (DmlException e) {
            System.assert(e.getNumDml() == 2);
            System.assert(e.getDmlIndex(0) == 1);
            System.assert(e.getDmlFields(0).size() == 1);
            System.assert(e.getDmlFields(0)[0] == Account.Name);
            System.assert(e.getDmlMessage(0).indexOf(
            'Another inserted/updated account from bulk operation has the same name.') > -1);
            System.assert(e.getDmlIndex(1) == 2);
            System.assert(e.getDmlFields(1).size() == 1);
            System.assert(e.getDmlFields(1)[0] == Account.Name);
            System.assert(e.getDmlMessage(1).indexOf(
            'An account with this account\'s name already exists.') > -1);
        }
        Test.stopTest();
    }
}

"System.assert(e.getDmlFields(0).size() == 1);", the error is thrown in this line. Can anyone tell me how to solve this?
ThanksinAdvance!
Hello,

I need your help to achieve this conditionnal markup in a lightning form :

I want to make a text input mandatory whenever the user checks Yes on another radio-group input :
<div class="slds-col slds-size_1-of-2">
                                <lightning:radioGroup name="  " 
                                                      options="{! v.yesNo }"
                                                      value="{! v.account.firstField}"
                                                      type="radio"
                                                      />
                            </div>

                            <div class="slds-col slds-size_1-of-2">
                                <lightning:input name=" " label="Label2"  value="{!v.account.secondField}"  />
                            </div>


 
  • December 25, 2018
  • Like
  • 0
Hi

I am getting "System.LimitException: Apex heap size too large: 67116041" error. Please find my below piece of code.

public static void checkC4StageLA(List<Account> accountList, Map<id,Account> oldMap){
        Transient Integer count = 0;
        List<Opportunity> oppList = new List<Opportunity>();
        
        system.debug('accountList '+accountList); 
        List<Account> accList = new List<Account>();
        Map<ID, List<Opportunity>> oppMap = new Map<ID, List<Opportunity>>();
        
        oppList = [SELECT ID, Name, AccountID, stageName FROM Opportunity WHERE AccountID IN : accountList];
         
         system.debug('accountList '+accountList); 
         if(oppList.size() > 0){
            List<Opportunity> tempOppList = new List<Opportunity>();
            for(Opportunity opp: oppList){ //Reason behind to write Query in for loop is: To avoid heap size limit exception.
                if(oppMap.containsKey(opp.AccountID)){
                    tempOppList.addAll(oppMap.get(opp.AccountID));    
                }
                tempOppList.add(opp);
                oppMap.put(opp.AccountID, tempOppList);    
            }
            
          }
          
          List<Profile> PROFILE = [SELECT Id, Name FROM Profile WHERE Id=:userinfo.getProfileId() LIMIT 1];
          String MyProflieName = PROFILE[0].Name;
          system.debug('MyProflieName  '+MyProflieName );
          
          for(Account acc: accountList){
              if(oppMap.containsKey(acc.ID) && oppMap.get(acc.ID).size() > 0){
                  for(Opportunity opp: oppMap.get(acc.ID)){
                      if(opp.stageName == 'C4- Payment Disbursed'){
                          System.debug('ID '+opp.ID);
                          count++;    
                      }
                  }
              }    
              
              System.debug('count '+count );
          //    System.debug('oppMap.get(acc.ID).size() '+oppMap.get(acc.ID).size());
              if(oppMap.get(acc.ID) != null){
                  if(count == oppMap.get(acc.ID).size() && (MyProflieName == 'Marketing Officer' || MyProflieName == 'Branch Manager') && oppMap.get(acc.ID) != null  ){
                      System.debug('count '+count+' oppMap.get(acc.ID).size() ' +oppMap.get(acc.ID).size());
                      acc.addError('You are not having authority to chage account details.');    
                  }
              }
              
              count = 0;
          }
            
    }
-------------------------------------------------------------------------------------------------------------------------------------------
This method I am calling in Before Update of Account Trigger.

Please suggest me, how I can resolve this error.

Thanks in advance,
Shruti Hasilkar.
Hi All,
        how to write the test class for the given class:-
public class SocialCaseNotificationsController {        
    public SocialCaseNotificationsController() {
    }
    
    public List<Case> getlistAccount() {
        Id userId = UserInfo.getUserId();
        return [SELECT Id, CaseNumber, 
                Status 
                FROM Case 
                WHERE (Status = 'Subsq Reopened – Biz Hours' 
                       OR Status = 'Subsq Reopened – Non-Biz Hours')  
                AND OwnerId =: userId 
                ORDER By lastModifiedDate DESC];
    }
    
    public PageReference refresh() {
        getlistAccount();
        return null;
    }
}
Any suggestions?
Hi everyone,

We have a method that sets the value of a variable / field called {!input}. This value is then read in a JavaScript function which immediately sets the value of another field / variable {!output}. The problem is that in order to have the value of {!input} available for the JavaScript to read, the form needs to be reRendered first.
 
Can this be achieved with just one commandButton?

Apex Class
public String input {get; set;}
      public String output {get; set;}
public void generateInput() {
      input = ‘some calculated value’;
}
VF Page
<apex:page>
<script type="text/javascript">
    function generateOutput(){
        var input = document.getElementById('{!$Component.input}').value;
        if(input) {
        var output = input + ‘some other value’;
        document.getElementById('{!$Component.output}').value = output;
        }
    }
</script>
<apex:form id="myForm">
    <apex:inputText id="input" value="{!input}"/>
    <apex:inputText id="output" value="{!output}"/>
    <apex:commandButton value="Generate Input" action="{!generateInput}" reRender="myForm"/>
    <apex:commandButton value="Generate Output" onclick="generateOuput()" reRender="myForm"/>
</apex:form>
How can the 2 actions be done with one click? -> if we try to combine the action and onclick of the 2 commandButttons and use them on the same button, on the first click of the button the output is created and only on the second click the input.

Thanks,
Mircea
Hi Experts,
I wrote one batch class with contractor like below. but when i was try to run my test class i am getting an error that constructor is not defind. below is my test class as well , can anyone help me plesae . thanks in advance
private  list<String> sOrganization;
public UpdateAccountCallList(String[] sorg) {
sOrganization = sorg;
}
 
 
Test class:
 
@isTest
public class AccountUpdatecallistBatchJobTest
{
static testMethod void testMethod1()
{
List<Account> lstAccount= new List<Account>();
List<Account> lstAccount1= new List<Account>();
List<Account> lstAccount2= new List<Account>();
List<Account> lstAccount3= new List<Account>();
List<Account> lstAccount4= new List<Account>();
List<Account> lstAccount5= new List<Account>();
for(Integer i=0 ;i <5;i++)
{
Account acc = new Account();
acc.Name =’Name’+i;
acc.Call_List_Frequency__c=8;
acc.Call_List__c=true;
acc.Call_List_Start_Date__c=system.today()-1;
acc.Call_List_Preferred_Day__c=’MOnday’;
date myDate = date.today();
acc.Call_List_Next_Preferred_Date__c=myDate.toStartofWeek()+0;
Account acc1 = new Account();
acc1.Name =’Name1’+i;
acc1.Call_List_Frequency__c=6.0;
acc1.Call_List__c=true;
acc1.Call_List_Start_Date__c=system.today()-1;
acc1.Call_List_Preferred_Day__c=’Tuesday’;
date myDate1 = date.today();
acc1.Call_List_Next_Preferred_Date__c=myDate1.toStartofWeek()+1;
lstAccount1.add(acc1);
Account acc2 = new Account();
acc2.Name =’Name1’+i;
acc2.Call_List_Frequency__c=6.0;
acc2.Call_List__c=true;
acc2.Call_List_Start_Date__c=system.today()+1;
acc2.Call_List_Preferred_Day__c=’Wednesday’;
date myDate2 = date.today();
acc2.Call_List_Next_Preferred_Date__c=myDate2.toStartofWeek()+2;
lstAccount2.add(acc2);
Account acc3 = new Account();
acc3.Name =’Name1’+i;
acc3.Call_List_Frequency__c=6.0;
acc3.Call_List__c=true;
acc3.Call_List_Start_Date__c=system.today()-1;
acc3.Call_List_Preferred_Day__c=’Thursday’;
date myDate3 = date.today();
acc3.Call_List_Next_Preferred_Date__c=myDate3.toStartofWeek()+3;
lstAccount3.add(acc3);
Account acc4 = new Account();
acc4.Name =’Name1’+i;
acc4.Call_List_Frequency__c=6.0;
acc4.Call_List__c=true;
acc4.Call_List_Start_Date__c=system.today()-1;
acc4.Call_List_Preferred_Day__c=’Friday’;
date myDate4 = date.today();
acc4.Call_List_Next_Preferred_Date__c=myDate4.toStartofWeek()+4;
lstAccount4.add(acc4);
Account acc5 = new Account();
acc5.Name =’Name1’+i;
acc5.Call_List_Frequency__c=6.0;
acc5.Call_List__c=true;
acc5.Call_List_Start_Date__c=system.today()-1;
acc5.Call_List_Preferred_Day__c=’None’;
acc5.Call_List_Next_Preferred_Date__c=system.today();
lstAccount5.add(acc5);
}
insert lstAccount;
insert lstAccount1;
insert lstAccount2;
insert lstAccount3;
insert lstAccount4;
insert lstAccount5;
Test.startTest();
UpdateAccountCallList obj = new UpdateAccountCallList();
obj.currentweek=9;
DataBase.executeBatch(obj);
Test.stopTest();
}
}
 {!v.BatchInstance.Discount_Type__c}
         <td>
            <ui:inputselect class="slds-input" value="{!v.BatchInstance.Discount_Type__c}" aura:id="disctype" change="{!c.discountvalidation}">
             <option value=""> - </option> 
             <option value="ServicePremium"> ServicePremium </option> 
             <option value="Service Rapide"> Service Rapide </option> 
              <option value="MOD/MOQ">     MOD/MOQ </option> 
        
             </ui:inputselect>   
        </td>

I cant able to show  "{!v.BatchInstance.Discount_Type__c}" value in ui:inputselect 

Outside of ui:inputselect it is showing the value .this value is retrieving from the database  
 
Here in this code below I have an opportunities array. When I click on diffferent tabs of the component the array should get filtered with the appropriate selection of the tab. When the page loads, clicking on the first tab loads the right data, but clicking on another one returns an empty list. I know the original items of the array will get overwritten when you click on the second tab. How do I do the filtering from the original items of the array? How do I go about coding that?. New to programming.

Please advise!
tabSelect: function (component, event, helper) {
        var sup = component.get("v.selTabId");
        let oppsAll = component.get("v.opps");            
        let oppsbySup = oppsAll.filter(x => { 
            return x.sumchans__Owner_Manager__c === sup;
        });       
        component.set("v.opps", oppsbySup);
    }
Hello,

As i am trying to achieve the code coverage but am not getting in batch apex,i have been seen the example share on the community,but please look into the below code:
global class batchApexForLocationBase implements database.Batchable <Sobject>{
    
    global database.QueryLocator start(database.BatchableContext bc){
        String s = '@@@@@****';
        return database.getQueryLocator('select id,name,Location__c,owner.name from lead where owner.name=:s');
    }
    global void execute (database.BatchableContext bc,list<lead> scpe){
        
        user u=[select id,name,alias from user where alias='nshar'];
        list<task> myTask=new list<Task>();
        for(lead l:scpe){
            
            if(l.location__C==null || l.Location__c==''){
                l.ownerId=u.id;
                task ts=new task();
                ts.Status='Not Started';
                ts.Subject='Checking for OwnerChange';
                ts.Priority='Normal';
                ts.whoId=l.Id;
                myTask.add(ts);
            }
        }
        update scpe;
        insert myTask;
    }
    global void finish(database.BatchableContext bc ){
    }
    
}
test class
========
@istest
public class testBatchApexForLocationBase {
    @istest
    static void myTestMethod(){
        list<lead> myLead=new list<lead>();
        for(integer i=0;i<200;i++){
            lead l=new lead(lastName='testingclass' +i,company='testing');
            myLead.add(l);
            
        }
        insert myLead;
        system.test.startTest();
        batchApexForLocationBase nw=new batchApexForLocationBase();
        database.executeBatch(nw);
        system.test.stopTest();
        
    }
    
    
}
Hello, I have a Visual Force Page that displays a table of information / records. Each row has a checkbox to represent if it has been selected or not.
There is a button called "Quote Selected".

My goal here is when this button is pressed, all the items on the table that are selected have their information / ids passed to a list in another Apex controller that can be used on my 2nd VFP to generate a quote.

VFP:
<apex:form>
            <table width="100%" class="data-table">
                <tr class="headerRow">
                    <th>Select</th>
                    <th>SUPPLIER</th>
                    <th>DAY RATE</th>
                    <th>STANDING CHARGE</th>
                    <th>TERM</th>
                    <th>ANNUAL CHARGE</th>
                    <th>TOTAL AMOUNT</th>
                    <th>EXTRA INFORMATION</th>
                </tr>
                <apex:repeat value="{!data}" var="Results">
                    <tr>
                        <td>{!Results}<input type="checkbox" value="{!Results}"/></td>
                     	<td><apex:outputField value="{!Results.Supplier__c}"/></td>
                     	<td><apex:outputField value="{!Results.Day_Rate__c}"/></td>
                     	<td><apex:outputField value="{!Results.Standing_Charge__c}"/></td>
                     	<td><apex:outputField value="{!Results.Term__c}"/></td>
                     	<td><apex:outputField value="{!Results.Annual_Charge__c}"/></td>
                     	<td><apex:outputField value="{!Results.Total_Amount__c}"/></td>   
                     	<td><apex:outputField value="{!Results.Extra_Info__c}"/></td>
		    </tr>
                </apex:repeat>
		</table>

		<apex:commandButton action="{!quoteSelected}" value="Quote Selected"/>
        </apex:form>

 
Hi there.

We are looking for a dull time/direct hire Salesforce Devloper. Please see the job description below or visit the job posting at: https://www.ziprecruiter.com/job/7ad3fc79 

Company:     ISYS Solutions
Location:       2601 Saturn St, Suite 300, Brea, CA  92821
Industry:      Healthcare
Position:       Salesforce Devloper


Responsible for the development, deployment, technical implementation (including routine coding), and maintenance of ISYS’ highly customized CRM platform in accordance with ISYS’ organizational needs and operational plans.
 
Will proactively train, motivate, develop, and mentor all IT department staff by providing training on salesforce and other web platforms routinely.
 
Will positively develop and maintain constructive and collegial professional and productive relationships with outside vendors within the Salesforce and web development/programming realm, which will enable ISYS’ continued model as the “Best in Class” within the industry by maintaining our quality and efficiency through technological resources.
 
ESSENTIAL JOB FUNCTIONS:
  • Lead and implement the development lifecycle and roll-out process for all Salesforce.com updates, changes and initiatives organization wide with a high degree of quality and accuracy (analysis, design, coding, configuration, testing, and deployment for all projects).
  • Effectively prioritize projects based on their urgency, relevance, size and scope. Troubleshoot and resolve user issues for SFDC by performing extensive root cause analysis to ensure non re-occurrence of defects and direct them to responsible groups.
  • Create and/or update Requirement, Process, Functional, and Technical documentation.
  • Provide advice and assistance to others in the department on Salesforce administration tasks.
  • Manage all Salesforce related software, applications and integrations.
  • Monitor and analyze site metrics, system performance and user activity routinely.
  • Perform frequent data analyses to ensure accuracy of data quality and assist in any data clean up that may be needed.
  • Monitor the progress of multiple Salesforce related projects concurrently.
  • Manage and routinely test organization’s storage, backup and retrieval systems and strategy in relation to Salesforce.com.
KNOWLEDGE, SKILLS, AND ABILITIES:
  • Demonstrated ability to code and program in APEX and Java.
  • Detailed knowledge of and ability to act as a Salesforce administrator.
  • Demonstrated knowledge of the Salesforce.com sales cloud development environment including but not limited to items such as custom objects, declarative functionality, workflows, triggers, visualforce, migration tools and SOQL.
  • Detailed understanding of the Salesforce classic, Salesforce lightning and Salesforce sandbox platform development environments.
  • Familiarity with Salesforce applications (AppExchange) and integrations.
  • Strong reading and writing with excellent understanding of the English language, grammar, and punctuation. Strong interpersonal and communication skills.
  • Understands the importance of Entity (Object) Relationships and how to implement them in Salesforce, via lookups, master-detail and custom junctions.
  • Able to design and configure security/sharing rules, permission sets, field level security, record level security, roles and profiles
  • Demonstrated ability to work autonomously, collaboratively and collegially, with minimal supervision.
  • Ability to maintain confidentiality and a high regard for proprietary business information.
  • Ability to organize multiple concurrent work assignments and establish priorities.
  • Ability and willingness to work evening or weekends on occasion or in emergencies.
EDUCATION AND EXPERIENCE:
 
Required:
  • 3+ years developer-level familiarity with the Salesforce sales cloud platform.
  • 3+ years Apex/visual force and Force.com experience
  • Salesforce Developer Certification (Platform Developer I or higher)
  • Experience with the Salesforce Classic and Lightning platform
  • Experience working with external partners and vendor relationships
  • ISYS on-the-job training
Preferred:
  • 5+ years developer-level familiarity with the Salesforce sales cloud platform.
  • 5+ years Apex/visual force and Force.com experience
  • Bachelor’s Degree or higher in Computer Science or related field
  • Experience working as a salesforce administrator
  • General web development experience (Java, JavaScript, HTML, CSS, Ajax, PHP, API, etc.)
SALARY:
 
$100,000+ DOE. Bonus potential.
 
Potential relocation assistance available.
 
Benefits package with tax deferred retirement program, flexibility in schedule, medical, dental, and vision insurance, and LTD disability insurance.
 
JOB LOCATION:
 
ISYS corporate offices in Brea, CA. Flexible schedule with work from home potential.
 
ISYS is celebrating our 20th anniversary this year. Check us out at: www.isyscm.com
Salesforce Developer
Engineering | Edinburgh 
We’re looking for two enthusiastic developers to get the most out of salesforce within our cutting edge engineering team.

You'll be responsible for getting data out of the salesforce platform used by our sales and support team and whilst working closely with our BackEnd and FrontEnd engineering teams. You will receive a great deal of autonomy in your design decisions along with support from your colleagues, squad lead, technical manager and product manager.
Go where the people speak your language.
“We’re entering a new world in which data may be more important than software.”- Tim O’Reilly
If you also believe in the importance of data, this is what you might expect to be doing day to day;
Create customised reports from salesforce data
Create customised dashboards
Work closely with a technical product manager
Work in an agile method
As with all engineering at iZettle, this could be just the beginning. We aspire to never stop growing and encourage all staff, old and new, to suggest improvements to what they do.
We hire people. Not CVs
We’re building a platform that enables our customers to leverage their data in a way that allows them to make the best possible decisions to grow their business as effectively as possible. To achieve this we need to take the next step to make better use of our own data so that we can grow more effectively ourselves.  

What do you need to bring to the role;
A knowledge of Java or Go
Knowledge of Apex & SQL
Fluency in Javascript or Javascript compilable languages
 
Small minds never helped small businesses.
It takes originality and an open mind to start a small business.  That’s why small minds have no place in ours. At iZettle, we celebrate the individuality of the people we work with, valuing the impact that diverse experiences, backgrounds, perspectives and ideas can have on our culture and the products we build. We’re proud to be an equal opportunities employer, a place where everyone can benefit from equal access to professional development and bring their whole personality to work.
We’re iZettle.
iZettle is on a mission to help small businesses succeed in a world of giants. Founded in Stockholm in 2010, we revolutionised mobile payments with the world’s first mini chip card reader and software for mobile devices. Today iZettle’s commerce platform for small businesses in Europe and Latin America provides tools to get paid, sell smarter and grow your business. We’re more than 500 employees of 45 different nationalities operating in 12 countries, and we’re recruiting the best and brightest from around the world to help us grow further.
Rare opportunity to join a Fortune 500 technology team in NYC.  Our client is looking for a seasoned Salesforce Developer to join their tech group.
Some requirements include: Bachelor's degree, 2 or more years as a full-time Salesforce Developer (expertise with APIs, Apex, Visualforce, etc.), experience with Lightning, agile, JavaScript, XML, JSON, SOQL, SOAP, REST Web Services, HTML-Experience working in an agile environment and excellent communication and customer service skills.

Additional Information:
*Full-time, salaried position
*On-site
​*CLIENT CANNOT PROVIDE SPONSORSHIP OR WORK C2C AT THIS TIME*