• edralph
  • NEWBIE
  • 65 Points
  • Member since 2018

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 16
    Replies
LWC- Use Lightning Data Service to Work with Data
HTML
<template>
    <lightning-card>
        <lightning-record-form
            object-api-name={contact}
            fields={fields}
            onsuccess={handleSuccess}>
        </lightning-record-form>
    </lightning-card>
</template>

JS
import { LightningElement } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import CONTACT_OBJECT from '@salesforce/schema/contact';
import getContacts from '@salesforce/apex/ContactController.getContacts';
import NAME_FIELD from '@salesforce/schema/contact.Name';
import EMAIL_FIELD from '@salesforce/schema/contact.Email';
export default class ContactCreator extends LightningElement {
    objectApiName = CONTACT_OBJECT;
    fields = [NAME_FIELD, EMAIL_FIELD];
    handleSuccess(event) {
        const toastEvent = new ShowToastEvent({
            title: "Contact created",
            message: "Record ID: " + event.detail.id,
            variant: "success"
        });
        this.dispatchEvent(toastEvent);
    }
}

meta XML
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>
Thanks in Advance
I have Two List of object records.
List<Account> accList1 = {1st record, 2nd record, 3rd record, 4th record};
List<Account> accList2 = {1st record, 3rd record};
 
I have another List<Account> accList3 = new List<Account>()
now I want to compare both List list1 and list2, get the record from list1 which is not present in list2 and add to List3.
 
Quick question: I have a before update trigger on the Lead object and would like to know what happens in this scenario:

1. Bulk data import of leads (let's say 1000) cause it to fire.  It'll fire 5 times if the batch size is 200.
2. During the processing of one of the batches of 200 above, a web service pushes a Lead into the system, firing the same trigger.

Will the trigger in 2 wait for one of the batches of 200 to finish before executing or will it run while the (same) trigger in 1 is halfway through processing a batch of leads?
 
LWC- Use Lightning Data Service to Work with Data
HTML
<template>
    <lightning-card>
        <lightning-record-form
            object-api-name={contact}
            fields={fields}
            onsuccess={handleSuccess}>
        </lightning-record-form>
    </lightning-card>
</template>

JS
import { LightningElement } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import CONTACT_OBJECT from '@salesforce/schema/contact';
import getContacts from '@salesforce/apex/ContactController.getContacts';
import NAME_FIELD from '@salesforce/schema/contact.Name';
import EMAIL_FIELD from '@salesforce/schema/contact.Email';
export default class ContactCreator extends LightningElement {
    objectApiName = CONTACT_OBJECT;
    fields = [NAME_FIELD, EMAIL_FIELD];
    handleSuccess(event) {
        const toastEvent = new ShowToastEvent({
            title: "Contact created",
            message: "Record ID: " + event.detail.id,
            variant: "success"
        });
        this.dispatchEvent(toastEvent);
    }
}

meta XML
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>
Thanks in Advance
I have Two List of object records.
List<Account> accList1 = {1st record, 2nd record, 3rd record, 4th record};
List<Account> accList2 = {1st record, 3rd record};
 
I have another List<Account> accList3 = new List<Account>()
now I want to compare both List list1 and list2, get the record from list1 which is not present in list2 and add to List3.
 
User-added imageUser-added imageUser-added imageLead is successfully converted is showing but not converting.
Since a week or so I suddenly get `INVALID_SESSION_ID: Session expired or invalid` errors when trying to deploy to a sandbox. Around the same time, I suddenly started seeing the line `*** Deploying with REST ***` when running an `sfdx force:source:deploy`.

I never used to see my token expire before. Now I have to daily go and re-auth my org connection.

This seems like a regression. What's going on?
Hi All, 

Can anybody provide me a link to a managed package that might have deprecated fields on either of Leads or Contacts or Accounts? 

I've installed several free apps from Appexchange but no luck yet. 

If you know any, can you please let me know? 

Thank you,
Dippan 
Write a Trigger to assign leads in a Round Robin manner. Create a Queue & add 3 users to it. Whenever a lead is assigned to that Queue, Reassign the Lead to one of the Users in the Queue in a record robin manner.
Hi, 

I have a requirement where I need to round robin leads to two groups of users (SDRs and Account Execs). If lead has xyz fields filled out, it should round robin to the account execs. However, if the fields are not filled out, it should round robin to SDRs. Has anyone seen a good way to do this?

We have a onshore queue, it should automatically get routed to one of the Pods queue through a round robin basis. We have Pod 1, Pod 2, Pod 3, Pod 4. Need to distribute cases evenly through round robin


Please help

Hi,
I'm trying to create a Round Robin and are almost done i need help with one formula. I need to add a checkbox__c is true or a picklist value is <> "Value" to the formula under. I want it to loop 1,2,3 only when recordtype "US_Request_a_Quote" and if checkbox__c is true or a picklist value is not equal to ""

IF( RecordType.Name = "US_Request_a_Quote", 
MOD(VALUE(Round_Robin_Opportunity__c) ,3) +1, 
NULL)
Quick question: I have a before update trigger on the Lead object and would like to know what happens in this scenario:

1. Bulk data import of leads (let's say 1000) cause it to fire.  It'll fire 5 times if the batch size is 200.
2. During the processing of one of the batches of 200 above, a web service pushes a Lead into the system, firing the same trigger.

Will the trigger in 2 wait for one of the batches of 200 to finish before executing or will it run while the (same) trigger in 1 is halfway through processing a batch of leads?
 
I would like to create a round assignment on the opportunity object. So when an opportunity is created, an account name will be added to the opportunity (based off of a picklist of three account names). I see that there isn't an assignment rule option on the opportunity object, so I created an assignment rule on the case object for the account names. Right now I'm stuck on the soql statement [Select ID From Account Where Name in: oppList.id]. I receive a debug statement of Variable does not exist: id.  Is there a way for me to reference the assignment rule id so that it loops through the three account names?

trigger NewAcc on Opportunity (after insert) {
   
    List<Opportunity> oppList = new  List<Opportunity>();
    AssignmentRule ar = new AssignmentRule();
    ar = [SELECT ID FROM AssignmentRule where SobjectType = 'Case'and ID = '01Q360000001zcv' and Active = true limit 1];
      
  Case newCase = new Case(Status = 'new');
  Database.DMLOptions dmlOpts = new Database.DMLOptions();
        newCase.setOptions(dmlOpts);    

  Account acct = [SELECT Id From Account Where NAME in: oppList.id  ]

    for(Opportunity opp: Trigger.new){
          
        opp.AccountId = acct.Id;
        oppList.add(opp);
 
    }
insert newCase;
insert oppList;
}
  • July 04, 2017
  • Like
  • 0
Hi,

I need to perform round robin logic for Task Creation. I have a queue "ABC" and it have 5 users. So If i create 9 tasks by bulk insert, 

user 1 - Task 1
User 2 - task 2 
User 3 - Task 3, 
User 4 - Task 4,
User 5 - Task 5,
User 1- Task 6,
User 2 - Task 7,
User 3- Task 8,
User 4 - Task 9.

I need the above logic needs to implement. and If I again insert 3 Task in Bulk Insert,
Now,
User 5 - Task 1,
User 1 - Task 2,
User 2 - Task 3

Thanks,
Jam
Hi guys,

I have created a round robin lead assignment in salesforce using auto  number and then a formula on it to divide the auto number with number of users. But it is not evenly disctributing among the sales people as exoected. I want the round robin to work only on a subset of leads but not all. Is there any way to achieve this?

 
Hi,

I would like to assign user when contact is creating using round robin or like lead assignment. I refer to lead assignment rules but it will work for cases and Leads. Can anyone please suggest some thoughts to assign it for contact object.
I have Two List of object records.
List<Account> accList1 = {1st record, 2nd record, 3rd record, 4th record};
List<Account> accList2 = {1st record, 3rd record};
 
I have another List<Account> accList3 = new List<Account>()
now I want to compare both List list1 and list2, get the record from list1 which is not present in list2 and add to List3.