• Keerthigee
  • NEWBIE
  • 110 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 71
    Replies
I have created the below Visualforce page which gets the data for the Opportunity object from the user. The Opportunity object has a field - Account name which contains a lookup to the Account object. But when I refer it through the Inputfield using {!opportunity.account.name}, it is displayed as a text box and not as a lookup field to Account object. Can someone please tell me how to modify the code? 

<apex:page controller="opptycontroller" tabStyle="Opportunity">
<apex:sectionHeader title="New Customer Opportunity" subtitle="Step 2 of 3"/>
    <apex:form >
        <apex:pageBlock title="Opportunity information" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!step3}" value="Next"/>
            </apex:pageBlockButtons>
        <apex:pageBlockSection title="Opportunity products">
            <apex:inputField id="opportunityType" value="{!opportunity.type}"/>
            <apex:inputField id="opportunityLeadSource" value="{!opportunity.LeadSource}"/>
            <apex:inputField id="opportunityProbability" value="{!opportunity.Probability}"/>
           <apex:inputField id="opportunityAccountName" value="{!opportunity.account.name}"/>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Hi All,

    I want to insert date from backend.For this,I want to know date format.

I tried this YYYY-MM-DD.But I am getting error..

Can anyone help me??

Kindly support and suggest.

Thanks.
Hi All,

    I want to write a testcode  for trigger to 75 or 100%  code coverage for uploading a package as follows:
 

  trigger BorrowIncrement on Borrow_Books__c (after insert) {
     set<id> mem =new set<id>();
for(Borrow_Books__c b:trigger.new){
    if(b.Member__c!=NULL)
        mem.add(b.Member__c);
}

List<Members__c> memlist=[Select id,name,Borrowed_Books__c,(select id,name from Borrow_Books__r) from Members__c where ID in :mem];
for(Members__c m:memlist){
    m.Borrowed_Books__c=m.Borrow_Books__r.size();
}
update memlist;

}

Can anyone help me.

Kindly support and suggest.
Hi All,

      I want to migrate sandbox changes to production.For this, I tried to use Setup-->Deploy--->Deployment connections.

But,I didn't  find deployment connections in Developer Edition.I think, it is not Possible with developer edition.

In which edition it is possible.How?

Can anyone help me.

Kindly support and suggest.
Hi All,

  I have created custom application like Education.In  this app contains 3 objects i.e Students(fields like Name,Age,Class),Teachers(fields like Name,Age,Subject,Experience),Classrooms(Room no).

I want to deploy objects ,fields and Whatever Classes,Visualforce pages,Validations,Triggers related to app only but not all are present in instance of developer edition.

Can anyone help me.

Kindly support and suggest.

Hi All,

      I want to create a custom app( project) in Eclipse.Using this https://developer.salesforce.com/page/Force.com_IDE_Installation ,I have installed Eclipse and ready to use.

After this,I tried to create a new project  in Eclipse by clicking new Force.com project and then entered my credentials(username,password(password+security token) of developer edition.

I am getting error as


 User-added image


Can anyone help me?

Kindly support and suggest.
Hi All,

I want to arrange the fields in two column fashion in top down sequence in custom object with out using vf page.

I had used  sections in pagelayouts,but i didn't get it.

Can anyone help me.

Kindly support and suggest
Hi All,

I have an  custom object called Teacher.It contains field called Teacher name.

If once the record is saved then I want to display the name of the teacher on saved screen? How?

Can anyone help me.

Kindly support and suggest.

Thanks
Hi All,

I want to write articles related to triggers,visualforce pages etc.

I have no idea of writing articles in salesforce.I am new for articles.

Can any one help me.

Kindly support and suggest.
Hi All,

   I want to access campaign field in lead object  from visualforce using custom controller.

Leads and campaigns are not related to each other.For this,I want to create junction object between leads and campaigns.But,we  cannot create a master detail relationship from custom object to leads.Then how?

Can anyone help me?

Kindly support and suggest.
Hi All,

I have created a custom field like sign in contact object.I want to enter any signature(image) in sign__c and then save this record.

If i want to view this record then this  field shows graphihcal sign which i wrote in <img>tag..

Can anyone help me?

Kindly support and suggest.
Hi All,

I have created a custom field like sign with datatype textarea(long) in contact object.Whenever I enter sign in that field then it displays image as below the field.

Can anyone hepl me?

I think ,it is possible with visualforce with custom controller(using img tag).

Kindly support and suggest.
Hi All,

I want to write trigger to count number of leads associated with account.Can anyone help me?

I created two fields as Parentlookup__c (lookup field) in lead object  and rollupcounter__c in account.

I wrote this trigger on lead object.

trigger leadcont on Lead (after insert) {
    Integer leadcnt ;
List<Account> ActData = new List<Account>();
//Account[] ActData = new Account[]{};

for (Lead ld:trigger.new)
{
if (ld.parentlookup__c <> null)
{
for(Account Act : [SELECT Id,rollupcounter__c FROM Account WHERE Id = : ld.parentlookup__c])
{
  leadcnt = integer.ValueOf(Act.rollupcounter__c)+1;
  ActData.add(new Account(Id=ld.parentlookup__c, rollupcounter__c=leadcnt));   
}
}
}
if (!ActData.isempty())
{
    update ActData;
}


}

I am getting an error "Invalid constructor syntax,name=value pairs only valid for Sobjects".

Kindly support and suggest.
Hi All,

I want to display total no of leads  created  in account object.Here,Account is parent object and lead -child object.

Through report ,we can get number of leads ina particular period for particular object.But i want to update no of leads in parent object.How?


I had created a fields i.e parentlookup__c on lead  and Rollupcounter__c on account field.

and I wrote trigger as

trigger count on lead (after insert, after update, after delete, after undelete) {
  Map<Id,account> m = new Map<Id,account>();
  if(Trigger.new<>null)
    for(lead l:Trigger.new)
      if(l.ParentLookup__c<>null)
       m.put(l.ParentLookup__c,new Account(id=l.ParentLookup__c));
  if(Trigger.old<>null)
    for(lead l:Trigger.old)
      if(l.ParentLookup__c<>null)    
        m.put(l.ParentLookup__c,new Account(id=l.ParentLookup__c));
  update m.values();
}

I got an error as "Invalid Constructor syntax,name=value pairs can only be used for Sobjects" on line 6


trigger noofleads on Account (before insert,before update) {
    for(Account a:Trigger.new)
    a.RollupCounter__c = 0;
   for(lead l:[select id,ParentLookup__c from lead where ParentLookup__c in :Trigger.new])
    Trigger.newMap.get(l.ParentLookup__c).RollupCounter__c++;
}


I am getting an error as " Variable doesnot exist :Rollupcounter__c" on line 6.

Kindly suggest and support.
Issue related to lead

Hi All,

I want to display total no of leads  created  in account object.Here,Account is parent object and lead -child object.

Through report ,we can get number of leads ina particular period for particular object.But i want to update no of leads in parent object.How?

Can anyone help me?

Kindly support and suggest.

Thanks.
Hi All,

I want to display total no of leads  created  in account object.Here,Account is parent object and lead -child object.

Through report ,we can get number of leads ina particular period for particular object.But i want to update no of leads in parent object.How?

Can anyone help me?

Kindly support and suggest.

Thanks.


Hi All,

Here contact is having custom field primary of type checkbox
● Each account may have multiple contacts but only one marked “Primary”
● Each account must have 1 primary contact.
● The account should display the name of its primary contact on the account detail screen (i.e. in a field).

I wrote code as 

trigger primarycontact on Contact (before insert,before update) {
   
    set<id> accid= new set<id>();
    set<id> conid=new set<id>();
    list<contact> con=new list<contact>();
    for(contact c:trigger.new)
    {
       if(trigger.isInsert)
       {
          if(c.Primary__c == true)
          {
             AccID.add(c.Accountid);
             conId.add(c.id);
           }
        }
        else if(trigger.isUpdate)
        {
           if(trigger.oldMap.get(c.id).Primary__c != c.Primary__c && c.Primary__c == true)
           {
              AccID.add(c.Accountid);
              conId.add(c.id);
            }
        }
      
       }
       for(contact cc:[select id, AccountID,Primary__c from Contact where AccountId IN : AccID AND Primary__c=true])
       {
          if(cc != null && !(ConId.contains(cc.Id)))
          {
                 contact co = new contact(id=cc.Id);
                 co.Primary__c = false;
                 con.add(co);
          }
       }
        if(!Con.isEmpty())
        {
        update con;
      }
}

But ,I didn't get any update in field. Can anyone help me?

Kindly support and suggest.

Thanks.
Hi All,

Create a custom field on case named "Old status" and If Status field(picklist) value is changed then the old value of Status is evaluated into "old Status" Field? How can do this without using Triggers?

Using Workflow, I wrote this

In Rule criteria: ispickval(Status,"ischanged(status)").

and in workflow action: update field--Oldstatus ,and value=Proirvalue(status).

But, I didn't get previous value of status in oldstatus field.

Kindly support and suggest.

Thank you
Hi All,

I want to access campaign field from lead object  to visualforce using custom controller. For this,is the right way to write trigger? Suppose If I write trigger then how to call trigger from visualforce?

Kindly support and suggest.

Thank You.
Hi All,

    I want to insert date from backend.For this,I want to know date format.

I tried this YYYY-MM-DD.But I am getting error..

Can anyone help me??

Kindly support and suggest.

Thanks.
I am running Eclipse Kepler with the Force.com IDE installed.  When I try and create a new SF project for a sandbox, it bypasses the "Choose Initial Project Components" screen, and all I can do is hit "Finish".  When this is done, it shows me *some* things, but not all of the classes and objects I need.  We are running Enterprise version 31.

I have done this before, but I think it was an older version of Eclipse. 

Can anyone explain why I am not getting to choose to load all components in my sandbox project?

Thanks,

Mitch
Hi All,

    I want to write a testcode  for trigger to 75 or 100%  code coverage for uploading a package as follows:
 

  trigger BorrowIncrement on Borrow_Books__c (after insert) {
     set<id> mem =new set<id>();
for(Borrow_Books__c b:trigger.new){
    if(b.Member__c!=NULL)
        mem.add(b.Member__c);
}

List<Members__c> memlist=[Select id,name,Borrowed_Books__c,(select id,name from Borrow_Books__r) from Members__c where ID in :mem];
for(Members__c m:memlist){
    m.Borrowed_Books__c=m.Borrow_Books__r.size();
}
update memlist;

}

Can anyone help me.

Kindly support and suggest.
Hi guys,


I have a doubt
In which environments app package is possible to post the app in app exchange ?

Thanks,
Hi All,

      I want to migrate sandbox changes to production.For this, I tried to use Setup-->Deploy--->Deployment connections.

But,I didn't  find deployment connections in Developer Edition.I think, it is not Possible with developer edition.

In which edition it is possible.How?

Can anyone help me.

Kindly support and suggest.
I followed the simple code from the tech docs (https://developer.salesforce.com/page/Wrapper_Class) to create a page with editable pageblocktable that allows inline editing and the ability for used to select multiple records and perform specific actions on the selected.  Works great unitl I have a very large list and i was getting an error on the VF page that I've exceeded the max viewstate size.  In the linked tech doc there is a public property that is a list of the wrapper object:

03   //Our collection of the class/wrapper objects cContact
04   public List<cContact> contactList {get; set;}

The contactList which is what the pageblocktable is bound to is what was blowing up my viewstate but I am only getting the needed values in the SOQL to populate.  I did not think this would work but I changed it from public to transient which made it dissappear from viewstate as expected AND the form contiunes to work as designed.  I guess I was not expecting this to work due to the fact that that data is not stored in viewstate but it does appear ot be working.  I can still edit all the inputfield values line by line and call my save method which envokes the standard SF validation and everything still functions as before.  Can anyone shine some light on this for me?

Thanks,
Jsutin

Hi,

Below is a piece of trigger to prevent the creation of Duplicate on whole org basis,

trigger ContactDuplicatePreventer on Contact(before insert, before update){
   Map<String, Contact> contactMap =new Map<String, Contact>();
    for (Contact contact : System.Trigger.new){
if ((contact.Email !=null) && (System.Trigger.isInsert ||(contact.Email != System.Trigger.oldMap.get(contact.Id).Email))){
  if (contactMap.containsKey(contact.Email)){
contact.Email.addError('Another new contact has the '+'same email address.');
            }else{
                contactMap.put(contact.Email, contact);
     }
       }
    }
    for (Contact contact : [SELECT Email FROM Contact WHERE Email IN :contactMap.KeySet()]){
        Contact newContact = contactMap.get(contact.Email);
        newContact.Email.addError('A Contact with this email '+'address already exists.');
   }
}

But i am looking to restrict duplicates only on Account records i.e. it should prevent duplicate contacts in case the the duplicate is on the same Account, if Account is not the same then it should allow duplicates.

Thank You

  • August 26, 2014
  • Like
  • 0
Hi All,

  I have created custom application like Education.In  this app contains 3 objects i.e Students(fields like Name,Age,Class),Teachers(fields like Name,Age,Subject,Experience),Classrooms(Room no).

I want to deploy objects ,fields and Whatever Classes,Visualforce pages,Validations,Triggers related to app only but not all are present in instance of developer edition.

Can anyone help me.

Kindly support and suggest.

Hi All,

      I want to create a custom app( project) in Eclipse.Using this https://developer.salesforce.com/page/Force.com_IDE_Installation ,I have installed Eclipse and ready to use.

After this,I tried to create a new project  in Eclipse by clicking new Force.com project and then entered my credentials(username,password(password+security token) of developer edition.

I am getting error as


 User-added image


Can anyone help me?

Kindly support and suggest.
Hi All,

I have an  custom object called Teacher.It contains field called Teacher name.

If once the record is saved then I want to display the name of the teacher on saved screen? How?

Can anyone help me.

Kindly support and suggest.

Thanks
Hello,

I am working ont he Force.com Workbook. I am learning the application building. I am now building a Workflow. So according to the workbook steps, I am trying to locate the Workflow & Approvals in Setup ->Create | Workflow & Approvals | Workflow Rules. But i dont find it. Can anybody please help me in resolving this issue?

I have created a user just a couple of days back and learning salesforce.

N
Hello Dears,

I wrote a trigger on the EmailMessage to create a task with the due date value woulde be Date.today()+2. But, the activity date is not getting updated with the given value as Date.today()+2. 
Below is the my assignment for activitydate in the trigger:
ActivityDate = Date.today()+2


But, it is not updating with the given value. By default, it stores today's date.

Please suggest me how to update this field while creating a task.

Thanks, 
Rohitsharma

how to hide standard tabs using vf pages ....?
Hi All,

I want to write articles related to triggers,visualforce pages etc.

I have no idea of writing articles in salesforce.I am new for articles.

Can any one help me.

Kindly support and suggest.