• Sumant Kuchipudi
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 39
    Questions
  • 24
    Replies
Hi,
I'm using Mulesoft integration tool and invoking Salesforce Apex Rest API (@RestResource(urlMapping = '/matchingtool/*'), it is working since year until couple of weeks or less. for each hour in a 24 hour window the integration may invoke this api for 1000 times, most of the hours it is working completely for those 1000 but for couple of hourls it's failing with this exception. I poste d question in Mulesoft but everyone replying that this might be Salesforce issue so checking here.
Below is Apex code:
@RestResource(urlMapping = '/matchingtool/*')
global class EmpMatchingTool {
    @HttpPost
    global static String getIdByIdentifiers(Identifiers identifiers) {
        ---------
   }
}

Below is complete exception:
org.mule.extension.salesforce.internal.error.exception.service.SalesforceException: Remotely closed
	at org.mule.extension.salesforce.internal.error.exception.service.handlers.IOExceptionHandler.handle(IOExceptionHandler.java:44)
	at org.mule.extension.salesforce.internal.connection.ForceWSCConnection.send(ForceWSCConnection.java:332)
	at org.mule.extension.salesforce.internal.service.apex.rest.ApexRestInvocation.invokeApexRest(ApexRestInvocation.java:392)
	at org.mule.extension.salesforce.internal.service.apex.util.ApexClient.invokeRestMethod(ApexClient.java:188)
	at org.mule.extension.salesforce.internal.service.ApexServiceImpl.lambda$invokeRestMethod$1(ApexServiceImpl.java:66)
	at org.mule.extension.salesforce.internal.connection.ForceWSCConnection.executeOverApexRestClient(ForceWSCConnection.java:239)
	at org.mule.extension.salesforce.internal.service.ForceWSCService.executeOverApexRestClient(ForceWSCService.java:28)
	at org.mule.extension.salesforce.internal.service.ApexServiceImpl.invokeRestMethod(ApexServiceImpl.java:53)
	at org.mule.extension.salesforce.internal.operation.apex.InvokeApexRestMethodOperation.invokeApexRestMethod(InvokeApexRestMethodOperation.java:54)
	at org.mule.extension.salesforce.internal.operation.apex.InvokeApexRestMethodOperation$invokeApexRestMethod$MethodComponentExecutor.execute(Unknown Source)
	at org.mule.runtime.module.extension.internal.runtime.execution.GeneratedMethodComponentExecutor.execute(GeneratedMethodComponentExecutor.java:97)
	at org.mule.runtime.module.extension.internal.runtime.execution.CompletableMethodOperationExecutor.doExecute(CompletableMethodOperationExecutor.java:29)
	at org.mule.runtime.module.extension.internal.runtime.execution.AbstractCompletableMethodOperationExecutor.execute(AbstractCompletableMethodOperationExecutor.java:63)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeCommand(DefaultExecutionMediator.java:211)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithInterceptors$6(DefaultExecutionMediator.java:192)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithRetry$2(DefaultExecutionMediator.java:130)
	at net.jodah.failsafe.Functions.lambda$promiseOfStage$8(Functions.java:193)
	at net.jodah.failsafe.internal.executor.RetryPolicyExecutor$1.call(RetryPolicyExecutor.java:101)
	at net.jodah.failsafe.internal.executor.RetryPolicyExecutor.lambda$supplyAsync$1(RetryPolicyExecutor.java:133)
	at net.jodah.failsafe.Functions.lambda$null$1(Functions.java:69)
	at org.mule.runtime.core.internal.util.rx.ConditionalExecutorServiceDecorator.synchronousSchedule(ConditionalExecutorServiceDecorator.java:181)
	at org.mule.runtime.core.internal.util.rx.ConditionalExecutorServiceDecorator.schedule(ConditionalExecutorServiceDecorator.java:167)
	at net.jodah.failsafe.Functions.lambda$makeAsync$2(Functions.java:79)
	at net.jodah.failsafe.AsyncExecution.executeAsync(AsyncExecution.java:174)
	at net.jodah.failsafe.FailsafeExecutor.callAsync(FailsafeExecutor.java:346)
	at net.jodah.failsafe.FailsafeExecutor.getStageAsync(FailsafeExecutor.java:178)
	at org.mule.runtime.core.internal.retry.policies.SimpleRetryPolicy.applyPolicy(SimpleRetryPolicy.java:90)
	at org.mule.runtime.core.api.retry.policy.RetryPolicyTemplate.applyPolicy(RetryPolicyTemplate.java:144)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeWithRetry(DefaultExecutionMediator.java:128)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeWithInterceptors(DefaultExecutionMediator.java:192)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$execute$1(DefaultExecutionMediator.java:113)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$new$0(DefaultExecutionMediator.java:61)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.execute(DefaultExecutionMediator.java:112)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.executeOperation(ComponentMessageProcessor.java:563)
	at org.mule.runtime.module.extension.internal.runtime.operation.OAuthOperationMessageProcessor.executeOperation(OAuthOperationMessageProcessor.java:58)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.prepareAndExecuteOperation(ComponentMessageProcessor.java:765)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.access$100(ComponentMessageProcessor.java:185)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor$4.lambda$innerEventDispatcher$9(ComponentMessageProcessor.java:637)
	at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.tryOnNext(FluxPeekFuseable.java:510)
	at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.tryOnNext(FluxPeekFuseable.java:523)
	at reactor.core.publisher.FluxPublishOn$PublishOnConditionalSubscriber.runAsync(FluxPublishOn.java:866)
	at reactor.core.publisher.FluxPublishOn$PublishOnConditionalSubscriber.run(FluxPublishOn.java:939)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:111)
	at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

 
Hi,
I have a trigger that invokes UpdateCallToExternal (future method), this external class checks for System.isFuture() and enqueJob with another class, and that another class invokes the future method in UpdateCallToExternal. Below is the code snippet.
 
global class UpdateCallToExternal {
    private static Integer callCount=0;

    @InvocableMethod
    global static void updateDeliveryStatus(List<Id> recIds){
        if(System.isFuture()){
            System.enqueueJob(new UpdateCallToExternalQueuable(String.join(recIds,',')));
        }else{
            invokeBulkUpdate(String.join(recIds,','));
        }

    }
    
    @future(callout=true)
    global static void invokeExternalSystem(String recIds){
        HttpRequest muleRequest = new HttpRequest();
        .....
    }

    global static void invokeBulkUpdate(String recIds) {
        callCount+=1;
        try {
            invokeExternalSystem(recIds);

         } catch(Exception e) {
             if (callCount <= 5)
                 invokeBulkUpdate(recIds);
         } 
    }
Below is Queuable class that invokes UpdateCallToExternal (future callout)
 
public class UpdateCallToExternalQueuable implements Queueable,Database.AllowsCallouts{
    String recIds;
    public UpdateCallToExternalQueuable(String recIds){
        this.recIds = recIds;
    }
    public void execute(QueueableContext qc){
        UpdateCallToExternal.invokeBulkUpdate(recIds);
    }
}

No idea what's wrong in this, could someone review the code and let me know the issue?
fyi: this error is raising exaclty raising at 10:00 PM only, no other timings.
 
First I directly trying to update records but got "UNABLE_TO_LOCK_ROW on updating records.." issue, then I use "FOR UPDATE" keyword on select query then I'm getting this error from select statement.
Record Currently Unavailable: The record you are attempting to edit, or one of its related records, is currently being modified by another user. Please try again
I have no clue how to avoid this issue, is there anything I'm missing? please advise.
 
Hi,
i have process builder which should trigger when a field (boolean) is changed (checked/unchecked) on UPDATE record (not new) but it seems not triggering, here is the Formuls used in PB.
 
NOT(ISNEW()) && ISCHANGED([Contact].Is_Contacted__c )
Any issue on the abve formula?
 
Hi, I'm getting an incoming date field from the the HttpRequest as "Sun Sep 08 00:00:00 GMT 20" and when I upsert the record I get "invalid date: Sun Sep 08 00:00:00 GMT 20". I want to verify this field and remove if its Invalid date before upsert.
hi,
Salesforce has "Potential Duplicates" lightning component but that works only if contact "A" has no related list to merge Contact "B" but if "A" has related litst then getting a problem. I need to transfer A's related list to B when merging A to B. Hows it possible? Appreciate your help.
Hi,
I have lightning components that displays images from ContentVersion as thumbnails and also links, when I click on the image its directly downloading the image but I would like it to open as preivew or open the image in a new tab/window. please advice.
below is the current line that displays image thumbnails with link to open big
<aura:iteration items="{!v.items}" var="content">
	       <a href="/sfc/servlet.shepherd/version/download/'+{!content.id}" target="_blank"> <img src="/sfc/servlet.shepherd/version/download/'+{!content.id}" width="100" height="100"/> </a>
	    </aura:iteration>

 
Hi,
I have an object with 1.5 million records and I need to update couple of fields on all 1.5 m records by calling HTTP callout for each records, i.e. inside batch I need to call outside for 1.5 m times. Is that ok to run the query on all these records and invoke HttP callout? Is that feacible? whats the best procedure. 
Thank you very much.
Hi,
I have sandbox and we are cleaning up the data for fresh loads, we were able to bulk delete records(dataloader) on Standard and Custom objects but I can't find the way to delete the Content Bodies. All these content (files) recrods childs to Accounts, I think when we delete all Accounts these Contents should have been deleted but I still see the Content Bodies in Storage Usage page.
User-added image
 
Hi,
I have a trigger on an object that compares the new values with the existing and send email if new value comes for each record. When I tested with simeple UPSERT record it worked and whem I tested with an integration that calls upser bulk api, the trigger didn't invoke. Triggerns won't triggern on bulk api requests?
Hi, 
I have RestResource (httppost) that receives the data (JSON) from third party, they have bunch of members information which we need to upsert them into our system. if JSOn contains couple of records then fine but when they send 20 records then failing with "FATAL_ERROR|System.LimitException: Too many DML statements: 151". please see  below code. What is the best way to process those bunch of records? 
 
@RestResource(urlMapping='/ELPMData/*')
global with sharing class ELPMData {
	@httpPost
    global static String getMembersData(List<ELPMember> members){
        try{
            for (ELPMember elp: members){
                Bio bio = elp.bio;
                Account acc = new Account();
                acc.Name = bio.LastName+', '+bio.FirstName;
                acc.External_ID__c = bio.ID;
                acc.State__c = bio.State;
                acc.Type = 'Member';
                upsert acc External_ID__c;

                Contact con = new Contact();
                con.AccountId = acc.id;
                //Other contact fields mapping here
                upsert con External_ID__c;

                if (elp.ContactInformations != null){
                    List<Address__c> addrList = new List<Address__c>();
                    for (ContactInformation ci:elp.ContactInformations){
                        if (ci.AddressID != null && ci.AddressID != ''){
                            System.debug(' INSIDE ADDRESS '+ci.AddressID);
                            Address__c add = new Address__c();
                            add.AddressID__c = ci.AddressID;
                            //Other Address fields mapping here
                            addrList.add(add);
                        }
                    }
                    if (addrList.size()>0){
                        upsert addrList AddressID__c;
                    }
                }
                if (elp.Affiliations != null){
                    List<Affiliation__c> affilList = new List<Affiliation__c>();
                    for (Affiliation aff:elp.Affiliations){
                        if (aff.UniqueID != null && aff.UniqueID != ''){
                            Affiliation__c elpAffl = new Affiliation__c();
                            elpAffl.UniqueID__c = aff.UniqueID;
                            //Other Affiliation__c fields mapping here
                            affilList.add(elpAffl);
                        }
                        
                    }
                    if (affilList.size()>0){
                        upsert affilList UniqueID__c;
                    }
                }
                if (elp.Educations != null){
                    List<Education__c> eduList = new List<Education__c>();
                    for (Education edu:elp.Educations){
                        if (edu.InstitutionID != null && edu.InstitutionID != ''){
                            Education__c elpEdu = new Education__c();
                            elpEdu.InstitutionID__c = edu.InstitutionID;
                            //Other Education mapping here
                            eduList.add(elpEdu);
                        }
                    }
                    if (eduList.size()>0){
                        upsert eduList InstitutionID__c;
                    }
                }
                if (elp.Employments != null){
                    List<Employment__c> empList = new List<Employment__c>();
                    for (Employment emp:elp.Employments){
                        if (emp.UniqueID != null && emp.UniqueID != ''){
                            Employment__c elpEmp = new Employment__c();
                            elpEmp.UniqueID__c = emp.UniqueID;
                            //Other Employments mapping here
                            empList.add(elpEmp);
                        }
                    }
                    if (empList.size()>0){
                        upsert empList UniqueID__c;
                    }
                }
                
               
            }
        }catch(Exception e){
            System.debug('The following exception has occurred: ' + e.getMessage());
			return 'Integration FAILED, check with GU Admins';
        }
        return 'SUCCESS';
    }
    
    global class ELPMember {
        global Bio Bio {get;set;}
        global List<ContactInformation> ContactInformations {get;set;}
        global List<Affiliation> Affiliations {get;set;}
        global List<Education> Educations {get;set;}
        global List<Employment> Employments {get;set;}
    }
    global class Bio{
        //All Bio fields
    }
    global class Education {
        //All Education Fields
    }
    global class Affiliation{
        //All Affiliation fields
    }
    global class ContactInformation{
        //All Contact Fields
    }
    
    global class Employment{
        //All Employment fields
    }
    
}


 they may have 10000 members which we need to insert first time. 
Hi,
I have a process builder which calls Apex method (@InvocableMethod) and the apex method calls future callout, this process is failing with the below error. I have the code checking !system.isFuture() but still failing, not able to figure out.
Error element myRule_1_A1 (FlowActionCall).
An Apex error occurred: System.AsyncException: Future method cannot be called from a future or batch method: AddressValidateController.invokeAddressController(List)
Apex Code is below.
global with sharing class AddressValidateController {
    public static boolean isVerified = false;
   
	@InvocableMethod
    global static void validateAddressFromPB(List<Id> recIds){
       
        if(!system.isFuture() && !isVerified){
            integer count = 0;
            List<String> subList = new List<String>();
            for (Id recId:recIds){
                count+=1;
                subList.add(recId);
                if (Math.Mod(count, 100)==0){
                    invokeAddressController(subList);
                    subList=new List<String>();
                }
            }
            invokeAddressController(subList);
            isVerified = true;
        }
    }
    
    
	@future(callout=true)
    global static void invokeAddressController(List<Id> recIds){
        
               Address validation callout code here
    }
}

Please advice..!
 
I have created an external field in Account and have very simple code that upserts Account record.
below is the code
Account a = new Account();
a.name='Testing 99test9911';
a.Account_External_Id__c='99test99';
upsert a;
First time it creatd record but next time when I ran it failed (below is error), my environment is pretty much new (no triggers and no Workflows and no ProcessBuilders), I don't know how to fix this. Please advice
12:11:45:057 EXCEPTION_THROWN [4]|System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: Account_External_Id__c duplicates value on record with id: 0010t0000137DHM: []

 
I have custom object and it has Notes and Files related list, I want to restrict to one Note and one File for each custom record. Would that be possible?
HI,
I need to pull the all ContentDocumentLink recrods related to All Contacts (30K) and update LinkedEntityId (related to Contact) with new custom object record ids. while updating ContentDocumentLink record  I got below error
LinkedEntityIdUnable to create/update fields: LinkedEntityId. Please check the security settings of this field and verify that it is read/write for your profile or permission set.INVALID_FIELD_FOR_INSERT_UPDATEfalse
I'm using python script to do this (but apex solution is also fine). please check below code
query_result  = self.svc.query("select id from contact where Student__c=true and id='00336000014TJv9'")
            cnt=0
            contList=[]
            while True:
                for row in query_result[self.sf.records:]:
                    cnt+=1
                    contList.append(str(row[1]))
                if str(query_result[self.sf.done]) == 'true':
                    break
                query_result = self.svc.queryMore(str(query_result[self.sf.queryLocator]))
            for con in contList:
                links = self.svc.query("select id,ContentDocumentid from ContentDocumentLink where LinkedEntityId = '"+str(con)+"' limit 1");
                if (links!=None and len(links)>0):
                    for link in links[self.sf.records:]:
                        writer.writerow({'Contac_ID': str(con), 'Document_ID': str(link[3]),'Document_Linked_ID': str(link[1])})
                        emNotes = {
                            'type' : 'Em_Note__c',
                            'Contact__c' : str(con),
                            'Name' : str(link[3])
                        }
                        results = self.svc.create(emNotes )
                        emNotesID= results[0]
                        contentDocumentLink = {
                            'type' : 'ContentDocumentLink',
                            'id' : str(link[1]),
                            'LinkedEntityId' : str(emNotesID)
                        }
                        self.svc.update(contentDocumentLink); # I guess the error is here
Please advice


 
Hi,
I have a new profile and I need to use to around 200 Users but these are all with Force.com - App Subscription. I think we need to make Active=false and FederatonId is null, how can we do it for 200 users ? is it possible with dataloader? how can we do iti?
Hi,

I have below RestResourse and would like to give access to third party to gain access to this API through simple authentication, would it be possible? can I have an example on how to invoke this API from (Java/python)
@RestResource(urlMapping='/ELPData/*')
global with sharing class ELPRESTController {
	@httpPost
    global static String getFellowsData(List<ELPFellow> fellows){
        System.debug(' fellows '+fellows);
        return 'SUCCESS';
    }
    
    global class ELPFellow {

        global String FirstName { get; set; }
        global String LastName { get; set; }
        global String MiddleName { get; set; }
        global String Title { get; set; }
        global String Gender { get; set; }

    }
}

 
Hi,
I have below SOQL clause with Static Year and Month, is it possible to have dynamic values in those fields?
(
  ( 
     ( YEAR__c=2016 and Month__c='July' )  or 
     ( YEAR__c=2016 and Month__c='August' ) or 
     ( YEAR__c=2016 and Month__c='September' ) or 
     ( YEAR__c=2016 and Month__c='October' ) or 
     ( YEAR__c=2016 and Month__c='November' ) or  
     ( YEAR__c=2016 and Month__c='December' ) or 
     ( YEAR__c=2017 and Month__c='January' ) or 
     ( YEAR__c=2017 and Month__c='February' ) or 
     ( YEAR__c=2017 and Month__c='March' ) or 
     ( YEAR__c=2017 and Month__c='April' ) or 
     ( YEAR__c=2017 and Month__c='May' ) or 
     ( YEAR__c=2017 and Month__c='June' )
  ) 
  OR YEAR__c=null
)
)

 
I have BioRecord custom object which has Email, Phone, Status(picklist, Current, Former), Type (picklist, Home, Office, etc) and Record type (Phone and Email), we have integration that writes the data into this object. If a record is existed with a Type='Home' and recordtype='Phone' and if a new record comes with the same Type and same recordtype, I need to change the status of old record to 'Former'. 
i'm guessting that I can do it in Trigger but is there any alternate way we can change the Status of the record? 
I have a custom Address object, which has address fields, phone, and email fields. I'm wriging Process Builder on this object, with the following steps
1) Start the process, when a record created or edited
2) criteria.:
      Criteria for Executing Actions: Formula Evaluates to True
The formula should be on fields (Street, City , state, zipcode), one of these created, edited only the Process should trigger but when I create with these its not triggering. below is the formula I'm using. Its working when edited the record.
AND(
 OR(
    AND(NOT(ISBLANK([Address__c].Street__c)),ISCHANGED([Address__c].Street__c)), 
    AND(NOT(ISBLANK([Address__c].State__c)),ISCHANGED([Address__c].State__c)), 
    AND(NOT(ISBLANK([Address__c].City__c)),ISCHANGED([Address__c].City__c)), 
    AND(NOT(ISBLANK([Address__c].ZipCode__c)),ISCHANGED([Address__c].ZipCode__c)), 
    AND(NOT(ISBLANK([Address__c].Country__c))ISCHANGED([Address__c].Country__c))
   )
)




 
Hi,
I have lightning components that displays images from ContentVersion as thumbnails and also links, when I click on the image its directly downloading the image but I would like it to open as preivew or open the image in a new tab/window. please advice.
below is the current line that displays image thumbnails with link to open big
<aura:iteration items="{!v.items}" var="content">
	       <a href="/sfc/servlet.shepherd/version/download/'+{!content.id}" target="_blank"> <img src="/sfc/servlet.shepherd/version/download/'+{!content.id}" width="100" height="100"/> </a>
	    </aura:iteration>

 
I have custom object and it has Notes and Files related list, I want to restrict to one Note and one File for each custom record. Would that be possible?
I have a requirement that ananymous user who doesn't requre login to access a page, fills the details, saves to an object (custom, and it has lookup field  to contact) . For this I have done the below steps
  • Added Domain
  • Created new Site
  • Assigned the created VF page in to the list 'Site Visualforce Pages'
  • Activated the site
  • Gave perrmissions (RWA) to the custom object
But when I click on the page I got the following error
Authorization Required

You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
We should directly access to the page without authorize, how can we do this?
Thanks,
 
Hi,

I have custom object which has a Account ( lookup ) and that account has Contact record. How can I get Contact's external Id (custom field) value ?  Please advice.

Thanks
Hi,
I'm using Mulesoft integration tool and invoking Salesforce Apex Rest API (@RestResource(urlMapping = '/matchingtool/*'), it is working since year until couple of weeks or less. for each hour in a 24 hour window the integration may invoke this api for 1000 times, most of the hours it is working completely for those 1000 but for couple of hourls it's failing with this exception. I poste d question in Mulesoft but everyone replying that this might be Salesforce issue so checking here.
Below is Apex code:
@RestResource(urlMapping = '/matchingtool/*')
global class EmpMatchingTool {
    @HttpPost
    global static String getIdByIdentifiers(Identifiers identifiers) {
        ---------
   }
}

Below is complete exception:
org.mule.extension.salesforce.internal.error.exception.service.SalesforceException: Remotely closed
	at org.mule.extension.salesforce.internal.error.exception.service.handlers.IOExceptionHandler.handle(IOExceptionHandler.java:44)
	at org.mule.extension.salesforce.internal.connection.ForceWSCConnection.send(ForceWSCConnection.java:332)
	at org.mule.extension.salesforce.internal.service.apex.rest.ApexRestInvocation.invokeApexRest(ApexRestInvocation.java:392)
	at org.mule.extension.salesforce.internal.service.apex.util.ApexClient.invokeRestMethod(ApexClient.java:188)
	at org.mule.extension.salesforce.internal.service.ApexServiceImpl.lambda$invokeRestMethod$1(ApexServiceImpl.java:66)
	at org.mule.extension.salesforce.internal.connection.ForceWSCConnection.executeOverApexRestClient(ForceWSCConnection.java:239)
	at org.mule.extension.salesforce.internal.service.ForceWSCService.executeOverApexRestClient(ForceWSCService.java:28)
	at org.mule.extension.salesforce.internal.service.ApexServiceImpl.invokeRestMethod(ApexServiceImpl.java:53)
	at org.mule.extension.salesforce.internal.operation.apex.InvokeApexRestMethodOperation.invokeApexRestMethod(InvokeApexRestMethodOperation.java:54)
	at org.mule.extension.salesforce.internal.operation.apex.InvokeApexRestMethodOperation$invokeApexRestMethod$MethodComponentExecutor.execute(Unknown Source)
	at org.mule.runtime.module.extension.internal.runtime.execution.GeneratedMethodComponentExecutor.execute(GeneratedMethodComponentExecutor.java:97)
	at org.mule.runtime.module.extension.internal.runtime.execution.CompletableMethodOperationExecutor.doExecute(CompletableMethodOperationExecutor.java:29)
	at org.mule.runtime.module.extension.internal.runtime.execution.AbstractCompletableMethodOperationExecutor.execute(AbstractCompletableMethodOperationExecutor.java:63)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeCommand(DefaultExecutionMediator.java:211)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithInterceptors$6(DefaultExecutionMediator.java:192)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithRetry$2(DefaultExecutionMediator.java:130)
	at net.jodah.failsafe.Functions.lambda$promiseOfStage$8(Functions.java:193)
	at net.jodah.failsafe.internal.executor.RetryPolicyExecutor$1.call(RetryPolicyExecutor.java:101)
	at net.jodah.failsafe.internal.executor.RetryPolicyExecutor.lambda$supplyAsync$1(RetryPolicyExecutor.java:133)
	at net.jodah.failsafe.Functions.lambda$null$1(Functions.java:69)
	at org.mule.runtime.core.internal.util.rx.ConditionalExecutorServiceDecorator.synchronousSchedule(ConditionalExecutorServiceDecorator.java:181)
	at org.mule.runtime.core.internal.util.rx.ConditionalExecutorServiceDecorator.schedule(ConditionalExecutorServiceDecorator.java:167)
	at net.jodah.failsafe.Functions.lambda$makeAsync$2(Functions.java:79)
	at net.jodah.failsafe.AsyncExecution.executeAsync(AsyncExecution.java:174)
	at net.jodah.failsafe.FailsafeExecutor.callAsync(FailsafeExecutor.java:346)
	at net.jodah.failsafe.FailsafeExecutor.getStageAsync(FailsafeExecutor.java:178)
	at org.mule.runtime.core.internal.retry.policies.SimpleRetryPolicy.applyPolicy(SimpleRetryPolicy.java:90)
	at org.mule.runtime.core.api.retry.policy.RetryPolicyTemplate.applyPolicy(RetryPolicyTemplate.java:144)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeWithRetry(DefaultExecutionMediator.java:128)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeWithInterceptors(DefaultExecutionMediator.java:192)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$execute$1(DefaultExecutionMediator.java:113)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$new$0(DefaultExecutionMediator.java:61)
	at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.execute(DefaultExecutionMediator.java:112)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.executeOperation(ComponentMessageProcessor.java:563)
	at org.mule.runtime.module.extension.internal.runtime.operation.OAuthOperationMessageProcessor.executeOperation(OAuthOperationMessageProcessor.java:58)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.prepareAndExecuteOperation(ComponentMessageProcessor.java:765)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.access$100(ComponentMessageProcessor.java:185)
	at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor$4.lambda$innerEventDispatcher$9(ComponentMessageProcessor.java:637)
	at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.tryOnNext(FluxPeekFuseable.java:510)
	at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.tryOnNext(FluxPeekFuseable.java:523)
	at reactor.core.publisher.FluxPublishOn$PublishOnConditionalSubscriber.runAsync(FluxPublishOn.java:866)
	at reactor.core.publisher.FluxPublishOn$PublishOnConditionalSubscriber.run(FluxPublishOn.java:939)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:111)
	at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

 
Hi,
I have a trigger that invokes UpdateCallToExternal (future method), this external class checks for System.isFuture() and enqueJob with another class, and that another class invokes the future method in UpdateCallToExternal. Below is the code snippet.
 
global class UpdateCallToExternal {
    private static Integer callCount=0;

    @InvocableMethod
    global static void updateDeliveryStatus(List<Id> recIds){
        if(System.isFuture()){
            System.enqueueJob(new UpdateCallToExternalQueuable(String.join(recIds,',')));
        }else{
            invokeBulkUpdate(String.join(recIds,','));
        }

    }
    
    @future(callout=true)
    global static void invokeExternalSystem(String recIds){
        HttpRequest muleRequest = new HttpRequest();
        .....
    }

    global static void invokeBulkUpdate(String recIds) {
        callCount+=1;
        try {
            invokeExternalSystem(recIds);

         } catch(Exception e) {
             if (callCount <= 5)
                 invokeBulkUpdate(recIds);
         } 
    }
Below is Queuable class that invokes UpdateCallToExternal (future callout)
 
public class UpdateCallToExternalQueuable implements Queueable,Database.AllowsCallouts{
    String recIds;
    public UpdateCallToExternalQueuable(String recIds){
        this.recIds = recIds;
    }
    public void execute(QueueableContext qc){
        UpdateCallToExternal.invokeBulkUpdate(recIds);
    }
}

No idea what's wrong in this, could someone review the code and let me know the issue?
fyi: this error is raising exaclty raising at 10:00 PM only, no other timings.
 
First I directly trying to update records but got "UNABLE_TO_LOCK_ROW on updating records.." issue, then I use "FOR UPDATE" keyword on select query then I'm getting this error from select statement.
Record Currently Unavailable: The record you are attempting to edit, or one of its related records, is currently being modified by another user. Please try again
I have no clue how to avoid this issue, is there anything I'm missing? please advise.
 
Hi,
i have process builder which should trigger when a field (boolean) is changed (checked/unchecked) on UPDATE record (not new) but it seems not triggering, here is the Formuls used in PB.
 
NOT(ISNEW()) && ISCHANGED([Contact].Is_Contacted__c )
Any issue on the abve formula?
 
Hi,
I have lightning components that displays images from ContentVersion as thumbnails and also links, when I click on the image its directly downloading the image but I would like it to open as preivew or open the image in a new tab/window. please advice.
below is the current line that displays image thumbnails with link to open big
<aura:iteration items="{!v.items}" var="content">
	       <a href="/sfc/servlet.shepherd/version/download/'+{!content.id}" target="_blank"> <img src="/sfc/servlet.shepherd/version/download/'+{!content.id}" width="100" height="100"/> </a>
	    </aura:iteration>

 
Hi, 
I have RestResource (httppost) that receives the data (JSON) from third party, they have bunch of members information which we need to upsert them into our system. if JSOn contains couple of records then fine but when they send 20 records then failing with "FATAL_ERROR|System.LimitException: Too many DML statements: 151". please see  below code. What is the best way to process those bunch of records? 
 
@RestResource(urlMapping='/ELPMData/*')
global with sharing class ELPMData {
	@httpPost
    global static String getMembersData(List<ELPMember> members){
        try{
            for (ELPMember elp: members){
                Bio bio = elp.bio;
                Account acc = new Account();
                acc.Name = bio.LastName+', '+bio.FirstName;
                acc.External_ID__c = bio.ID;
                acc.State__c = bio.State;
                acc.Type = 'Member';
                upsert acc External_ID__c;

                Contact con = new Contact();
                con.AccountId = acc.id;
                //Other contact fields mapping here
                upsert con External_ID__c;

                if (elp.ContactInformations != null){
                    List<Address__c> addrList = new List<Address__c>();
                    for (ContactInformation ci:elp.ContactInformations){
                        if (ci.AddressID != null && ci.AddressID != ''){
                            System.debug(' INSIDE ADDRESS '+ci.AddressID);
                            Address__c add = new Address__c();
                            add.AddressID__c = ci.AddressID;
                            //Other Address fields mapping here
                            addrList.add(add);
                        }
                    }
                    if (addrList.size()>0){
                        upsert addrList AddressID__c;
                    }
                }
                if (elp.Affiliations != null){
                    List<Affiliation__c> affilList = new List<Affiliation__c>();
                    for (Affiliation aff:elp.Affiliations){
                        if (aff.UniqueID != null && aff.UniqueID != ''){
                            Affiliation__c elpAffl = new Affiliation__c();
                            elpAffl.UniqueID__c = aff.UniqueID;
                            //Other Affiliation__c fields mapping here
                            affilList.add(elpAffl);
                        }
                        
                    }
                    if (affilList.size()>0){
                        upsert affilList UniqueID__c;
                    }
                }
                if (elp.Educations != null){
                    List<Education__c> eduList = new List<Education__c>();
                    for (Education edu:elp.Educations){
                        if (edu.InstitutionID != null && edu.InstitutionID != ''){
                            Education__c elpEdu = new Education__c();
                            elpEdu.InstitutionID__c = edu.InstitutionID;
                            //Other Education mapping here
                            eduList.add(elpEdu);
                        }
                    }
                    if (eduList.size()>0){
                        upsert eduList InstitutionID__c;
                    }
                }
                if (elp.Employments != null){
                    List<Employment__c> empList = new List<Employment__c>();
                    for (Employment emp:elp.Employments){
                        if (emp.UniqueID != null && emp.UniqueID != ''){
                            Employment__c elpEmp = new Employment__c();
                            elpEmp.UniqueID__c = emp.UniqueID;
                            //Other Employments mapping here
                            empList.add(elpEmp);
                        }
                    }
                    if (empList.size()>0){
                        upsert empList UniqueID__c;
                    }
                }
                
               
            }
        }catch(Exception e){
            System.debug('The following exception has occurred: ' + e.getMessage());
			return 'Integration FAILED, check with GU Admins';
        }
        return 'SUCCESS';
    }
    
    global class ELPMember {
        global Bio Bio {get;set;}
        global List<ContactInformation> ContactInformations {get;set;}
        global List<Affiliation> Affiliations {get;set;}
        global List<Education> Educations {get;set;}
        global List<Employment> Employments {get;set;}
    }
    global class Bio{
        //All Bio fields
    }
    global class Education {
        //All Education Fields
    }
    global class Affiliation{
        //All Affiliation fields
    }
    global class ContactInformation{
        //All Contact Fields
    }
    
    global class Employment{
        //All Employment fields
    }
    
}


 they may have 10000 members which we need to insert first time. 
Hi,
I have a process builder which calls Apex method (@InvocableMethod) and the apex method calls future callout, this process is failing with the below error. I have the code checking !system.isFuture() but still failing, not able to figure out.
Error element myRule_1_A1 (FlowActionCall).
An Apex error occurred: System.AsyncException: Future method cannot be called from a future or batch method: AddressValidateController.invokeAddressController(List)
Apex Code is below.
global with sharing class AddressValidateController {
    public static boolean isVerified = false;
   
	@InvocableMethod
    global static void validateAddressFromPB(List<Id> recIds){
       
        if(!system.isFuture() && !isVerified){
            integer count = 0;
            List<String> subList = new List<String>();
            for (Id recId:recIds){
                count+=1;
                subList.add(recId);
                if (Math.Mod(count, 100)==0){
                    invokeAddressController(subList);
                    subList=new List<String>();
                }
            }
            invokeAddressController(subList);
            isVerified = true;
        }
    }
    
    
	@future(callout=true)
    global static void invokeAddressController(List<Id> recIds){
        
               Address validation callout code here
    }
}

Please advice..!
 
I have created an external field in Account and have very simple code that upserts Account record.
below is the code
Account a = new Account();
a.name='Testing 99test9911';
a.Account_External_Id__c='99test99';
upsert a;
First time it creatd record but next time when I ran it failed (below is error), my environment is pretty much new (no triggers and no Workflows and no ProcessBuilders), I don't know how to fix this. Please advice
12:11:45:057 EXCEPTION_THROWN [4]|System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: Account_External_Id__c duplicates value on record with id: 0010t0000137DHM: []

 
HI,
I need to pull the all ContentDocumentLink recrods related to All Contacts (30K) and update LinkedEntityId (related to Contact) with new custom object record ids. while updating ContentDocumentLink record  I got below error
LinkedEntityIdUnable to create/update fields: LinkedEntityId. Please check the security settings of this field and verify that it is read/write for your profile or permission set.INVALID_FIELD_FOR_INSERT_UPDATEfalse
I'm using python script to do this (but apex solution is also fine). please check below code
query_result  = self.svc.query("select id from contact where Student__c=true and id='00336000014TJv9'")
            cnt=0
            contList=[]
            while True:
                for row in query_result[self.sf.records:]:
                    cnt+=1
                    contList.append(str(row[1]))
                if str(query_result[self.sf.done]) == 'true':
                    break
                query_result = self.svc.queryMore(str(query_result[self.sf.queryLocator]))
            for con in contList:
                links = self.svc.query("select id,ContentDocumentid from ContentDocumentLink where LinkedEntityId = '"+str(con)+"' limit 1");
                if (links!=None and len(links)>0):
                    for link in links[self.sf.records:]:
                        writer.writerow({'Contac_ID': str(con), 'Document_ID': str(link[3]),'Document_Linked_ID': str(link[1])})
                        emNotes = {
                            'type' : 'Em_Note__c',
                            'Contact__c' : str(con),
                            'Name' : str(link[3])
                        }
                        results = self.svc.create(emNotes )
                        emNotesID= results[0]
                        contentDocumentLink = {
                            'type' : 'ContentDocumentLink',
                            'id' : str(link[1]),
                            'LinkedEntityId' : str(emNotesID)
                        }
                        self.svc.update(contentDocumentLink); # I guess the error is here
Please advice


 
Hi,
I have below SOQL clause with Static Year and Month, is it possible to have dynamic values in those fields?
(
  ( 
     ( YEAR__c=2016 and Month__c='July' )  or 
     ( YEAR__c=2016 and Month__c='August' ) or 
     ( YEAR__c=2016 and Month__c='September' ) or 
     ( YEAR__c=2016 and Month__c='October' ) or 
     ( YEAR__c=2016 and Month__c='November' ) or  
     ( YEAR__c=2016 and Month__c='December' ) or 
     ( YEAR__c=2017 and Month__c='January' ) or 
     ( YEAR__c=2017 and Month__c='February' ) or 
     ( YEAR__c=2017 and Month__c='March' ) or 
     ( YEAR__c=2017 and Month__c='April' ) or 
     ( YEAR__c=2017 and Month__c='May' ) or 
     ( YEAR__c=2017 and Month__c='June' )
  ) 
  OR YEAR__c=null
)
)

 
I have BioRecord custom object which has Email, Phone, Status(picklist, Current, Former), Type (picklist, Home, Office, etc) and Record type (Phone and Email), we have integration that writes the data into this object. If a record is existed with a Type='Home' and recordtype='Phone' and if a new record comes with the same Type and same recordtype, I need to change the status of old record to 'Former'. 
i'm guessting that I can do it in Trigger but is there any alternate way we can change the Status of the record? 
I have a custom Address object, which has address fields, phone, and email fields. I'm wriging Process Builder on this object, with the following steps
1) Start the process, when a record created or edited
2) criteria.:
      Criteria for Executing Actions: Formula Evaluates to True
The formula should be on fields (Street, City , state, zipcode), one of these created, edited only the Process should trigger but when I create with these its not triggering. below is the formula I'm using. Its working when edited the record.
AND(
 OR(
    AND(NOT(ISBLANK([Address__c].Street__c)),ISCHANGED([Address__c].Street__c)), 
    AND(NOT(ISBLANK([Address__c].State__c)),ISCHANGED([Address__c].State__c)), 
    AND(NOT(ISBLANK([Address__c].City__c)),ISCHANGED([Address__c].City__c)), 
    AND(NOT(ISBLANK([Address__c].ZipCode__c)),ISCHANGED([Address__c].ZipCode__c)), 
    AND(NOT(ISBLANK([Address__c].Country__c))ISCHANGED([Address__c].Country__c))
   )
)




 
Hi,
I have a PUBLIC SITE (url=uploadphoto) which uploads image and stores into Attachment, but after file upload, need to display on page but not able to show.
I used the below URLs to display.
<img src="/uploadphoto/servlet/servlet.FileDownload?file={!attID}" style="height: 160px; width:200px;" />

or

<apex:image url="/uploadphoto/servlet/servlet.FileDownload?file={!attID}" style="height: 160px; width:200px;" />
If public sites will not have access to Attachment, can we call RemoteAction and get image string and show? how could we do that?

Please advice
I have a request that end user open a page and process multiple records (with check boxes) with single shot. For this I have built lightning component and made it working. I used Lightning App to test the component. Do I have to create a new App and give the link to them (https://mydomain.lightning.force.com/c/ProcessApp.app) or create a Visualforce and embed the component and give the VF link (https://../apex/ProcessPage) to them? which one is best? Please advice.

Thanks
I have a requirement that ananymous user who doesn't requre login to access a page, fills the details, saves to an object (custom, and it has lookup field  to contact) . For this I have done the below steps
  • Added Domain
  • Created new Site
  • Assigned the created VF page in to the list 'Site Visualforce Pages'
  • Activated the site
  • Gave perrmissions (RWA) to the custom object
But when I click on the page I got the following error
Authorization Required

You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
We should directly access to the page without authorize, how can we do this?
Thanks,
 
Hi,
I can get the Object name with the following code but how can I get this objName using SOQL?
String objName = recId.getSObjectType().getDescribe().getName()
I'm using java/python code to call SOQLs for some other work (integration) I need to know the object names by record ids in Java/Python. Please advice