• deepabalisfdc
  • NEWBIE
  • 30 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 22
    Replies

I have custom objects A,B,C,D which has look up relation in another object E. Now I want to create one VF page in which all all the fields of each object will come and on click of save all record will be saved. Means on one VF page I wnt to save multiple objects record. I know that I need to create the controller. Please explain in detail with code.

 

regards

Raman

Is there option available in Salesforce to add a custom button in Report?
Please let me know, its urgent.

Thanks in advance

I am getting an error when installing Force.com IDE.
Please help me.Thanks in advance. I have WIndows 7 32 bit.
I can not paste screen capture. Its adiaog saying:

JVM Terminated. Exit code = -1
-Dfile.endoing = UTF8
.....
- XX:MaxperSize = 512M...........................
I can send my capture by email if anyone need to see.

When do we use __r? 

 

Can we use __r both in Parent Object and in custom object?

 

-Kaity

  • July 22, 2013
  • Like
  • 0

Hi All,

 

I am opening one VF page on click of edit fo lis view of particular object. Now I want to get the id of that particular record which I edited. I am writing this code but its throwing this error.

 

Cyclical server-side forwards detected: /apex/CasePopulate

 

VF Code

<apex:page standardController="Case_Accession__c" extensions="ExtentionController1" action="{!pageredir}"  >
    <apex:form >
    <apex:pageBlock >
     <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page
  <!-- End Default Content REMOVE THIS -->
 <apex:inputText value="{!TestEditSpecimenID }"/>
    </apex:pageBlock>
      </apex:form>
 </apex:page>

 

Apex Code

 

public class ExtentionController1
 {
         public String var {get;set;}
         public string TestEditSpecimenID {get;set;}
     public ExtentionController1(ApexPages.StandardController controller)
     {}
     public Pagereference pageredir()
     {
      var= ApexPages.currentPage().getParameters().get('Id');
           if(var!=null)
           {
             TestEditSpecimenID = var;
             Pagereference newpage = new Pagereference ('/apex/CasePopulate');
              //Pagereference newpage =Page.Accession;
            return newpage;
           }
            else
           {
             //Pagereference newpage =Page.Accession;
             return null;
           }
     }
 }

 

 

One more thing please I want to show the ID of reord into " <apex:inputText value="{!TestEditSpecimenID }"/> "

 

Thanks in advance
Raman

 

 

Is there option available in Salesforce to add a custom button in Report?
Please let me know, its urgent.

Thanks in advance

I have custom objects A,B,C,D which has look up relation in another object E. Now I want to create one VF page in which all all the fields of each object will come and on click of save all record will be saved. Means on one VF page I wnt to save multiple objects record. I know that I need to create the controller. Please explain in detail with code.

 

regards

Raman

Anyone see the error in the test method below?  The thing compiles fine but I see a bug in it that is the error "cannot modifu a list while it's being iterated"

 

Annoying thing is I did this last week but forgot how I resolved this.  It's obvious I just don't see it.  Anyone see what's wrong with this code?

 

Thanks

 

	static testMethod void testEngagementsCreatedByOppUpdate()
        {

             Account acct = new Account(name='test account');              
             insert acct;
		
	     Opportunity[] oppsToCreate2 = new Opportunity[]{};
		
                 for(Integer x=0; x<200;x++)
                 {
		      Opportunity opp = new Opportunity();
                      opp.AccountId=acct.Id;
                      opp.Name = 'Test'+x;
                      opp.Probability = 10;   
                      opp.Type = 'Trial';
                      opp.CloseDate = System.Today();
                      opp.Region__c = 'East';
                      opp.Territory__c = 'BE South';
                      opp.LeadSource = 'Chat';
                      opp.StageName = 'Evaluating';
                      opp.License_type__c = 'Subscription';
                      opp.Forecasted_Amount__c = 1;
                      opp.ELA__c = 'No';
                      opp.Services_Use_Case__c = 'test text'+x;
                      opp.Work_Location__c = 'Onsite';
                      opp.Size_of_Deal__c = '0-25K';
                      opp.Services_Planned__c = 'Client Services';
                      opp.Customer_s_Expected_Start_Date__c = 'This month';
                      opp.Expected_Services_Work_Hours__c = '5-10 hours';
                      opp.Term__c = 1;
		      oppsToCreate2.add(opp);
		 
		}

		insert oppsToCreate2;

               for(Opportunity opp: oppsToCreate2)
               {
                  opp.Probability=80;
                  opp.Services_to_be_Delivered_by__c = 'Training Team';
                  oppsToCreate2.add(opp);
               }
 
                update oppsToCreate2;

                List< SFL5_Projects__c > insertedEngagements2 = [SELECT Name, Id
                                      FROM SFL5_Projects__c 
                                      WHERE Opportunity__c IN :oppsToCreate2];
              
                Integer size2 = insertedEngagements2.size();
                system.assertEquals(200,size2);   		   
		Test.stopTest();	

	}	

 

  • June 27, 2013
  • Like
  • 0

below is my trigger where I am trying to update the value in field But couldnt update because of recursive trigger.

 

what needs to be done to update the value

 

trigger UpdateCallsByOtherTerritories on String__c(after update) {
for( String__c doc:trigger.new){            

    List<Account> AccountList = [Select Total_Calls_Formula__c,called_by_other__c , OwnerId, Co_Owner__c, Name from Account where name = :doc.Account__r.name];
    List<Account> listOfUpdatedAccounts = new List<Account>();
    
    for (account indexAccount:AccountList)
    {
        if (indexAccount.OwnerId == userinfo.getuserid()) { }
        else
        {
            indexAccount.called_by_other__c = indexAccount.called_by_other__c + (doc.Updated_CallString__c - Trigger.oldMap.get(doc.Id).Updated_CallString__c);
            
        }}

 

Hi,

 

  Here I have created site.  In visualforce page I have given facility to download the attachment.like

 

<apex:outputLink value="{!URLFOR($Action.Attachment.Download, attach.id)}" target="_blank"  style="text-decoration:none;">Download Consignment note</apex:outputLink>

 

It is not working in sites.

 

Is there any other way to download attachment through sites

Hi,

 

I refreshed sandbox(Test) from production and now I am unable to access that.

 

I am following the below credentials.

 

Usename:  Production Username.test

Password: Production Password

 

Could any one help me on this please.

 

 

Hello, I'm pretty new to salesforce and I'm trying to deploy a trigger I adjusted from an online source.

 

I cannot deploy/validate the trigger, because the results of the Test coverage are 0%. However, when I run the code on the developer console, I get higher percentages. Still, there are some tests that the code fails in the DC as well. I would appreciate any help in getting past this stage.

 

The code is meant to prevent deleting contacts of a certain record type id. Here are the code and the test:

 

//Prevent deleting a contact that is associated with a 203k disbursement
trigger dontDelete on Contact (before delete)
{
for (Contact x : Trigger.old)
{
if (x.RecordTypeId=='01250000000DwuV')
{
x.addError('You cannot delete this an account of type "Contractor"');
}
}
}

 

 

@isTest
private class TestDontDelete
{
static testMethod void myUnitTest()
{
List<Contact> con = [SELECT id FROM Contact WHERE RecordTypeId ='01250000000DwuV'];

try
{
delete con;
}
catch (dmlexception e)
{
system.assert(e.getMessage().contains('You cannot delete this an account of type "Contractor"'),
e.getMessage());
}
}
}

 

 

 

  • June 26, 2013
  • Like
  • 0

I want to display 2 weeks Opportunities  data in the fallowing table.

 

How to display ....?

Please help me 

 

 

    Statistics                                                      This Week (opportunities)           Previous Week (opportunities)    

 

Total Amount(Sum of Amount )                                             4000                           4500

 No of Opp (Count)                                                                     10                                 12

I have a custom field in Opportunity is Auto_Number__c

 

i have a trigger like this

trigger updateactive on Opportunity(before insert){



for(Opportunity c : Trigger.new){

if(c.StageName == 'Closed Won')
c.Auto_Number__c=c.Auto_Number__c+1;

}

}

 I want to increment the old record Auto_Number__c and update like2,3,4 etc  like that when opportunity is closed won

 

Hi,

I am trying to make a schduler for our field staff. Which will help us to check which person is working on which field.

This scheduler Will have Date, Machinery number, Field memebers name. We are using it in excel at present. Want to use this on sales force. Please help me out in making this scheduler. 

 

 

 

Thank you

  

I am trying to get current date, when any body select status picklist from deferred,declined or closed. I wrote the formula for it but the problem is when resolved date is set to current date but if I open that request after it is closed after two or three days , it is changing my date to current date ( New). The formula is below.

Resolved Date=

IF( OR(ISPICKVAL(Status__c ,'Declined - Business Lead (Closed)'),ISPICKVAL(Status__c ,'Declined - Change Control (Closed)'),ISPICKVAL(Status__c ,'Deferred - Business Lead (Closed)'),ISPICKVAL(Status__c ,'Resolved - CRM (Closed)')),TODAY(), null)

 

I closed one req on 14th April , resolved date field shows thevalue 14th April but if I open that req after two days the resolved date field change its value from 14th to 16th without doing anything. Please help me.