• Arunkumar R
  • PRO
  • 3113 Points
  • Member since 2014


  • Chatter
    Feed
  • 100
    Best Answers
  • 21
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 429
    Replies
Hi All ,
it is showing Error missing ';' semicolon on every value.

String query = 'SELECT Id,FROM InContactData__C WHERE skill_name__c IN('DMU SDChat1';'DeSales_PhoneIn_AfterHours','DeSales_PhoneIn_BusinessHours','OurtageAlert','BigDeals','CH-Priority Line_PhoneIn','CH-Priority Line_PhoneIn'    ,'LMS_PhoneIn','LMSxfer_PhoneIn','AI ChatBOT Transfer','CIOApp_PhoneIn','BBH Sales_PhoneIn','EMER_PhoneIn','USPW_PhoneIn', 'LIM CollegeLMS(Fac)-PhoneIn','LipscombFA-PhoneIn','LipscombBO-PhoneIn','BridgewaterTTC_PhoneIn','CaliforniaCC-Chat','MoraineParkTC(ClsrEmr)-PhoneIn',    'Curry Emergency_PhoneIn','BridgewaterResNet_PhoneIn','LIM CollegeLMS(Stu)-PhoneIn','DMU LMS','MiddlesexCC-ClassroomEmergency', 'LipscombIT Emergency_PhoneIn','SouthDakota(Fac)-PhoneOut','Laboure_PhoneIn','LeMoyne-Owen College')';
Dear All,
I have the following Case Trigger wherein bulk I create an internal list of cases (from the Trigger.new) and an internal list of accounts for each case with their SalesDivision.  
However, I'm confused by the 'for' loop as I get the error messages:

Variable does not exist: Sales_Division__c
DML requires SObject or SObject list type: Map<Id,Account>

Any help? 
Thank you
GC
 
Set<String> setAcountId = new Set<String> ();
for(Case obj: Trigger.New){
	if(obj.AccountId != null){
		setAcountId.add(obj.AccountId);
	}
}
 
//For each Account, find the Sales Division
Map<Id,Account> accWithCaseSalesDiv = new Map<Id,Account>(
	[SELECT Id, Sales_Division__c, (SELECT Id FROM Cases) FROM Account WHERE Id IN : setAcountId 
   ]
);

    for (Map<Id,Account> obj:accWithCaseSalesDiv )  {
        if (String.isEmpty(obj.Sales_Division__c)) {
            obj.Sales_Division__c = 'Americas';
            update obj;
        }
    }   

Map<Id,BusinessHours> accBHID = new Map<Id,BusinessHours>(
	[SELECT Id, name, (SELECT Id FROM Cases) FROM BusinessHours WHERE Id IN : setAcountId 
   ]
);    
Hi,
I would like to write a trigger  to create two tasks when ever lead is created....

Regards,
Sucharitha.
I have Contact and Opportunity. How we can display related opportunities based on contact id. Any query any code. Please suggest me. 
Thank you!
Hi All,

I have a batch class. When I run the checkmarx report I am getting the Query:sharing issue. I states that:

All entry points to an app (Global or Controller classes) must use the 'with sharing' keyword. Classes without this keyword run without sharing if they are entry points to your code, or with the sharing policy of the caller. Do not omit the sharing declaration as this hides critical security information in side-effects that can change when code is refactored. Only declare classes as 'without sharing' if they are not entry points to your app and if they only modify objects whose security is managed by your code (such as wizard state, or fields in a site). It is a common misconception to believe that batch apex or async apex must run with the global keyword. This is not true, the only classes that must be global are those that expose webservices or are intended to be used by extension packages. All async apex should run as public in order to avoid creating privileged entry points to your app.

I need to remove this issue from the report. Also I have controllers declared as without sharing. How do I resolve this issue for batch classes and controllers defined with without sharing

Thanks,
Anuj
Good Morning All!

In my organization, we have created an Approval Process on a custom object (Job) which gets automatically submited to a specific role (GM) 50 days after "Contract Date."  The business has now requested that after 3 days, if the GM has not approved or declined the request, that it is automatically marked as approved.

Is there anyway to create an Apex Class or trigger with these requirements?  I was thinking to add a step to my Process Builder with that criteria to fire an Apex Class if the GM Approved and GM Declined date are both blank after 3 days of the approval process start date but not sure how to approve via that Apex Class.  I've found a lot of posts about submitting and then approving a request but having trouble locating anything about approving a pending request.

Thanks for any help!
Hi, 
I need help in passing opportunity id in the below soql query for Trigger. Am using this trigger to copy attachments from opportunity to Quote whenever the quote is created from opportunity. I have hard coded the record id and i need to how to get the record id in the query.

trigger CloneAtt on Quote (after insert) {    
    
    Attachment[] attList = [SELECT id, name, body, parentid
                              FROM Attachment 
                              WHERE ParentId = '0060K00000Ra3Ei'];

    
    Attachment[] insertAttList = new Attachment[]{};
    
    for(Attachment a: attList){
        Attachment att = new Attachment(name = a.name, body = a.body, parentid = Trigger.new[0].id);
        insertAttList.add(att);
    }
    
    if(insertAttList.size() > 0){
        insert insertAttList;
    }
}
Hi Experts,

I have an object ( say Account) and defined a self relationship Account object which is 1 parent Account can have multiple child Accounts.

Now I have to get the count of child objects  from  the related list and update the count in parent... how to do achieve this?

Appreciate your inputs...

 
Hi All,

I am iserting contact record in my class. I need to check if all the fields are updateble and then i will upsert the record. I have written the following code but it is not working. Kindly provide me solution.
 
if (Schema.sObjectType.Contact.isUpdateable()){
            	   	   contact.FirstName = firstname;
            	   	   contact.LastName = lastname;
            	   	   contact.Email = emailaddress;
            	   	   contact.Email_Alt_1__c = altemail1;
            	       contact.Email_Alt_2__c = altemail2;
            	       contact.MailingStreet = street;
            	       contact.MailingCity = city;
            	       contact.MailingPostalCode = postalCode;
            	       if (country == 'United States') {
            	           contact.MailingState = stateprovince;
            	       } else {
            	       	   contact.MailingState = '';
            	       }
            	       contact.MailingCountry = country;
            	       contact.Country__c = regioncountry;
            	       //contact.Audience__c = audience;
            	       contact.Cisco_com_Login__c = ciscocomlogin;
            	       contact.Testing_ID__c = testingid;
            	       contact.Cisco_ID_CSCO__c = ciscoid;
            	       contact.Area_Code__c = Integer.valueOf(areaCode.trim());
            	       contact.Country_Code__c = countryCode;
            	       contact.Phone = phonenumber;
            	       contact.Fax = faxPhone;
                       
            	       contact.HomePhone = homePhone;
            	       upsert contact;
                       }

 
Hello Everyone,

Is it Ok to have Schema statements inside for loop? Will it affect governor limits?

For ex, i want to have some statement like this
for(Employee emp : empList){
   String str = Schema.SObjectType.Employee__c.getRecordTypeInfosById().get(Employee__c.RecordTypeId).getName();
}

Thanks & Regards,
B Archana
Hi @all,
I hope someone can help me. I want to create a case ans assign a Id to a relationship.
In error I get -> StringException: Invalid id: 0013E00000iMZjNQAW
I convert a String to a Id with this code:
c.AccountId = Id.valueOf(newCatererId);
At this point I got the error.
newCatererId is a String with the Id.
I havre tried to convert it before I assign it to AccountId. It does not working too.

I hope someone can help me
Lisa
 
Hi guys,

I'm having troubles with this error when i try to do the following query inside a trigger. 

 public static Map<String, AggregateResult> getTotalDesembolsos(Set<Integer> setAnios, Set<Id> setEjecutivoIds) {
        System.debug('\n\n-=#=-\n>>>>>>>>>>   ' + 'CRM_DesembolsoTriggerHandler_cls - getTotalDesembolsos' + '   <<<<<<<<<<\n' +
                     'setAnios' + ': ' + setAnios + '\n' +
                     'setEjecutivoIds' + ': ' + setEjecutivoIds + '\n-=#=-\n');

        Map<String, AggregateResult> mapCantidadDesembolsos = new Map<String, AggregateResult>();

        for(AggregateResult objAggregateResultsDesembolsos : [SELECT CALENDAR_YEAR(CRM_FechaInicio__c)      Anio
                                                                    ,CRM_EjecutivoComercial__c              Ejecutivo
                                                                    ,COUNT(Id)                              Desembolsos
                                                                    ,COUNT_DISTINCT(CRM_Cliente__c)         Clientes
                                                                    ,SUM(CRM_DesembolsoTotalReexpresado__c) TotalDesembolsos
                                                                FROM CRM_Desembolso__c
                                                               WHERE CALENDAR_YEAR(CRM_FechaInicio__c)  IN: setAnios
                                                                 AND CRM_EjecutivoComercial__c          IN: setEjecutivoIds
                                                                 AND CRM_Cliente__c                     !=  NULL
                                                            GROUP BY CALENDAR_YEAR(CRM_FechaInicio__c)
                                                                    ,CRM_EjecutivoComercial__c
                                                            ORDER BY CALENDAR_YEAR(CRM_FechaInicio__c)
                                                                    ,CRM_EjecutivoComercial__c]) {
            System.debug('\n\n-=#=-\n' + 'objAggregateResultsDesembolsos' + ': ' + objAggregateResultsDesembolsos + '\n-=#=-\n');

            mapCantidadDesembolsos.put((Integer)objAggregateResultsDesembolsos.get('Anio') + '-' + (String)objAggregateResultsDesembolsos.get('Ejecutivo'), objAggregateResultsDesembolsos);
        }

I read someting about Custom Index but I don't know how request this custom index. If someone know something i will appreciate.

Thanks
I have created a POST REST API with class name as given below. 
global with sharing class RestReceiveBid {
  global static ReturnClass doPost(id invoiceId, id userId, double amount, boolean acceptPartialBid, id contactId) {
}
}
And I have created test class with following name.
private class Test_RestReceiveBid {
 static testMethod void testDoPost() {
   RestReceiveBid.doPost(invoiceID, funderID, amount, acceptPartialBid, contactID); >> line 48
}
}
I didn't get any error while running this test class and I have deployed the same to production as well. But after some time we have decided to delete the old classes and i am trying to delete class from eclipse IDE. But when I am trying to deploy the class I amgetting the following error for the test clas. 

Test_RestReceiveBid. line 48, column 5: Variable does not exist: RestReceiveBid.

Can anyone please point out what I am missing here? Also help on how we can delete the old Apex classes from production will be appreciated. 
 
Hi All,

In my apex code I need to check if an input string from CSV file is a valid number. It can be a integer or decimal value.
isNumeric only returns true if the input is integer but does not work for decimal.
Is there an easy way to determine if an input string from CSV file is a valid decimal or integer ?
 
String numeric = '1234567890';
system.debug(numeric.isNumeric());


String decimalPoint = '1.2';
system.debug(decimalPoint.isNumeric());

Logs Displays:

true
flase


 
I am fairly new to Salesforce developing and I just entered into the developers console to create a new apex trigger for cases to have an auto number only show up in a specific record type and I get this error message "Can not create Apex Trigger on an active organization." What does this mean and how can I proceed?
Hi there, 

is it posssible to change the column width ?  


<apex:page controller="LeadPageControllerKontaktiert" tabStyle="Lead">
    <apex:pageBlock title="Meine Leads">
        <apex:pageBlockSection title="20 - kontaktiert">
           
            <apex:pageBlockTable value="{!leads}" var="l">
                <apex:column >
                    
                    <apex:facet name="header">Name</apex:facet>
                   
                    <apex:outputLink value="/{!l.Id}" target="_blank">
                        <apex:outputField value="{!l.company}"/>
                    </apex:outputLink>
                </apex:column>
                <apex:column value="{!l.name}" />
                <apex:column value="{!l.company}" />
                <apex:column value="{!l.Status}" />
                <apex:column value="{!l.Owner.name}" />                
                <apex:column value="{!l.Lead_Score__c}" />                  
                
                
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
 public void fun()
   {  
       list<Payment__c> pay=new list<Payment__c>();
       for(Payment__c nop:[select id,,npe01__Scheduled_Date__c, from Payment__c where Paid__c=true])
       {
           integer year=nop.npe01__Scheduled_Date__c.year();
           integer month=nop.npe01__Scheduled_Date__c.month();
         
     }

when i run this code in developer console in production it gives error:
System.NullPointerException: Attempt to de-reference a null object 
   on the highlighted part.
This is working fine in sandbox. Deployed without any problems.
Checked the query in query editor. It is returning records as expected.
What could be the problem here???
Any help is appreciated.
Thank you
I am wondering if it is possible to either change the standard save button or have an additional button that takes you back to the parent record.

We have a related list in cases that when we create a record we have to press the case number to go back to the case we are working on. It would be handy to press save and it saves the record and takes you back to the ticket.