• Rakesh Aggarwal.ax1406
  • NEWBIE
  • 75 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 34
    Replies

Hi,

 

Is there a tool to migrate data between sandboxes or developer orgs using ANT tool?

I want to automate the process of migrating the data. Can I achieve this?

 

Regards,

Vinay Kumar

Hi,

 

I have a requirement wherein I need to prepopulate the Due Date field on tasks[Created from an Opportunity] by the current date. I have overrridden the New button of tasks with an S-control. 

 

It would be helpful if you could help me in pre-populating the due date field with the current date.

 

 

 

  • July 13, 2012
  • Like
  • 0

Hi All,

 

I have a custom 'create case' button in opportunities that creates a new case from an opportunity, passing some of the opportunity field data across into the case as it does so.

 

The button code looks like this:

 

/500/e?retURL=%2F500%2Fo

&cas4_lkid={!Account.Id}

&cas4={!Account.Name}

&CF00N30000009y6pH_lkid={!Opportunity.Id}

&CF00N30000009y6pH={!Opportunity.Name}

&cas3_lkid={! NULLVALUE (Case.ContactId, Contact.Id )}

&cas3={! NULLVALUE (Case.Contact, Contact.Name )}

&cas5={!Opportunity.Type}

&cas14={!Opportunity.Name}

&cas15={!Opportunity.Requirement__c}

&retURL=/{!Opportunity.Id}

&saveURL=/{!Opportunity.Id}

 

Am I able to disable the function of this custom button if the opportunity stage IS NOT 'closed won'?  Ideally I'd like an alert pop-up box to appear if the 'create case' button is clicked when the opportunity IS NOT 'closed won' but for the button to work as intended and create the new case if the opportunity IS 'closed won'.

 

Any help would be really appreciated.

 

Thanks to all.

 

Steve 

Hi,

 

Is there a tool to migrate data between sandboxes or developer orgs using ANT tool?

I want to automate the process of migrating the data. Can I achieve this?

 

Regards,

Vinay Kumar

Guys, I am little confused. I want to set checkbox on page load in a list of records.

 

I am rendering a list (of Engagement records) on a custom page. The first column of list is a checkbox. This checkbox should be checked on page load if Engagement record has atleast one related Potential record.

 

I tried using inputCheckbox and tried to use selected attribute but it did not work.

I tried using then HTML input checkbox field and tried to use 'checked'

<input id="{!engagement.Id}" value="{!engagement.Id}" type="checkbox" class="checkbox" name="ids" {!IF( ISBLANK(engagement.Potential__r), '', 'checked')}  />

 

 

but VisualForce starts giving error. I am not able to set checkbox on page load. Can anyone provide any clue of how this can be done.

Plz tell me the Relationships between the standard objects given below.

I will be waiting for ur reply..

thank u so much..

 

 

 

 

 

 are u using limited development sandbox,limited staging sandbox,unlimited production sandbox?

 

 Can you tell me what types of sandboxes are thee using?

The Apex Language Reference says the "Total number of classes that can be scheduled concurrently" is 25. 

 

The wording is a little difficult to parse. Which of the following (if any) does this mean?

 

  • I can have at most 25 Schedulable Apex jobs scheduled, even if they're scheduled to run at a wide variety of times that don't overlap
  • I can have at most 25 Schedulable Apex jobs actually running at any one point in time, 

Thanks!

 

I have a scenario where I need custom fields within my custom visualforce page that cannot be generated using <apex:inputField>.  Here's a look at the code (devoid of spaces, for some reason):

 

<apex:pageBlockSectiontitle="Event Date and Time"id="dateSection">

<inputtype="text"id="startDate"style="width:120px"/>&nbsp;

<apex:selectListvalue="{!startHour}"multiselect="false"size="1"id="startHour">

<apex:selectOptionitemValue="01"itemLabel="1"/>

<apex:selectOptionitemValue="02"itemLabel="2"/>

<apex:selectOptionitemValue="03"itemLabel="3"/>

<apex:selectOptionitemValue="04"itemLabel="4"/>

<apex:selectOptionitemValue="05"itemLabel="5"/>

<apex:selectOptionitemValue="06"itemLabel="6"/>

<apex:selectOptionitemValue="07"itemLabel="7"/>

<apex:selectOptionitemValue="08"itemLabel="8"/>

<apex:selectOptionitemValue="09"itemLabel="9"/>

<apex:selectOptionitemValue="10"itemLabel="10"/>

<apex:selectOptionitemValue="11"itemLabel="11"/>

<apex:selectOptionitemValue="12"itemLabel="12"/>

</apex:selectList>:

<apex:selectListvalue="{!startMinute}"size="1"id="startMinute">

<apex:selectOptionitemValue="00"/>

<apex:selectOptionitemValue="15"/>

<apex:selectOptionitemValue="30"/>

<apex:selectOptionitemValue="45"/>

</apex:selectList>&nbsp;

<apex:selectListvalue="{!startAmPm}"size="1"id="startAmPm">

<apex:selectOptionitemValue="AM"/>

<apex:selectOptionitemValue="PM"/>

</apex:selectList>

<apex:inputHiddenvalue="{!startTimeStamp}"id="startTimeStamp"/>

</apex:pageBlockSection>

 

You get the idea.  It's a date.  It has a Date text field, and an Hour, Minue, and AM/PM selectList field.

 

I want to make it look like standard salesforce, within a pageBlockSection.  However, this makes the whole page blow up.  I tried to make the pageBlockSection tag empty and manually create the fields within a table that I made myself using the SF class names on the cells, but then the whole following section disappears in FF and IE.  I can't put them into a pageBlockSectionItem, because it complains that pageBlockSectionItem can only have 2 child elements.

 

Does this make any sense?  Anybody have any clues?

Hello Everyone

 

Any help would be greatly appreciated

 

Error: Compile Error: Initial term of field expression must be a concrete SObject: LIST<Product_Detail__c> at line 274 column 24

 

  public string SelectedAccountId { get; set; }
     public void DeleteDetail()
   {
    // if for any reason we are missing the reference
      if (SelectedAccountId == null) {     
         return;
      }
    
      // find the detail record within the collection
      Product_Detail__c tobeDeleted = null;
     
      for(List<Product_Detail__c> a : products.values())
     // for(Product_Detail__c a : products)
       if (a.name = SelectedAccountId) {
         tobeDeleted = a.name;    <<<<<<Line 274
          break;         
        }     
      //if account record found delete it
      if (tobeDeleted != null) {
       Delete tobeDeleted;
      }
    
      //refresh the data
      //LoadData();
   }   

  • July 19, 2012
  • Like
  • 0

Hey developers. This is my first time posting, and the first Trigger I've put together. I've scoured the boards and documentation, so please forgive me if I'm missing something obvious; I just hit a wall. Here's the trigger I ended up with to try to assign new Contacts to the Account "Individual" if that field is left blank during entry:

 

	trigger SetDefaultAccount on Contact (before insert) {
    Account[] testAccount = [SELECT Id FROM Account WHERE Name = 'Individual' limit 1];
    
  if ( testAccount.size() == 0 ) {
//create Individual account
  testAccount = new Account[1];
  testAccount [0] = new Account(name='Individual');
  insert testAccount ;
}     
    Account yacht = [SELECT Id FROM Account WHERE Name = 'Individual' limit 1];
    
    For (Contact nc:Trigger.new) {
        If (nc.AccountId == NULL)
            nc.AccountId = yacht.Id;}
    }

It passes the following test, both in the Developer edition where I was working on it, and on the client's Enterprise edition where I deployed it:

public class testcontact {
    static testmethod void mytest1() {
        Contact c = new Contact(LastName='test lname');
        insert c;
    }
}

When I add a new Contact in the Developer edition, the Trigger works great. However, when I tried adding a new Contact in the client's edition, I still received the error that the Account field had not been filled in. Any advice y'all have would make my day. Thanks!

I am facing Too many SOQL queries: 101 error while updating records in two objects through trigger when record is inserted.
Tried to resolve this but unable to do so any help would be apprieciated. The code is below

 

trigger UpdateVAAccount on Coaching__c (after insert)
{
if (Trigger.isInsert)
{
 for(Coaching__c t:Trigger.new)
  {
   if(t.VA_ID__c != null)
   {
     if ([select id from Our_VA__c where id = :t.VA_ID__c].size() > 0 )
     {
     Our_VA__c o = [SELECT id, T_Recommendation_Date__c,T_Recommendation_Count__c, T_Recommended_Status__c, T_Recommendation_Client__c FROM Our_VA__c WHERE id =: t.VA_ID__c];
     //for multiple coaching create list of coachings that has this specific VA
     List<Coaching__c> coach = [SELECT VA_ID__c,id, T_Recommendation_Count__c,T_Recommendation_Date__c, T_Recommended_Status__c, T_Recommendation_Client__c FROM Coaching__c WHERE  VA_ID__c =: t.VA_ID__c];   
     //clean previous data in VA
     o.T_Recommendation_Date__c ='';
     o.T_Recommended_Status__c ='';
     o.T_Recommendation_Client__c ='';
     o.T_Recommendation_Count__c = 0;
     update(o);
     //Iterate all coachings and get their records to update in VA
     for(Coaching__c co : coach)
     {
     o.T_Recommendation_Date__c += co.T_Recommendation_Date__c;
     o.T_Recommended_Status__c += co.T_Recommended_Status__c;
     o.T_Recommendation_Client__c += co.T_Recommendation_Client__c;  
     o.T_Recommendation_Count__c = o.T_Recommendation_Count__c + co.T_Recommendation_Count__c;    
     } // for
     update(o);
     } // if
    } //if null  
    
    /*  For Account Update */
    
    
    if(t.Client_ID__c != null)
   {
     if ([select id from Account where id = :t.Client_ID__c].size() > 0 )
     {
     Account o = [SELECT id, T_Recommendation_Date__c,T_Recommendation_Count__c, T_Recommended_Status__c, T_Recommended_VA__c FROM Account WHERE id =: t.Client_ID__c];
     //for multiple coaching create list of coachings that has this specific VA
     List<Coaching__c> coach = [SELECT  Client_ID__c, id, T_Recommendation_Date__c,T_Recommendation_Count__c, T_Recommended_Status__c, T_Recommended_VA__c, T_Name_of_VA__c FROM Coaching__c WHERE Client_ID__c =: t.Client_ID__c];   
     //clean previous data in Account    
     o.T_Recommendation_Date__c ='';
     o.T_Recommended_Status__c ='';
     o.T_Recommended_VA__c ='';
     o.T_Name_of_VA__c ='';     
     o.T_Recommendation_Count__c = 0;
     update(o);
     //Iterate all coachings and get their records to update in Account
     for(Coaching__c co : coach)
     {
     o.T_Recommendation_Date__c += co.T_Recommendation_Date__c;
     o.T_Recommended_Status__c += co.T_Recommended_Status__c;
     o.T_Recommended_VA__c += co.T_Recommended_VA__c;  
     o.T_Name_of_VA__c += co.T_Name_of_VA__c;  
     o.T_Recommendation_Count__c = o.T_Recommendation_Count__c + co.T_Recommendation_Count__c;
     } // for
     update(o);
     } // if
    }  // if null 
    /*  End of For Account Update */
 } // main for
}//If Trigger Insert

}

Hello all,

 

I'm hoping that I can get some help with this code. I'm trying to write a visualforce page to redirect users to an error page for leads with a specific record type id. I seem to have it working for the System Administrator profile, but not for others. Here's what I have so far:

 

public with sharing class DispatcherLeadViewController {
    
    private ApexPages.StandardController controller = null;
    
    public DispatcherLeadViewController (ApexPages.StandardController controller){
        this.controller = controller;

    }
    
    public PageReference redirectDefaultLead(){
        
        Lead l = [Select id, recordtypeid from Lead where Id = :ApexPages.currentPage().getParameters().get('id')];
        
        if (l.recordtypeid == '012C0000000QAWZ') {
        
        return Page.defaultleadredirect;   
    
        } else {
               return new PageReference ('/' + l.id + '?nooverride=1');
        }
    }
}

 Code for page:

 

<apex:page standardController="Lead" extensions="DispatcherLeadViewController" 
  action="{!redirectDefaultLead}">
</apex:page>

I'm not sure what I'm missing. Any help would be MUCH appreciated.

 

Thanks!!!

Hi there,

 

I have a scenario where I need to redirect the User to a new Opportunity page with certain fields based on other related objects.

I have wizard built on visualforce and a controller. During the user journey I collect information from him and finally I need to redirect him

to a page where he could create a new opportunity quickly. The pre population assures the speed of opportunity creation process. 

 

 

What is the Maximum size of PDF(Renderedas=PDF) in Visual Force. Thanks in advance, Kiran.

Hi,

 

I have encountered an issue with Live Agent.

 

It is not working in IE, in other browsers it is working well. is this bug or something?

Hi,

 

Can we make it Field as Read only to particular profile Through coding?

 

If it is possible,let me know how can we do that.

Hi,

 

I have a requirement wherein I need to prepopulate the Due Date field on tasks[Created from an Opportunity] by the current date. I have overrridden the New button of tasks with an S-control. 

 

It would be helpful if you could help me in pre-populating the due date field with the current date.

 

 

 

  • July 13, 2012
  • Like
  • 0