• Dileep Katari
  • NEWBIE
  • 110 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 8
    Replies
We are going to have a new permission set called "Supplier Merge Tool Access". Users who are assigned with this permission set should only be able to merge account records of record type "Supplier" and be blocked from merging any other records of other record types 

Blocked scenarios
Supplier with record type A
Record Type A with Supplier 

Not to be blocked 
Supplier with Supplier 

The below logic is working when Supplier record is the main account but when Supplier record is the dupe record, merge is happening. Ideally it should not 

List<User> UserList = new List<User>();     
       UserList = [Select Id from User where Id IN(SELECT AssigneeId FROM PermissionSetAssignment WHERE PermissionSet.Name = 'Supplier_Merge_Tool_access')];
       
        for(User u : UserList){
           if (UserInfo.getUserId() == u.id) {
                for(Account a : (List<Account>)olditems.values()) {
                    
                             if( a.RecordType.Name != 'Supplier' ) {
                                 
                                a.addError('You are only authorized to merge a Supplier account with another Supplier account');
                                
                      
Product_Purchase_Date__c, Product_Total_Warranty_Days__c, Product_Has_Extended_Warranty__c are the custom fields on Case object. I am trying to summarise them within a text and display on the 'Warranty_Summary__c '  field

Any help would be appreciated. Thank you!

trigger WarrantySummary on Case (before insert) {
    
    
    
    for(Case nCase : Trigger.new){
        //Setting up variable to use in the summary field
        String purchaseDate             = nCase.Product_Purchase_Date__c.format();
        String createdDate                 = DateTime.now().format();
        Integer totalNoOfWarrantyDays    = nCase.Product_Total_Warranty_Days__c.intValue();
        Decimal warrantyPercentage      = (100 * (nCase.Product_Purchase_Date__c.daysBetween(Date.today()) 
                                          / nCase.Product_Total_Warranty_Days__c)).setScale(2);
        Boolean hasExtendedWarranty     = nCase.Product_Has_Extended_Warranty__c;
        
        //Populating the summary field
        nCase.Warranty_Summary__c       = 'Product purchased on ' + purchaseDate + ' ' + 'and case created on ' + createdDate + '.\n' 
                                        + 'Warranty is for ' + totalNoOfWarrantyDays + ' ' + 'days and is ' + warrantyPercentage + 
                                        '% through its warrant period.\n' + 'Extended warranty: ' + hasExtendedWarranty + '/n' + 
                                        + 'Have a nice day!';
        
        
                                        
       }
}
Salesforce licenses in our org regularly get used up and we are forced to run an audit every once in awhile and downgrade users to platform license. But this is going to cause delay in granting access to users in need. 

When the number of remaining licenses comes down to say 25 or 50, our users need to wait until our audit gets completed.

Can we avoid this?  Basically the ask is whether the "Company Information", Total number of licenses, used, remaining details on setup can be exported and scheduled via code and received as an email. Any help would be appreciated. 

Thank you!
Requirement: 
Three cities 
First Click on the lightning card
First city should display and continue to display
Second click on the lightning card
Second city should display and continue to display
Third click on the lightning card
Third city should display and continue to display

Ex : Upon first click, Tirupati should display 
Upon second click, Nellore should display
Upon third click, Kanchipuram should display
and finally all three city values shoudl continue to display like that 

I could come up with the below code but it is static. I am new to LWC, please help. Thank you.

JS : 
import { LightningElement,track } from 'lwc';
export default class ConditionalRenderingExample extends LightningElement {
 
 
  city;
  
  @track cityList =  ['Tirupati', 'Nellore', 'Kanchipuram'];
  
  showCityHandler(event){ 
  
   this.city = target.event.value;
   
    }   
  
}

HTML : 
<template>
       <lightning-card onclick={showCityHandler}>
         <template for:each={cityList} for:item="city">
               <p key={city}>{city}</p>
         </template>
       </lightning-card>
</template>
Trigger UpdateOwnerOfContact on Account(before update) {
 //Map to collect account id with changed owner id(user id ) .
 Map<Id,Id> accIdWithOwnerIdMap = new Map<Id,Id>();
 List<Contact> listOfContactsToUpdate = new List<Contact>();
 for(Account currentAccount : trigger.new) {
     if(currentAccount.OwnerId != Trigger.oldMap.get(currentAccount.Id).OwnerId){
        accIdWithOwnerIdMap.put(currentAccount.Id,currentAccount.OwnerId);
     }         
 }
 if(!accIdWithOwnerIdMap.isEmpty()){
  for(Contact con: [SELECT Id, OwnerId, AccountId FROM Contact 
                    WHERE AccountId IN :accIdWithOwnerIdMap.keySet() ]) {
   con.OwnerId = accIdWithOwnerIdMap.get(con.AccountId);
   listOfContactsToUpdate.add(con);
  }
 }
 if(!listOfContactsToUpdate.isEmpty()) {
  try{
   update listOfContactsToUpdate;
  }catch(DmlException de){
   System.debug(de);
  }
  
 }
}   
If count of contacts has a value 2, 2 contacts should be created on the account inserted, if its 3, 3 contacts should be created on the inserted account. 

Can you please help me debug or correct this? receiving null pointer  error. 

trigger CoCLikeNumberofContacts on Account (before insert) {
    
    List<Contact> conList = new List<Contact>();
    Account a = new Account();
    integer b = a.Count_of_Contacts__c.intValue();
    
        
    for(Account a : trigger.new) {
        
        
        if(b > 0) {
           
            
               for(integer b = 0; b > 0; b++) {
                  
               conList.add(new Contact(Lastname = a.Name, AccountId = a.Id)); 
             
                
            }
        }
        insert conList;
        
    }         
}
Account and AccountHistory are two custom objects. When account record is deleted, one record of accounthistory should be created.
Product_Purchase_Date__c, Product_Total_Warranty_Days__c, Product_Has_Extended_Warranty__c are the custom fields on Case object. I am trying to summarise them within a text and display on the 'Warranty_Summary__c '  field

Any help would be appreciated. Thank you!

trigger WarrantySummary on Case (before insert) {
    
    
    
    for(Case nCase : Trigger.new){
        //Setting up variable to use in the summary field
        String purchaseDate             = nCase.Product_Purchase_Date__c.format();
        String createdDate                 = DateTime.now().format();
        Integer totalNoOfWarrantyDays    = nCase.Product_Total_Warranty_Days__c.intValue();
        Decimal warrantyPercentage      = (100 * (nCase.Product_Purchase_Date__c.daysBetween(Date.today()) 
                                          / nCase.Product_Total_Warranty_Days__c)).setScale(2);
        Boolean hasExtendedWarranty     = nCase.Product_Has_Extended_Warranty__c;
        
        //Populating the summary field
        nCase.Warranty_Summary__c       = 'Product purchased on ' + purchaseDate + ' ' + 'and case created on ' + createdDate + '.\n' 
                                        + 'Warranty is for ' + totalNoOfWarrantyDays + ' ' + 'days and is ' + warrantyPercentage + 
                                        '% through its warrant period.\n' + 'Extended warranty: ' + hasExtendedWarranty + '/n' + 
                                        + 'Have a nice day!';
        
        
                                        
       }
}
Trigger UpdateOwnerOfContact on Account(before update) {
 //Map to collect account id with changed owner id(user id ) .
 Map<Id,Id> accIdWithOwnerIdMap = new Map<Id,Id>();
 List<Contact> listOfContactsToUpdate = new List<Contact>();
 for(Account currentAccount : trigger.new) {
     if(currentAccount.OwnerId != Trigger.oldMap.get(currentAccount.Id).OwnerId){
        accIdWithOwnerIdMap.put(currentAccount.Id,currentAccount.OwnerId);
     }         
 }
 if(!accIdWithOwnerIdMap.isEmpty()){
  for(Contact con: [SELECT Id, OwnerId, AccountId FROM Contact 
                    WHERE AccountId IN :accIdWithOwnerIdMap.keySet() ]) {
   con.OwnerId = accIdWithOwnerIdMap.get(con.AccountId);
   listOfContactsToUpdate.add(con);
  }
 }
 if(!listOfContactsToUpdate.isEmpty()) {
  try{
   update listOfContactsToUpdate;
  }catch(DmlException de){
   System.debug(de);
  }
  
 }
}   
If count of contacts has a value 2, 2 contacts should be created on the account inserted, if its 3, 3 contacts should be created on the inserted account. 

Can you please help me debug or correct this? receiving null pointer  error. 

trigger CoCLikeNumberofContacts on Account (before insert) {
    
    List<Contact> conList = new List<Contact>();
    Account a = new Account();
    integer b = a.Count_of_Contacts__c.intValue();
    
        
    for(Account a : trigger.new) {
        
        
        if(b > 0) {
           
            
               for(integer b = 0; b > 0; b++) {
                  
               conList.add(new Contact(Lastname = a.Name, AccountId = a.Id)); 
             
                
            }
        }
        insert conList;
        
    }         
}
Hi

I'm looking for a Salesforce Administrator for an initial 3-month contract to help us work with an international organisation on a large project. £300-£400 per day.

The successful applicant will work either from our Cambridge office or remotely (but must be UK based).

If can satisfy most of the requirements below and feel you are suitable, please send in your cv to cv@treehouse-ideas.com for an immediate review.

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

General Requirements:

Must have 2+ years experience as a Salesforce Administrator
Should possess excellent problem solving and communication skills
Ability to work independently and remotely
Understanding of business and technical process interrelationships is essential
Excellent Salesforce.com configuration skills
Should have good understanding on Data Quality
Must be able to design solutions and form/drive related plans
Salesforce.com Administrator (201) Certification is desirable but not essential

Specific Requirements:

Experienced with Sales Cloud, Service Cloud and Communities
Should have expertise in Salesforce.com email templates, Assignment Rules, organizational security controls, sharing rules, queues and public groups, role hierarchy and user profile management, Mobile app configuration and Reports and dashboards
Create and maintain documentation on processes, policies, application configuration and help related materials for users as Salesforce and associated applications are developed
Data Management and cleansing activities
Develop reports, dashboards, and processes to continuously monitor data quality and integrity and assist users with report design and management
Log and track identified system problems through to resolution
 
I've been working on this trail for a bit - and while I undertsand the concepts, I'm stumped on why I'm getting this error: 
 
Challenge Not yet complete... here's what's wrong: 
A Create a Record action for the Closed Won criteria node isn't properly configured. Make sure that it creates a draft contract according to the instructions in the ‘Create contract for closed opportunity’ task action. Make sure that Start Date is set by using a formula.

I've gone over all of the workflow tasks information to recreate the contact. If I activate the process and close an opportunity, it creates a contract with the expected information and the date is 1mo away with 12mo term. The workflow's task (which is the template for the actual contract) specifies the following: 
 
Use the closed opportunity to create a contract for the associated account. 

Account: The account associated with this opportunity
Status: Draft
Contract Start Date: 1 month from today
Contract Term: 12
Here are my actions: 
User-added image

The Contract Start Date is set to the following formula:
DATE(
    YEAR(Today()) +
    FLOOR((1 + MONTH(Today())) / 12) -
    IF (MOD(MONTH(Today()) + 1, 12) = 0,
        1,
        0),

    MOD((1 + MONTH(Today()) - 1), 12) + 1,

    DAY(Today())
)

Again, for all practical purposes I'm passing this, as it functions and the contract is created. But I must be missing some small detail, named field, something that's tripping up the validation settings. Any help is appreciated!

 
 Hi all,

i added for my challenge a contact as contact role as described in the challenge (see text below), but when I let the system check if the task is completed correctly.I always get the error: 

Challenge Not yet complete... here's what's wrong: 
The 'John Smith' contact role for 'Greendot Media' could not be found.​


I don´t understand what I am doing wrong here - while solving the task I followed the description and rechecked with the documentation but I can not find an error.

I would really appreciate help. Thanks.

Task
Your VP just connected you to a new contact, but the contact works with two different companies. To pass this challenge, relate the new contact to the two different accounts. Then, add yourself to the account team. In order to complete this challenge, you need to have Contacts to Multiple Accounts and Account Teams enabled. The Related Contacts and Account Teams related lists must be on the Account page layout. The Related Accounts related list must be on the Contact page layout.

Create an account with the Account Name 'Acme Corporation'.
Create an account with the Account Name 'Greendot Media'.
Create a contact with First Name = 'John', Last Name = 'Smith'. In the Account Name field, enter 'Acme Corporation'.
From the Greendot Media account record, use the Related Contacts related list to add a relationship with John Smith.
Add yourself to the account team for the 'Acme Corporation' account with the Team Role of 'Account Manager'.
 
Hi

I'm looking for a Salesforce Administrator for an initial 3-month contract to help us work with an international organisation on a large project. £300-£400 per day.

The successful applicant will work either from our Cambridge office or remotely (but must be UK based).

If can satisfy most of the requirements below and feel you are suitable, please send in your cv to cv@treehouse-ideas.com for an immediate review.

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

General Requirements:

Must have 2+ years experience as a Salesforce Administrator
Should possess excellent problem solving and communication skills
Ability to work independently and remotely
Understanding of business and technical process interrelationships is essential
Excellent Salesforce.com configuration skills
Should have good understanding on Data Quality
Must be able to design solutions and form/drive related plans
Salesforce.com Administrator (201) Certification is desirable but not essential

Specific Requirements:

Experienced with Sales Cloud, Service Cloud and Communities
Should have expertise in Salesforce.com email templates, Assignment Rules, organizational security controls, sharing rules, queues and public groups, role hierarchy and user profile management, Mobile app configuration and Reports and dashboards
Create and maintain documentation on processes, policies, application configuration and help related materials for users as Salesforce and associated applications are developed
Data Management and cleansing activities
Develop reports, dashboards, and processes to continuously monitor data quality and integrity and assist users with report design and management
Log and track identified system problems through to resolution