• Deepu2123
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 0
    Replies
Hi,
I have a method shown below 
    @RemoteAction @ReadOnly
    public static list<SelOption> getOwner(String params){
        map<String, String> values = (Map<String, String>) JSON.deserialize(params, map<String, String>.class);
        string searchTerm = String.ValueOf(values.get('q')).trim();
        if (searchTerm.contains('*')) 
            searchTerm =  searchTerm.replace('*','%');
        if (!searchTerm.endsWith('%')) 
            searchTerm = searchTerm + '%';
        list<SelOption> retVal = new list<SelOption>();
        for (User__c avc : [SELECT Name,job_title__c,email__c,Manager_Lookup__r.Name,office_location_2__c,Employee_Number__c
                                from User__c where name like :searchTerm and salesforce_user_account__c !=:UserInfo.getUserId() and job_status__c = 'Active']){
                                    retVal.add(new SelOption(tmn));
                                }
        return retVal;
    }

Workaround: I need to change the method to global but it is not allowing to change because global methods do not support return type of List. Any sugesstions that is helpful.
Hi Devs,

I am facing the issue in Query.Contacts with NPN numbers that are not null and have less than 10 digits

Select Id,Name,NPN__c FROM CONTACT WHERE NPN__c != null AND NPN__c.Length()<10

NPN__C = Text Fied
.
Hi Developers,
Please help me if i did any wrong becasue batch is throwing the error.

First error: Field is not writeable: Note.ParentId

global class BatchDuplicateContactCleanup3 implements Database.Batchable<Sobject> {
    
    //Database.executeBatch(new BatchDuplicateContactCleanup3(), 30);  
   
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query = 'SELECT id,Duplicate_Of__c FROM Contact where Duplicate_Of__c!=null';
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext bc, List<sObject> scope) {    
        
        set<Id> dupConIds = new Set<Id>();
        Map<string,string> dupcontactsmap = new Map<string,string>();
        
        for(Contact vCon: (List<Contact>) scope){
            dupConIds.add(vCon.id);
            dupcontactsmap.put(vCon.id,vCon.Duplicate_Of__c);         
        }
        
        List<Note> listNotes = [select id,parentid from Note where parentid=:dupConIds];        
        List<Note> updateNotes = new List<Note>();
        
        if(!listNotes.isEmpty()){            
            for(Note vNote: listNotes){
                if(dupcontactsmap.get(vNote.parentid) != null){
                //Attachment b = New Attachment(Name = a.Name, Body = a.Body);
               //b.parentID = newParentId;
                    vNote.parentid = dupcontactsmap.get(vNote.parentid);
                    updateNotes.add(vNote);
                } 
            }
            if(!updateNotes.isEmpty()){
                update updateNotes;
            }
        }
        
        List<Attachment> listAttachments = [select id,parentid from Attachment where parentid=:dupConIds];        
        List<Attachment> updateAttachments = new List<Attachment>();
        
        if(!listAttachments.isEmpty()){            
            for(Attachment vAtt: listAttachments){
                if(dupcontactsmap.get(vAtt.parentid) != null){
                    vAtt.parentid = dupcontactsmap.get(vAtt.parentid);
                    updateAttachments.add(vAtt);
                } 
            }
            if(!updateAttachments.isEmpty()){
                update updateAttachments;
            }
        }
    }
    
    global void finish(Database.BatchableContext bc) {
    }    
}

Thanks,
Saicharan.
Hi Developers,
 
I am doing some research on Merge contacts. Please provide me some important points for merge considerations for standard and custom objects.
Points:
1. How can we merge more than three records
2. Share some points so i can add in reserch document which i need to send to the business.

Thanks....
Hi Developer,

I have a process builder flow which i want to delete. I already deavtivated the flow from process builder just i need to add in destructivechangespost.xml. But i am confuse Which name i need to use in destructivechnages 
1. Flow 
or
2. FlowDefinition 
And also i need to mention object name on members.

Below is the xml file which i need to deploy.
<?xml version="1.0" encoding="UTF-8"?>
<Package
    xmlns="http://soap.sforce.com/2006/04/metadata">
<!-- Renewal opportuinty flow to be deleted from process builder-->
    <types>
<members>Renewal Opportunity - Decline Open Opportunities 30 Days After Close Date</members>
<name>Flow</name>
</types>
    <version>45.0</version>
</Package>
 
Hi Developers,
I have a issue with [sf:deploy] 560. applications/standard__Content.app -- Error: Property 'tab' not valid in version 43.0

<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
<customObject>true</customObject>
<mobileReady>false</mobileReady>
<motif>Custom26: Flag</motif>
</CustomTab>

Please suggest me on this.
Hi Developers,

I need a small help from you guys. I got the new requirement Apex classes API Version. In our org we have lot of apex classes with different  API Versions. So i need to update the API Version. Do we have best practices or any suggestion if i chnage the API Version is there any conflict.

Please provide me an update or technique to change the API version without any conflict.

Thanks,
SC.
Hi
Can Anybody please explain the issue, please
List has no rows for assignment to SObject this error is showing when I am clicking on the preview.

Apex class:
public class mycontroller{.

  public string getname() {
     return 'saicharan';
     }  
   public Account getaccount() {
        return [select id, name from account 
                 where id = :ApexPages.currentPage().getParameters().get('id')]; 
      }
}

Visualforce page: 

<apex:page controller="mycontroller">
<apex:pageBlock title="Hello World {!$User.FirstName}!"> This is my New Page for the {!name} my controller. <br/>
 You are viewing the {!account.name} account.
 </apex:pageBlock>
</apex:page>
Hi All,
Can Anyone please provide a little explaination on the questions provided below.
1. In Salesforce when would we use a visualforce page versus lightening component? what are the pros and cons of each?
2. Describe the process for deploying a salesforce project form eclipse.