• karthikeyan perumal
  • PRO
  • 3201 Points
  • Member since 2015

  • Chatter
  • 89
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 1
  • 553
I have a batch job which runs to populate two objects.. Monthly Activity(MonAct) and URL Individual monthly Activity (URLIndMonAct)...
The problem with the response is that I am quering for MonAct records and I am getting back 5 of them . And each of those MonAct records contains with it thousands of URLIndMonAct records...

I have limited my query to just 2 records per batch but I am still getting DML Rows : 10001 error ..
If I redice the size to 1 record, the batch is running for too long...

Can any one please guide me, how can I modify my code to prevent this error and not lose any records while processing...
Any help is appreciated.

global class BatchToUpdateGARecords implements Database.Batchable<sObject>, Database.Stateful, Schedulable, Database.AllowsCallouts{

    private List<String> EMAIL_BATCH_RESULTS = new List<String>{System.Label.Email_List};  
    global  IndividualMonthlyGARecords.BatchResponse runningBatchResponse;
    private String query;
    private Integer queryYear;
    private Integer queryMonth;

    global BatchToUpdateGARecords(Integer year, Integer month){
        runningBatchResponse = new IndividualMonthlyGARecords.BatchResponse();

        // Validate user input, if request to run batch is not for todays date
        if(month != null && year != null && month >= 0 && month <= 12 && year > 1950){
            this.queryYear  = year;
            this.queryMonth = month;
            Date yesterdaysDate = Date.today().addDays(-1);

            this.queryYear  = yesterdaysDate.year();
            this.queryMonth = yesterdaysDate.month();

        this.query  = 'SELECT Id, GID__c ';
        this.query += 'FROM Monthly_Activity__c ';
        this.query += 'WHERE Year__c = ' + queryYear + ' ';
        this.query += 'AND Month__c = ' + queryMonth + ' ';
        this.query += 'AND GID__c <> null ';
        this.query += 'AND GID__c > 0 ';

    global BatchToUpdateGARecords(){
        this(null, null);
    global Database.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(query);

    global void execute(Database.BatchableContext BC, List<Monthly_Activity__c> currentBatchRecords){
        List<Monthly_Activity__c> MonthlyActivities = [
            SELECT Id, GID__c, Month__c, Year__c
            FROM Monthly_Activity__c 
            WHERE Year__c =: queryYear
            AND Month__c =: queryMonth
            AND GID__c IN: Pluck.decimals('GID__c', currentBatchRecords)

        List<URL_Individual_Monthly_Activity__c> urlIndividualMonthlyActivities = [
            SELECT Id, GID__c, URL__c, Month__c, Year__c
            FROM URL_Individual_Monthly_Activity__c 
            WHERE Year__c =: queryYear
            AND Month__c =: queryMonth
            AND GID__c IN: Pluck.decimals('GID__c', currentBatchRecords)
       }catch(exception ex){
            system.debug('exception call :'+ ex.getMessage());
            system.debug('exception call line :'+ ex.getStackTraceString());
        if(runningBatchResponse != null && !runningBatchResponse.getSuccessRecords().isEmpty()){
            List<Database.SaveResult> updateResults =
                Database.update(runningBatchResponse.getSuccessRecords(), false);

            for(Database.SaveResult updateResult : updateResults){
                for(Database.Error err : updateResult.getErrors()){

        if(runningBatchResponse != null && !runningBatchResponse.getSuccessRecordsIMA().isEmpty()){

            List<Database.SaveResult> updateResults1 =
                Database.update(runningBatchResponse.getSuccessRecordsIMA(), false);

            for(Database.SaveResult updateResult1 : updateResults1){
                for(Database.Error err : updateResult1.getErrors()){


    global void execute(SchedulableContext SC){
        Database.executeBatch(new BatchToUpdateGARecords(), 2);                            //Changed from 5    }
    global void finish(Database.BatchableContext BC){
        AsyncApexJob apexBatchResult = [
            SELECT Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email
            FROM AsyncApexJob
            WHERE Id =: BC.getJobId()
        // Generate email body
        String emailBody = 'Apex Batch to Update PageviewSessions processed '
            + apexBatchResult.TotalJobItems + ' batches with '+ apexBatchResult.NumberOfErrors + ' failures.\n\n'
            + 'Database errors (if any): ' + JSON.serialize(runningBatchResponse.getDatabaseErrors()) + '\n';
        // Extract error string from batch response
        //emailBody += runningBatchResponse.generateErrorString();

        // Send email
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setSenderDisplayName('About.com Experts - Batch Results');
        mail.setSubject('About.com - Batch to Update PageviewSessions - status: ' + apexBatchResult.Status);
        mail.setPlainTextBody('Batch Process has completed\n\n' + emailBody);

        Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{mail});

I am trying to write a trigger on my Lead Object that will not allow a user to click Convert unless a boolean field is True. I need help with some sample code to get started. 

I plan to create an Approval Process on the lead record, then with the final Approver action have a field update to have my custom checkbox (Approved) set to True. 

Once this happens I want the user to be able to click Convert, but only once the checkbox is set to true. If it has not gone through the approval process, the user shoudnt be able to click convert. 

I should also note I would only want this for a specific record type of my lead object.
Can you send data (via SOAP) out from Sandbox to another System (not Salesforce)?
Do requests with the If-None-Match header, that return a 304 response, count towards my API limit?
So I have an issue with a flow.  When I did a test it worked but now its not and I have no idea why.  The error message makes very little sense to me but appears to be an issue with the student field?

Can anyone help me with this:
Error element myRule_1_A1 (FlowRecordCreate).
This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: Meal_Transaction_AIAIAD: execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0 Trigger.Meal_Transaction_AIAIAD: line 24, column 1. For details, see API Exceptions.
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Payment_Meals_Update_Ver_3
Type: Workflow
Version: 1
Status: Active
Flow Interview Details
Interview Label: Payment_Meals_Update_Ver_3-1_InterviewLabel
Current User: Scott Walker (00XX000000#XXXXXXX)
Start time: 4/3/2017 4:46 PM
Duration: 0 seconds
How the Interview Started
Scott Walker (00X0000000000) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = a00000000aa0000008
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
{!myVariable_waitStartTimeVariable} = "4/3/2017 4:46 PM"
DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!myVariable_current.Payment_for__c} (Lunch Billing) Equals Lunch Billing
Logic: All conditions must be true (AND)
Create one Meal_Transaction__c record where:
Student__c = {!myVariable_current.Student__c} (null)
Transaction_Amount__c = {!myVariable_current.Amount_Paid__c} (1)
Transaction_Date__c = {!myVariable_current.CreatedDate} (4/3/2017 4:46 PM)
Transaction_Type__c = Credit
Failed to create record.

Error Occurred: This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: Meal_Transaction_AIAIAD: execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0 Trigger.Meal_Transaction_AIAIAD: line 24, column 1. For details, see API Exceptions.

I have mapped the fields and I believe they are correct, as follows:

User-added image

the fields on the right are:


Any help really appreciated I really need to get this to work
We have users in both Classic and Lightning using the standard "New" button on leads.  I need to override the standard "New" button and redirect the user to a lightning app.  I created a VF page action that will redirect the user to the lightning app.  Everything works great however for lightning users, the redirect opens a new tab in the browser.  How do I keep the redirect on the same browser window in lightning?  Do I need to create a VF page pulling in a lightning component?
My salesforce for outlook account was automatically logged out but when I click to log back in and enter my credentials I get this message: 
User-added image
trigger BlockContentLinkTrigger on ContentDocumentLink (before insert) {  
    for(ContentDocumentLink  contDocL : Trigger.new) {
      if (CDLHelper.isSharingAllowed(contDocL)) {  
          contDocL.addError('Pièce joint bloquée depuis objet ContentDocumentLink');

public class CDLHelper {
    public static boolean isSharingAllowed(ContentDocumentLink cdl) {
        //String docId = cdl.ContentDocumentId;        
        ContentVersion version = [select PublishStatus, FileExtension from ContentVersion
                                  where ContentDocumentId =: cdl.ContentDocumentId limit 5];              
        if (version.PublishStatus.equals('P') && (version.FileExtension != 'null')) {
            return false;
        return true;

I need update the fields when I create a new register and when I update the same.
I created a trigger that execute a method that make this update.

When I create a new register This method works, and when I try update occurs a error.

Can you evaluate my code and see if I did the right way, and what is wrong?

Trigger code:
Trigger INSERT
trigger CalcularTudoTrigger on Item_de_oportunidade__c (after insert) {
    Item_de_oportunidade__c item = new Item_de_oportunidade__c();
    item = [SELECT Id, Name, Margin__c, Sales_Type__c, nome_oportunidade__c, Category__c, Extra_Expenses__c
            FROM Item_de_oportunidade__c
               WHERE Id IN : Trigger.newMap.keyset() limit 1];
    Opportunity op = new Opportunity();
    op = [SELECT Id FROM Opportunity WHERE Id = : item.nome_oportunidade__c];

            AutomatizaCalculos.inserirCalculoMVS(item.Id, op.Id, item.Sales_Type__c, item.Category__c, item.Margin__c, item.Extra_Expenses__c);

Trigger UPDATE
trigger CalcularAtualizacao on Item_de_oportunidade__c (before update) {
    Item_de_oportunidade__c item = new Item_de_oportunidade__c();
    item = [SELECT Id, Name, Margin__c, Sales_Type__c, nome_oportunidade__c, Category__c, Extra_Expenses__c
            FROM Item_de_oportunidade__c
               WHERE Id IN : Trigger.newMap.keyset() limit 1];
    Opportunity op = new Opportunity();
    op = [SELECT Id FROM Opportunity WHERE Id = : item.nome_oportunidade__c];

            AutomatizaCalculos.inserirCalculoMVS(item.Id, op.Id, item.Sales_Type__c, item.Category__c, item.Margin__c, item.Extra_Expenses__c);



global class AutomatizaCalculos {
    public static void inserirCalculoMVS(String id_item, String regional, String tipoVenda, String categoria, Decimal margem, Decimal gastos){
        Item_de_oportunidade__c item = new Item_de_oportunidade__c();
        item = [SELECT Id, Name, Sales_Type__c, Category__c, Margin__c, Extra_Expenses__c FROM Item_de_oportunidade__c WHERE Id = : id_item];
        if(regional == 'AR'){
            if(tipoVenda == 'FEE'){
                item.MVS__c = (margem * 0.956) - gastos;
                inserirCalculoComissao(item.MVS__c, item.Id, categoria);
                item.MVS__c = margem - gastos;
                inserirCalculoComissao(item.MVS__c, item.Id, categoria);
        }else if(regional == 'CL' || regional == 'US'){
                item.MVS__c = margem - gastos;
            inserirCalculoComissao(item.MVS__c, item.Id, categoria);
            if(tipoVenda == 'FEE'){
                item.MVS__c = (margem * 0.8725)-gastos;
                inserirCalculoComissao(item.MVS__c, item.Id, categoria);
                item.MVS__c = margem - gastos;
                inserirCalculoComissao(item.MVS__c, item.Id, categoria);
    update item;
    public static void inserirCalculoComissao(Decimal mvs, String item_id, String categoria){
        Item_de_oportunidade__c item = new Item_de_oportunidade__c();
        item = [SELECT Id, Name, Margin__c, MVS__c, MS_Customer__c, Category__c FROM Item_de_oportunidade__c WHERE Id = : item_id];
        if(categoria == 'IT SERVICES' || categoria == 'MANAGED SERVICES'){
            if(item.MS_Customer__c == true){
                item.Fee_Pre_Sales__c = mvs *0.015;
                item.Fee_Pre_Manager__c = mvs * 0.075;
                item.Fee_Pre_Rep__c = mvs * 0.03;
                item.Fee_Pre_Sales__c = mvs *0.03;
                item.Fee_Pre_Manager__c = mvs * 0.015;
                item.Fee_Pre_Rep__c = mvs * 0.06;
            if(item.MS_Customer__c == true){
                item.Fee_Pre_Sales__c = mvs *0.015;
                item.Fee_Pre_Manager__c = mvs * 0.075;
                item.Fee_Pre_Rep__c = mvs * 0.03;
                item.Fee_Pre_Sales__c = mvs *0.02;
                item.Fee_Pre_Manager__c = mvs * 0.01;
                item.Fee_Pre_Rep__c = mvs * 0.04;
        update item;

I have a custom object called Service Contract. The object contains the following fields Effective Date (date) and Calls Per Year (number) End Contract (checkbox). 

When a user sets up the service contract for a customers machine the customer will decide how many times per year they want the machine serviced.

For example: Starting April 1,2017 I want my machine serviced 2 times per year.
I need the event/reminder to tell the user on October 1 and April 1 to create a work order untill End Contract is checked. 
I have no idea how to work this out. My expirence with Apex is null, I do have other programing expirience and want to learn how to do this just really need some help. 

I had been advised previously to create a custom setting which I have but do not know how to proceed. 
I created a custom object and a Submit for Approval button appeared on it that I can't remove from the page layout.  I have no approval processes linked to it, no approval history, no Visualforce.  It's tangentially linked to Contracts, but I have three layers of custom master-detail objects linked to Contracts where the Submit button is not present.  The lowest level object in that hierarchy has a lookup to the object in question, but there are no lookups or master-detail fields on the object with the button.  Frustratingly, all users see the button, even the ones who only have read access to the records.

What on earth did I do to make this button appear and how do I get rid of it? 

I have a custom sObject called AccountDetail that is the child in a lookup relationship with Account. It is also the parent in a lookup relationship with Opportunity. In my situation, I have Master Accounts that have AccountDetail objects, and I have Child Accounts that have Opportunity objects. Here's a diagram to help you visualize these relationships:

Diagram describing relationship between the relevant sObjects
I need to find all the Child Accounts related to each Master Account based on the relationships between their Opportunity and AccountDetail objects (I understand that organizing the data this way does not seem to make sense, but because of reasons outside of my control, this is how I have to do it). 

The query I am trying to use looks like this:
List<Account> accounts = 
   [SELECT Account.Id, Account.Name FROM Opportunity
    WHERE AccountDetail__c IN 
    (SELECT Id FROM AccountDetail__c
    WHERE Account__r.Id= :masterAccountId)].Account;
but this results in an Illegal assignment from Account to List<Account> error.

How do I make this query work to select all the Child Accounts instead of just one? Is there a better way to query the Child Accounts?
I have a custom button that SELECTS a Product for the Opportunity Lines.   This works great

Addition that is needed:
When the product is SELECTED and the Number of Years = 1 or greater  ---  I need it to populate a value  that is on the Opportunity Line Number that equals the number of years.  I am not sure the best way to get this to work.  If the Number of Years = 0 I do not want to change the dollar value for them.  

Do I need to use a Flow or Process builder?
Muddling my way through my first visual force page; not a developer by trade.  I've created a visual force button that will output the content of a related list to my opportunities (Visit Report) to a PDF file so that people can easily scroll through all VR's associated with an Opportunity & share with non-SF users.  My code is listed below.  

I have everything working as I like except the following 2 elements which I'm not sure how to handle (hoping for some help):

1) I want to sort the output Descending by the report date field
2) I want to make the headers of the table appear at the top of each page (repeating headers)

Can anybody help with this?  It seems simple but I'm getting lost in the details.
<apex:page standardController="Opportunity" renderAs="PDF">
@page { size:landscape;}
.headerRow .TableTitle {
            background-color: #139cd8 !important;
            body {font-family: 'Arial Unicode MS'; font-size:12px}

 <apex:image id="logo1" url="/servlet/servlet.ImageServer?id=015i0000002XNDw&oid=00D630000009OtH&lastMod=1394633629000" width="25%" height="25%"/>
 <apex:pageBlock >

        <apex:pageBlockTable value="{!Opportunity.Visit_reports__r}" var="item" cellpadding="5" columnsWidth="5%,5%,5%,10%,65%" border="1">
            <apex:column style="vertical-align:top; text-align:center" headerValue="Name" headerClass="TableTitle" value="{!item.Name}"/>
            <apex:column style="vertical-align:top; text-align:center" headerValue="Account" headerClass="TableTitle" value="{!item.Account__c}"/>
            <apex:column style="vertical-align:top; text-align:center" headerValue="Report Date" headerClass="TableTitle" value="{!item.Report_Date__c}"/>
            <apex:column style="vertical-align:top; text-align:left" headerValue="Purpose of Visit" headerClass="TableTitle" value="{!item.Purpose_of_Visit__c}"/>
            <apex:column style="vertical-align:top; text-align:left" headerValue="Visit Details" headerClass="TableTitle" value="{!item.Visit_Details__c}"/>

User-added image
User-added image

I Can not find any certificates that are expiring soon. What Should i do?
Processbuilder allows me to create nearly 17 Scheduled actions per Criteria, but would like to know if there is actually any limit or is it implied upon execution of the critiera... There is no direct answer in documentation...
Has anyone worked on soap api & rest api testing & java application testing?
what are the commonly used tools?
how to perform technical & function testing?
what the pros and cons involved?

Pls provide explanation.

In the below, there are two pageblock, in first block is to display the list of Account and second block is to insert the account.And inserted account in second block should be dynamicaly displayed in 1st block. when I click on Save button it's showing the below error.
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Account Name]: [Account Name]
Please can anyone help me to solve this error.

<apex:page controller="multiAccountInsert">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accts}" var="a" reRender="display" >
                  <apex:column value="{!a.Name}"/>  
                  <apex:column value="{!a.Industry}"/>
                  <apex:column value="{!a.phone}"/>             
         <apex:pageBlock >
              <apex:pageBlockButtons location="top" >
                <apex:commandButton value="Save" action="{!Save}" id="display"/>
                <apex:pageblocksection >
                    Enter Name: <apex:inputText value="{!at.Name}"/>
public class multiAccountInsert{

    public Account at { get; set; }

    public PageReference Save() {
    at = new Account();
    insert at;
        return null;

    public List<Account> accts {get; set;}
        public multiAccountInsert(){
        accts = new List<Account>();
        accts = [Select id, Name, Industry, Phone from Account];

First bear with me, I'm an admin learning Apex.

I created a trigger that creates an Opportunity once an Account is created, it's working great but im struggling with the test class.

User-added image

I realize I have an issues with line 5, but im unsure how to insert the date fields into the test account that will then pull through to the new test opportunity (I tried to remove them and got an error that Variable did not exist).  
User-added image

Thoughts?  Help? 

Hi All,
I have written batch apex to insert data in Task from two objects.
I am able to get data from Obj1__c. I am not able to get from Obj2__c
Here is my code.
global class batchTwo Implements Schedulable, Database.Batchable<sObject>{
global void execute(SchedulableContext sc) {

global database.queryLocator start(Database.BatchableContext BC) {
        return database.getQueryLocator([SELECT Id,AccountId__c,F1__c,F2__c FROM Obj1__c]);

global void execute(Database.BatchableContext BC, list <obj1__c> scope) {

    List <Task> taskList = new List<Task>();

   Map<Id, Obj2__c> mapObj2=new Map<Id, Obj2__c>([SELECT Account_Name__r.Id,Obj2_F2__c FROM Obj2__c]);
    for(Obj1__c c : scope) {
            Task tsk             = new Task();
            if(mapObj2.containsKey(c.AccountId__c)) {
             Obj2__c tmpSales = mapObj2.get(c.AccountId__c);
            tsk.WhatId           = c.AccountId__c;
            tsk.ActivityDate     = System.today();
            tsk.Status           = 'Open';
            tsk.Priority         = 'Normal';
            tsk.Subject          = 'call';
    } //close for-loop

        insert taskList;

global void finish(Database.BatchableContext BC) {


I am getting problem in Line no. 21 to 24.
Please suggest me what changes need to be done.
Please help me.
Thanks in Advance
Add to outlook button in event is visible in classic , but not visible in lightening experience
I've got this challenge all wired up, but I have 2 issues. First, the selected boat highlight only works if I name the style "selected". If I call it "tile selected" it breaks (no error, just doesn't show a highlight). I know the 'selected' parameter is being passed correctly -- as I mentioned, it works great with a different style name, but the validation is checking for the specific name 'tile selected'.

If I change the style name to 'tile selected', the validation makes it past that part of the test, even though the CSS styling isn't working right.

The second issue in the validation says: BoatSearchResults.cmp must handle the BoatSelect event by calling a controller function named onBoatSelect. Here's the code I have in BoatSearchResults.cmp:
<aura:handler name="BoatSelect" event="c.BoatSelect" action="{!c.onBoatSelect}" />
And here's the handler in BoatSearchResultsController.js:
onBoatSelect: function(component, event, helper){
        component.set("v.selectedBoatId", event.getParam("boatId"));  
I'm not sure why the validation is choking on this. Any ideas? Did I miss something?

I am getting below error
User-added image

but my application has 
User-added image

May I know why am not able to pass this challenge ?
I have an interesting trigger on Campaign Member that needs to check a value on the associated Lead and associated Campaign and if both are TRUE, it should fire and update a few fields.  The challenge I'm having is that I can't figure out how to get both the Campaign and Lead variables inside of one for loop, without creating a loop inside of a loop, which will inevitably give me a DML insert error.  I create two Sets to get the IDs of the respective Leads and Campaigns, however, when I try to add the Campaign inside of my for loop I'm receiving a "variable doesn't exist" error.  I understand why...it's because I'm creating a "for"' on cml and not cmc (see below).  

I've commented out the code that is giving me issues.  How do I loop through two different objects that are related by a m2m (Campaign Member), relate them to each other, check for values in both Lead and Campaign, then update my Lead?  Any suggestions?
trigger deactivateCampaignSetToResting on CampaignMember (before Update) {
        Set<Id> leadIds = new Set<Id>();
        for (CampaignMember cml: Trigger.new){
        Set<Id> campaignIds = new Set<Id>();
        for (CampaignMember cmc: Trigger.New){
        Map<Id, Lead> LeadMap2 = 
            new Map<Id, Lead>([SELECT Id, Current_Campaign__c, Status 
                              FROM Lead 
                              WHERE Id IN :LeadIDs]);
        List<Lead> leadToUpdate2 = new List<Lead>();
        Lead associatedLead2;
        Map<Id, Campaign> CampaignMap = 
            new Map<Id, Campaign>([SELECT Id, IsActive
                                    FROM Campaign
                                    WHERE Id IN :CampaignIds]);
        for (CampaignMember cml: Trigger.new){
                associatedLead2 = LeadMap2.get(cml.LeadId);
                //associatedCampaign = CampaignMap.get(cmc.CampaignId);    
                //    if( Trigger.oldMap.get(cmc.Id).IsActive != Trigger.newMap.get(cmc.Id).IsActive ){
                            if(cml.Campaign_Lead_Status__c !='Pre-Contracting'){
                                if(cml.Campaign_Lead_Status__c !='Contracting'){
                                    if(cml.Campaign_Lead_Status__c !='Disqualified'){
                                        cml.Campaign_Lead_Status__c = 'Resting';
                                        associatedLead2.Status = 'Resting';
                                        associatedLead2.Current_Campaign__c = '';
        update leadToUpdate2;

I am facing CPU time limit exceed error when code runs in the production, but the same code work perfectly in Full copy sandbox, which is having exact replica of the production.
Also error come only once in the production, when I first time run the VF page and after reloading the page, it works perfectly.

Although I know error is something, which I need to optimize code. But I just want to understand that why I am seeing such a strange behaviou? 
I have a method in Lightning server controller. This method will call an external API. And before calling out, it would check the token. if it's expiring soon, e.g. 1 day, the method will call a method to refresh token. 
The @future method should be very perfect for refreshing token. otherwise it would have a calloutexception error.

But now the problem is even I do nothing ('comment all the code') in the future method, it throws calloutexception error 'You have uncommitted work pending. Please commit or rollback before calling out'. if I remove @future annotation, it would be fine.

So strange!
Hello!  I hope I am conveying this correctly, please feel free to ask me if the below is confusing!

We use ServiceMax in our org to manage cases/etc.  SM comes with it's own suite of buttons that the techs are supposed to use to change the status on their cases.  However, since the inline editting for the 'Status' feild on cases cannot be easily turned off, they were just using the inline edit instead of the SFM buttons from SM to change the status.  

I can't have them doing this however as their are triggers which activate off of the buttons, that don't activate when using inline editting.  I wrote a validation rule to stop them and display a friendly reminder to use the SFM buttons, however I need a way to make an exception to the rule when they use the SFM buttons.  Right now this is my rule:
AND($Profile.Name = 'SVMX-BR-Service User', ISCHANGED(Status))

I need to add some sort of exception so that it does let the users modify the value of the status feild if they are doing through the SFM buttons...any ideas?  Is there a way to clarify that only inline editting should be locked down?

User-added image

Thanks in advance!
Hello - 

We are using a tool called Ninja Form and are having trouble connecting the web to lead form. My developer just gave me this message:

On the website plugin settings page there is a line that reads “Status: Salesforce has not enabled communication for your account. Please check with your Salesforce representative.”, which makes me think that we need to contact a Salesforce rep and ask him to manually activate or install the App I created. Could you help with that?

Can you please help us understand how to complete?

We are looking for a fresh, eager, and passionate Salesforce developer who will work in a team to develop and support Salesforce.com platform for our growing family in Bulgaria. We are flexible when it comes to your location but we prefer to hire Bulgarian developer. This is a project based job, and we are looking for someone with the following skills:
  • 3+ years of professional experience in IT
  • Experience as a consultant is also preferred
  • Experience developing and delivering solutions to real customer problems,
  • 1+ year Force.com development experience
  • Salesforce Developer Certification would be advantageous
  • Design, develop, test our new system based on Salesforce.com
  • Project exposure including configuration, integration, implementation and customization
  • General problem-solving skills in Salesforce.com
  • Train other development resources on Salesforce development practices, as needed
  • An understanding of all major functional areas of Salesforce.com
  • Command on all the advaned developer concepts. 
  • Maintain alignment with Salesforce development best practices
  • Open to feedback. 
  • Willing to learn new things, technologies with respective to Salesforce.com platform
  • Willing to work in a team
  • August 11, 2017
  • Like
  • 0
I want to transfer complete data from one org to other org using eclipse IDE, can any one tell me full procedure to transfer because there are so many errors showing.

I downloaded one org's data by in eclipse as a project, and then i want to deploy to server(it means other org).. but it is showing so many errors.

How should i achieve this!! 
Hi All,

Can anyone help me i am getting below error in the visualforce page, i am displaying 12 dependent picklist in the pageblock section.

Visualforce pages may not display more than 10 dependent picklists together with their controlling fields

Anil Kumar 
Hi Folks,
can any one send  display error messages using java script ?
I am attempting to create a simple register "app" for a small sports charity.

Key Objects 
3Participation_Data__c (junction between 1 and 2)

However, I would like to use another Junction (Participant_Group for example), so users can create groups and add multiple contacts to one event at a time - plus store that data in the pre mentioned junction  (3Participation_Data__c)

Additional Objects
4)Group_at_Session__c (lookup between 2 and 6)
5)Participant_Group_Member__c (junction between 1 and 6)
6)Participant_Group__c (information about the group)

Create Contacts
Create Groups
Create Event, add group via lookup
- take lookup group and add group to the group_at_session junction (working fine)
- find contact ids in group (seems to be working)
- create new junction records with loop (not working)
- remove lookup value from the new Event record (not working)

There is a bunch of logic on the Participation_Events__c object, it may not make complete sense to do it this way, but the event seems to be the main focal point for the org. 

Here is the code, please take a look. 
trigger AddGroupToSession on Participation_Events__c (after insert, after update) {
    for(Participation_Events__c session : Trigger.new) {
        //if(trigger == before update)    
        //  session.Participant_Group__c = null;
        if (session.Participant_Group__c != null)
            Group_at_Session__c sgroup = new Group_at_Session__c();
            sgroup.Sessions__c= session.id;
            sgroup.Participant_Group__c= session.Participant_Group__c;
            insert sgroup;
            ID groupId = session.Participant_Group__c; 
            system.debug('groupId - '+groupId);  
            list<Participant_Group_Member__c> contactIds = 
                [SELECT Contact__c
                 FROM Participant_Group_Member__c 
                 WHERE Crew_Name__c = :groupId 
                 //Limit 1
            system.debug('contactIds 1st - '+contactIds.get(0));
            system.debug('contactIds last - '+contactIds[contactIds.size()-1]);
            system.debug('contactIds count - '+contactIds.size());                
            if(session.Register_Group__c == true){   
                for(integer i = 0; i < contactIds.size(); i++)  {
                    Participation_Data__c obj = new Participation_Data__c(); 
                    obj.Event__c = session.Id; 
                    obj.Participant_Registered__c= contactIds.get(i);
                    insert obj;
                    system.debug('Register = True - '+obj); 
                for(integer i = 0; i < contactIds.size(); i++)  {
                    Participation_Data__c obj = new Participation_Data__c(); 
                    obj.Event__c = session.Id; 
                    obj.Participant_Registered__c= contactIds[i];
                    insert obj;
                    system.debug('Register = False - '+obj); 

I keep getting the same error; I was hoping someone could help. Error message: "Illegal assignment from Participant_Group_Member__c to Id", which occurs on lines (38,51). However, the system.debug shows that the correct Contact Ids are being pulled by the SOQL query, so I am a bit confused. This is my first attempt at coding, so please explain where I've gone wrong.

Thank you in advance!

Hi, when i click on my contact tab, the interface displays in the topright corner the following buttons:
add to campaign

can anyone tell if possible to hide the "import" and "add to campaign" and how?

Unable to login  @ Dev Org. dectivate a flow assicated with login flow for system admin. unable to login  thrown error message while login " no active flow"
I am new in salesforce. I have question about relationships. Is it possible to generate dynamically a generic link between objects? My scenario is to have a custom object with fields like object_id,object_name, field_id, field_name. I would like to build  links between my custom object and other objects.