• MithunP
  • SMARTIE
  • 980 Points
  • Member since 2015

  • Chatter
    Feed
  • 30
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 186
    Replies
Hi all,

Was hoping I could get some help with programming a button! I've got a custom object "service" which has a field expirydate__c (date) and a field billfrequency__c (number). 

This sounds easy but for some reason I'm having a really hard time doing it - I'd like to have a 'renew' button which calls a class which simply updates the expiry date to previous expiry date + billfrequency.

Any help much appreciated! 
  • February 17, 2015
  • Like
  • 0
Hi,

everytime someone creates an Event for an Opportunity I want to update the Next Steps-Field with the Event-name+Date.
I guess I have to code a Trigger, but I never coded one. Help anyone?

Greets
Hey,

I need to restrict the user from entrying any duplicate values in the database. I have a Members Object. It has an auto text field and and a member name lookup field which is related to User Object. I don't want any one to pick and add any user from the look field which is already there in my Members list. 

So I have not been able to add this rule to my object. I don't want to use any triggeers for this. Validation rules had not enabled to me do this so far. I also tried to add a filter criteria to the lookup filter. It is not letting me compare the values of Current Lookup Member Name field to Current Record Member Name field. 

Could anyone please suggest any workaround for this ?

 
Hi,

i'm new to batchable class someone help me to find all contacts which does not have account in salesforce and how to send email to that contact account mail-ID
I have the below code:
 
Set<String> fieldNames = schema.describeSObjects(new String[] {'User'})[0].fields.getMap().keyset();
List<String> iterableFields = new List<String>(fieldNames);
String query = 'SELECT '+ String.join(iterableFields,',')+ ' FROM User WHERE Id=:UserInfo.getUserId()';
User user = Database.query(query); //Line 10
When running the code, I am getting the below error:
  1. line 10, column 1
  2. System.QueryException: unexpected token: '('
Can somebody help what is the problem in this?
Hi, I need some help creating a trigger to change the Lead Owner to a user from a custom lookup field also on the Lead object. This is for when a new Lead record is created and the Lead Source is a certain value. Thanks!
  • January 14, 2015
  • Like
  • 0
Why do I get the error stating "Initial term of field expression must be a concrete SOBject: LIST<Case>?
public class HOL_NA_CaseEscalated {
    public static void processCase(Case[] cs) 
    {
        Map<string,id> rType = new Map<string,id>();
        for (RecordType rt : [SELECT id, developername FROM RecordType WHERE isactive=TRUE and sobjecttype='Case']){
         	rType.put(rt.DeveloperName, rt.Id);  // add key/value pairs to map so we can lookup ID by name
        }
        // List all child cases on the triggering Case
        List<Case> CaseChildren = new List<Case>();
        CaseChildren=[SELECT id,casenumber,parentid,subject FROM Case WHERE parentid=:cs.parentid];  
// ERROR DIRECTS ME TO LINE ABOVE
        
		id rsc = rType.get('Record Type One'); 
        id pdc = rType.get('Record Type Two'); 
            
        for(Case c:cs){
            if (c.recordtypeid==rsc){ // This is a Record Type One Case
 				               
            } else if (c.recordtypeid==pdc){ // This is a Record Type Two Case
                
            } else {
                // do nothing
            }
        }
	}
    
}
The error directs me to the last line above.
 
I have a class that needs a test class. 

I was wondering could someone help me create a test class for the class below?

I have been stuggling with this class fora  while help would be miuch appreciated.

Thanks 
 
global class TalentIntCustomerBatch implements Database.Batchable<sObject>, Database.AllowsCallouts{
	global final String query;

	global TalentIntCustomerBatch(String q){
		query=q;
	}
	
	global Database.QueryLocator start(Database.BatchableContext BC){
		return Database.getQueryLocator(query);
	}

	global void execute(Database.BatchableContext BC, List<sObject> scope){		
		for(sObject s : scope){
			Contact c = (Contact)s;
			TalentIntegrationUtils.updateCustomer(c.Id, c.LastName);
		}
	}
	
	global void finish(Database.BatchableContext BC){}
}

 
Hello guys, i'm doing a class test for a error screen that i've created, but it gives me the error NullPointer exception someone could tell me what i'm doing wrong. beacuse when i change my pageReference method to a html address the test covers 80% but when i use my variable retUrl it gives me the error.

My class
public with sharing class ErrorMessage_ctl {	
	
	/****************
	*Public Variables
	*****************/
	private String msg; 		
	private String retURL; 	
	public boolean showButton {get;set;}
	
	/******************
	*Constructor
	******************/

	public ErrorMessage_ctl(){
		msg = System.currentPageReference().getParameters().get('msg');
		retURL = System.currentPageReference().getParameters().get('retURL');
		
		if(functions.isNotEmptyOrNull(msg)){
			ApexPages.addmessage(new ApexPages.message( ApexPages.severity.ERROR, msg ));
		
		}else{
			ApexPages.addmessage(new ApexPages.message( ApexPages.severity.ERROR, 'Ocorreu um erro inesperado!'));
		
		}
		if(functions.isNotEmptyOrNull(retURL)){
			showButton = true;
		
		}else{
			showButton = false;
		
		}
	}
	
	//retorna a página principal
	public PageReference errorReturn(){
		PageReference page = new PageReference(retURL);
		page.setRedirect(true);
		return page;
	}
}

 my test class
 
@isTest
private class ErrorMessage_tst_ctl {

    static testMethod void myUnitTest() {
        ErrorMessage_ctl controlador = new ErrorMessage_ctl();
        
       Test.setCurrentPageReference(new PageReference('msg'));
	   System.currentPageReference().getParameters().get('msg');
		
        //retURL = System.currentPageReference().getParameters().get('retURL');
       
        controlador.showButton = true;
        controlador.showButton = false;
        controlador.errorReturn();
    }
}

 
I created VF page. In that page I have one pageBlock. In that pageBlock I want to add one infoIcon with header.

Please see the Attachement.User-added image

I want to put this icon into red circle.
<apex:imagevalue="/img/msg_icons/info32.png" title="High KPI value indicates High Performance score  OR for some KPIs the high value may mean a low performance score.
        Please add Threshold values/score according to KPI"/>

I want to place new line in "title" attribute. I tried \n, &#10;, \t, but nothing is working.
Please help me.
I tested my class in the sandbox environment and my trigger reported 94%.  But when I tried to move it to production, am geting an error.

StatusID.insertID(), Details: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: [] Class.StatusID.insertID: line 28, column 1 IandUStatusReport, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

The insert works but the Update does not.  I thought the ID would be carried over to the update.

Class:  

@isTest
public class StatusID {
  static testmethod void insertID() {
  Date myDate = Date.today();
  // List<Customer_Fact_Sheet__c> listSTA = new List<Customer_Fact_Sheet__c>();
  // List <Customer_Fact_Sheet__c> cid = [Select Name, Project_c__c from Customer_Fact_Sheet__c   
  //where Name = 'A'];
  //insert data for insert and update status report
    Customer_Fact_Sheet__c cfs = new Customer_Fact_Sheet__c (Name = 'A',Project_c__c = 'a0kd000000ApbI3AA5',Criteria_Defect__c = 'No Defects Know'
       );
//    cfs.Name = 'A';
//    cfs.Project_c__c = 'a0kJ0000001tENQIA2';
//    cfs.Report_Date__c = myDate;
//    cfs.Criteria_Defect__c = 'No Defects Know';
//    cfs.Critical_Enhancements__c = 'Customer wants the Query Editor to run through all tables';
//    cfs.Next_Action__c = 'Testing is starting next week';
//    cfs.Current_Issues_or_Impedients__c = 'No current issues reported at this time';
//    cfs.Current_Services_Personnel_Involved__c = 'John Doe is on the project 75% of the time';
    
//     listSTA.add(cfs);
  try{
     insert (cfs);
  }
 catch (Exception e) {
      system.debug('Exception'+e);}
   //Update data  
     cfs.Criteria_Defect__c = 'N/A';
    update (cfs);     
   }
 }

Trigger:

trigger IandUStatusReport on Customer_Fact_Sheet__c   (after insert, after update)
{   
    List<Status_Report__c> listSTA = new List<Status_Report__c>();
    List<Status_Report__c> updsta = new List<Status_Report__c>();
    MAP <String, Customer_Fact_Sheet__c> objMap = new Map<String, Customer_Fact_Sheet__c>();
     for (Customer_Fact_Sheet__c cfs : Trigger.new){ 
       List<Status_Report__c > dupes =[ Select Status_Unique_ID__c, Name from  Status_Report__c 
       where Status_Unique_ID__c = :cfs.Status_Unique_ID__c LIMIT 1];
           if (dupes.size() == 0) { 
            Status_Report__c sta = new Status_Report__c();
          // Insert new Status record
            system.debug(cfs.Project_c__c);
            sta.Status_Unique_ID__c = cfs.Status_Unique_ID__c;
            sta.Project__c = cfs.Project_c__c;
            sta.Report_Date__c  = cfs.Report_Date__c;
            sta.Critical_Defects__c  = cfs.Criteria_Defect__c;
            sta.Critical_Enhancements__c  = cfs.Critical_Enhancements__c;
            sta.Next_Action__c  = cfs.Next_Action__c;
            sta.Current_Issues_or_Impediments__c  = cfs.Current_Issues_or_Impedients__c;
            sta.Services_Personnel_Involved__c  = cfs.Current_Services_Personnel_Involved__c;

           listSTA.add(sta);
  try{
     insert listSTA;
  }
 catch (Exception e) {
      system.debug('Exception'+e);
   }
         
   }
       
     
       
       for(Status_Report__c sr: dupes)
       {
          Customer_Fact_Sheet__c cfs1 = objMap.get(sr.Status_Unique_ID__c);
          // Update new Status record
            system.debug(sr.Status_Unique_ID__c);
            sr.Status_Unique_ID__c = cfs.Status_Unique_ID__c;
            sr.Report_Date__c  = cfs.Report_Date__c;
            sr.Critical_Defects__c  = cfs.Criteria_Defect__c;
            sr.Critical_Enhancements__c  = cfs.Critical_Enhancements__c;
            sr.Next_Action__c  = cfs.Next_Action__c;
            sr.Current_Issues_or_Impediments__c  = cfs.Current_Issues_or_Impedients__c;
            sr.Services_Personnel_Involved__c  = cfs.Current_Services_Personnel_Involved__c;

          updsta.add(sr);}  
  if(updsta.size() > 0){ 
  try{
     update updsta;
  }
 catch (Exception e) {
      system.debug('Exception'+e);} }}

}
 
Hi All, 
I am using split function and new line character to split the long text area field and show them in different lines. It is working fine but it is also adding parentheses around every text in new line. I don't want them to add parentheses around every text. Below is my code.

rEntry.Publisher_URLs__c += ' ' + rC.publisher_Site_Placement_URL__r.Name.split('\n') + ';';

Output:
(sportsgroundgames.com); (womenshealthbase.com); (wwe.com);

Desired Output:
sportsgroundgames.com; womenshealthbase.com; wwe.com;

Can someone help me in removing parentheses. Thanks is advance.
 
Hi,

function newDoc() {
            window.top.location.href ='http://www.google.com/inquiry?property='+{!urlpropertyname};
            alert({!urlpropertyname});
        }

<apex:commandbutton value="getURL" onclick="newDoc();"/>

help me..
Hi,
Case object have picklist field of  Stage = Closed "Stage is a picklist field"
 
I am trying to write a trigger that creates an Opportunity when a case is closed, the opportunity would be attached to the Account that was associated to the case. Here is what I have, anyone have any help here?


trigger Opportunitycreate on case (after insert) {
    List<opportunity>Listopp = New List<opportunity>();
    for(case acc:trigger.new){
       if(acc.Create_opp__c=True){
        Opportunity opp = New opportunity();
        opp.name=acc.name;
        opp.CloseDate=date.Today();
        opp.StageName='Prospecting';
        Listopp.add(opp);
       }
       }
    if(Listopp.size()>0)
    insert Listopp;
}
 
Hi,
  I need to autopopulate the number datatype field after the record is deleted.
For example,
I have 5 records and their serial numbers are  1,2,3,4 and 5. If i delete the 3rd record , then the serial number of the 4th record should be automatically populated as 3 and 5th records as 4.
How to achieve this delete operation?

My Trigger Code:

trigger RecordSteps on Record__c(before insert,after delete) 
    {
        List<Record__c> cp = new List<Record__c>(); 
        set<id> id = new set<id>();
        List <AggregateResult> requirements = new List<AggregateResult>();  
       if (Trigger.isBefore && Trigger.isInsert)
       { 
        for(Record__c pt:trigger.new)
        {
         requirements=[select Count(Seq__c) from Record__c];
         if(requirements.size() > 0)
         {
         for(AggregateResult ar:requirements)
         {
         pt.Seq__c = Decimal.ValueOf(String.ValueOf(ar.get('expr0')));
          }
      }
      }
}
      if (Trigger.isAfter&& Trigger.isDelete) 
      {
      for(Record__c pt1:trigger.old)
        {
          }
          }   
     }
Hi All,

Any one please advise me how to write a trigger that will send an email to alert when that record is created or updated or deleted.. Thanks!
Hi All

Have created this trigger to create a in opt in trial record when the opt in checkboxs are changed on the contact..
Have created this trigger on the contact record but it doesnt seem to do anything.. have gone through the debug logs and it is being stepped through but nothing happens.. any help would be much appreciated.


trigger CreateOptInTrail on Contact (after insert, after update){
    
    List <Opt_In_Trial__c> optToInsert = new List <Opt_In_Trial__c>();

        for (Contact c : Trigger.new){
        System.debug('Hello');

            if (c.Channel__c != null ){
System.debug('Hello123');
    Opt_In_Trial__c o = new Opt_In_Trial__c ();
    
    
        o.Contact__c = c.Id;
        o.Channel__c = c.Channel__c;System.debug('channel');
        o.Email_Opt_In__c = c.Email_Opt_In__c;System.debug('Email');
        o.Phone_Opt_In__c = c.Phone_Opt_In__c;System.debug('Phone');
        o.Post_Opt_In__c = c.Post_Opt_In__c;System.debug('Post');
        o.SMS_Opt_In__c = c.SMS_Opt_In__c;System.debug('SMS');
       

    optToInsert.add(o);
}

}
here is my class


global class BT_Invoicing_New_Override_Crtl {

    public ApexPages.StandardController stdCon;
    public BT_Invoicing__c btinvoice{get;set;}
    public Static Integer BtjoblstSize;
    public Double Local_DFE_Quantity;
    public Double Local_Invoice_Cost_excl_vat;
    public String recordId;
    BT_Invoicing__c btinvoiceRecord;
    Public Static String btEstimateNumber;

    public BT_Invoicing_New_Override_Crtl(ApexPages.StandardController controller) 
    {
        stdCon= controller;
        btinvoice= (BT_Invoicing__c)stdCon.getRecord();
        recordId=ApexPages.currentPage().getParameters().get('id');
    } 
   
    public PageReference Save(){
    try{

        btinvoiceRecord= (BT_Invoicing__c)stdCon.getRecord();
       
        
            if(btinvoiceRecord.Invoice_Cost_excl_vat__c==null)
            Local_Invoice_Cost_excl_vat=0;
         else
            Local_Invoice_Cost_excl_vat=btinvoiceRecord.Invoice_Cost_excl_vat__c;
            
          if(btinvoiceRecord.DFE_Quantity__c==null)
             Local_DFE_Quantity=0;
          else
              Local_DFE_Quantity=btinvoiceRecord.DFE_Quantity__c;
            
     if(btinvoiceRecord.Pay__c=='Yes'&& ( Local_Invoice_Cost_excl_vat- Local_DFE_Quantity > 0)
                                         && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='PAID-DFE';
     else if(btinvoiceRecord.Pay__c=='Yes'&& (Local_Invoice_Cost_excl_vat- Local_DFE_Quantity==0) 
                                         && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='Paid';
     else if(btinvoiceRecord.Pay__c=='No' && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='Active';
        
     
        
        upsert btinvoicerecord;
                
        PageReference pageref = new Pagereference('/'+btinvoicerecord.id);
        pageref.setRedirect(true);
        return pageref;
        
        return null;
      }
    catch(Exception ex){
        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR,ex.getDMLMessage(0));
        ApexPages.addMessage(msg);
        return null;
    }    
  }
  
  public PageReference SaveandNew(){
    try{
        stdCon.Save();  
        return new PageReference('/'+stdCon.getRecord().getSObjectType().getDescribe().getKeyPrefix()+'/e?');
         
      }
    catch(Exception ex){
        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR,ex.getDMLMessage(0));
        ApexPages.addMessage(msg);
        return null;
    }    
  
  }
  
  @RemoteAction
 Public Static Integer GetEstimateListsize(String btestimateno)
  {
         List<BT_Job__c> Btjoblst=[Select Id,Name,Estimate_No__c From BT_Job__c Where  Estimate_No__c=:btestimateno];
         BtjoblstSize=Btjoblst.size();
         System.debug('BtjoblstSize='+BtjoblstSize);
         return BtjoblstSize;
  }
  
   
}

n this is my test class

@istest
public class BT_Invoicing_New_Override_Crtl_Test {
    
     public static testmethod void myTestUnit1(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=55.20;
        btInvObj.DFE_Quantity__c=45.30;
        btInvObj.Pay__c='Yes';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        
        insert btInvObj;
         
          ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
     public static testmethod void myTestUnit2(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=45.30;
        btInvObj.DFE_Quantity__c=45.30;
        btInvObj.Pay__c='Yes';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
         
         
     
         ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
     public static testmethod void myTestUnit3(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=00.00;
        btInvObj.DFE_Quantity__c=00.00;
        btInvObj.Pay__c='No';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
         
         
    
         ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
    public static testmethod void myTestUnit4(){
      
       
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=10.00;
        btInvObj.DFE_Quantity__c=10.00;
        btInvObj.Pay__c='No';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
       BT_Invoicing__c btInvObj1=[select id , Invoice_Status__c from  BT_Invoicing__c where id=:btInvObj.id];
       
        PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        Test.startTest();
      
      ApexPages.StandardController sc = new ApexPages.standardController(btInvObj1);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.SaveandNew();
      
        

       }
}

I need to increase the code coverage ,its nt covering remote action method and catch block
please help me out
Hi All,

We are looking to integrate salesforce with onedrive for storing attachemnts. We have a file upload option in VF page, once user selects file and upload then file should be store in onedrive and a link has to be provided in salesforce custom object. Is there any examples/steps available for this process.

Thanks in Advance!!
Hi All,

We are trying to get access token from external system. We have external system client id, client secret and endpoint url but not having username and password. Is it possible to get access token from external system using Oauth without UN and Password.

Thanks,
Mithun.
Hi All,

As part of my client requirement, we created 30 days free trial enterprise edition org and developed some components and uploaded some data.

Now, we need to convert this trial org to Production and purchase some additional licenses from salesforce. For this we have contacted salesforce support team through partner portal. But they said that we should submit an order through the Channel Order App.  

We installed COA app in my trial org and sent request for Service Order Credentials. The response from support team is "Have you signed a contract as an OEM Partner? You'd only be able to use Channel Order App (receive Service Order Credentials) if you are contracted as a Partner. Who is your ISV AE?"

We are not signed on any contract till now, but we need to convert my trial org to Production and we will purchase license from salesforce. What is the best and easy way to convert trial org as Production.

Best Regards.
Hi All,

We have a situation to deploy client organization complete metadata (Like Packages, Objects, Classes, Sites etc..) to free developer edition since client org licences are going to expire and they are not ready to renewal those licences. But in future they might need these org, so we are trying to deploy the all components to DE. We have considered following options.

1. CloudAlly, a third party tool, we can take a backup of org(metadata and data) but we can't restore to another org.
2. Force.com IDE, we can take a backup of org(metadata but not installed packages), we need to re install all installed packages in developer edition (we have some paid packages so customer is not ready to pay again for these packages).

Please suggest the best ways to do this :)

Best Regards,
Mithun.
Hi All,

We have a situation to deploy client organization complete metadata (Like Packages, Objects, Classes, Sites etc..) to free developer edition since client org licences are going to expire and they are not ready to renewal those licences. But in future they might need these org, so we are trying to deploy the all components to DE. We have considered following options.

1. CloudAlly, a third party tool, we can take a backup of org(metadata and data) but we can't restore to another org.
2. Force.com IDE, we can take a backup of org(metadata but not installed packages), we need to re install all installed packages in developer edition (we have some paid packages so customer is not ready to pay again for these packages).

Please suggest the best ways to do this :)

Best Regards,
Mithun.
I have a doubt on Permission set and Profile..

which  is applied to Object level and record level.. can you give example for what we can an cannot do in object and record level?

Thanks,
Hi all,

Was hoping I could get some help with programming a button! I've got a custom object "service" which has a field expirydate__c (date) and a field billfrequency__c (number). 

This sounds easy but for some reason I'm having a really hard time doing it - I'd like to have a 'renew' button which calls a class which simply updates the expiry date to previous expiry date + billfrequency.

Any help much appreciated! 
  • February 17, 2015
  • Like
  • 0
Hi,

everytime someone creates an Event for an Opportunity I want to update the Next Steps-Field with the Event-name+Date.
I guess I have to code a Trigger, but I never coded one. Help anyone?

Greets
Hey,

I need to restrict the user from entrying any duplicate values in the database. I have a Members Object. It has an auto text field and and a member name lookup field which is related to User Object. I don't want any one to pick and add any user from the look field which is already there in my Members list. 

So I have not been able to add this rule to my object. I don't want to use any triggeers for this. Validation rules had not enabled to me do this so far. I also tried to add a filter criteria to the lookup filter. It is not letting me compare the values of Current Lookup Member Name field to Current Record Member Name field. 

Could anyone please suggest any workaround for this ?

 
Hi,

i'm new to batchable class someone help me to find all contacts which does not have account in salesforce and how to send email to that contact account mail-ID
I have the below code:
 
Set<String> fieldNames = schema.describeSObjects(new String[] {'User'})[0].fields.getMap().keyset();
List<String> iterableFields = new List<String>(fieldNames);
String query = 'SELECT '+ String.join(iterableFields,',')+ ' FROM User WHERE Id=:UserInfo.getUserId()';
User user = Database.query(query); //Line 10
When running the code, I am getting the below error:
  1. line 10, column 1
  2. System.QueryException: unexpected token: '('
Can somebody help what is the problem in this?
We have a custom object called Production Details and need three fields from that object to push back onto the related Opportunity Product. I set up an auto-numbering field on the Oppty Prod so each would have a unique identifier in order to match each Production Detail. I created a text field on the Production Detail where the user will input that number. Just for the heck of it, I looked at a WFR first knowing there are limits with Oppty Prod and custom objects and probably not possible. The WFR is set up so that once those two numbers match, the field updates for the three fields would kick in. The forumlas are all working with no errors. I've tried every configuration and still the updates are not happening so back to Plan A for a button. I've looked up and tried several codes for buttons to send the data from the Production Detail object to the related Oppty Product but have been unsuccessful.

Anyone know have code for such a thing or know if it's possible to create a "Send to Oppty Prod" button that will send the data from our Production Detail to the matching Oppty Prod?
Hi,
Could somebody help me round a number in my apex code?. Namely I have a number for example:
53732.99999999, then I would round this number to 53,733.00
Currently I am using the following code:
roundNumber.setScale(2,System.Roundingmode.DOWN).format(),
although is not formating the number correctly as I am receiving 53,732.99. Any help will be appreciated

Thank in advance
Hi all - I'm trying to figure out the appropriate way to have a trigger to update a lead's status to "SDR Meeting Booked" if an event activity is created by someone whose user profile ID = 00eE0000000adW0.

Modifying some code I found elsewhere I have the first part down (changing status based off an activity being created), but I'm not sure how to modify this to account for the second piece.

Total developer noob here, so any help is appreciated!
 
trigger changeLeadStatus on Event (before insert, before update) {
    String desiredNewLeadStatus = 'SDR Meeting Booked';

    List<Id> leadIds=new List<Id>();
    for(Event t:trigger.new){
            if(String.valueOf(t.whoId).startsWith('00Q')==TRUE){//check if the task is associated with a lead
                leadIds.add(t.whoId);
            }
    }//for
    List<Lead> leadsToUpdate=[SELECT Id, Status FROM Lead WHERE Id IN :leadIds AND IsConverted=FALSE];
    For (Lead l:leadsToUpdate){
        l.Status=desiredNewLeadStatus;
    }//for
    
    try{
        update leadsToUpdate;
    }catch(DMLException e){
        system.debug('Leads were not all properly updated.  Error: '+e);
    }
}//trigger

 

Hi

 

Can I make an production org without creating an trial environment.Or is it compulsory that we need to create trial org compulsory for provisioning the org for the client.

 

 

Regards,

Atif