• dkn
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 24
    Replies

Hi

 

I have a contact record and a related list as application.There is an look up relationship between application and contact record. I have written  a trigger to change the record type of the application based on  a particular value entered on the contact record. This trigger works fine , but the issue i am facing is , what if I have mutliple application records . I want to make the record type change only the most recent application rather than all the application records....I would really appreciate any help on this.....thank you ....below is the main part of the code, working on...

 

trigger rcdtypechg on Contact (before update) {


set<Id> chngRcdtype=new set<Id>();
    
    for(Contact co : Trigger.New)
    {
        if(co.What_are_you_applying_to__c=='Interlochen Summer Arts Camp')
            chngRcdtype.add(co.Id);
            
    }
    
    List<Enrollment_Opportunity__c> app=[Select Id,RecordTypeId from Enrollment_Opportunity__c where Enrollment_Opportunity__c.Applicant__c IN:chngRcdtype];
    for(Enrollment_Opportunity__c ap:app)
    {
        ap.RecordTypeId='012T00000004cfd';
    }
    
    update app;
    
}

 

 

  • September 21, 2010
  • Like
  • 0

Hi

 

I have written a simple visual force page for mass updating a field value, but when I try to update more than 10 records I face this error Too many fields describes: 11 .... I have not used any custom controller or extensions...There might be a work around to  over come this limitation...Please I would really appreciate any help ...thank you 

  • September 17, 2010
  • Like
  • 0

Hi..

 

I am trying to write an test method for the below controller extension (contact controller extension).

I am finding difficult to start writing this test method....Please help me....i would really appreciate any help..

I have written this to create a mass update , i can select a number of contacts from the view and update the status....

 

This controller returns the number of selected records...

 

 

public class massupdate {

    ApexPages.StandardSetController setApp;

    public massupdate(ApexPages.StandardSetController controller) {
        setApp = controller;
    }
    
   
    public integer getMySelectedSize() {
        return setApp.getSelected().size();
    }
   
}

 

thank you

  • September 14, 2010
  • Like
  • 0

Hi

 

I have an standard contact object and related custom object application.When the admission status in the application changes to accepted , status on the contact object also changes to accepted.When this change takes place, I need the record type of the contact record to change as well....How can i do this using trigger....Any suggestions to kick start this would be really appreciated....

thank you

 

 

  • August 26, 2010
  • Like
  • 0

Hi

 

I have written an email to apex code , where a contact is created  as soon as an email is recieved to the email service depending on the email content.

 

Everything works fine , since all the value are string ...so it creates a contact.

 

The issue I am having is there a Birthdate field which is a date field, how can i pass this date field as a string to the system.

 

I would appreciate your help.

 

thank you

 

  • July 12, 2010
  • Like
  • 0

Hi 

 

I am trying to install a CTI adapter for my organization and integrate the telephony system ...I am having an huge problem in solving this...Does anyone has an idea on this.....Any help would be really appreciated...thank you

 

 

thank you 

 

  • June 17, 2010
  • Like
  • 0

have an contact object and an academic schedules object.
Contact object and academic schedules object are in a master-detail relationship, where master is contact and detail is academic schedules.So, One contact can have more than one detail record(Academic schedules) associated with it.I need to generate a pdf document , so that it captures the values from the contact record and as well as the individual field values from each detail record. Say , supposes, I have A, B, C, D as detail records. Then I might have 1, 2 ,3 ,4 , 5 as field names and these are the fields available on Record A, Record B etc,.
I want to capture Record A with 1 and 4 field value apart from capturing the contact record field values(which is very easy.).

Now at the same time there is a master detail relationship beteween academic schedules and registrations, where academic schedules is the master and registrations is the child.

Can I pull the data from academic schedules and registrations object on the contact record.

 

How can I do this , Is there way to pull invididual field values when in an master detail relationship.I would really appreciate any reply

  • June 15, 2010
  • Like
  • 0

Hi I have an contact object and application object. As soon as an contact oject is created , then related application is created.

I hae two fields as math score and english score and field as admission status on application object .

Now, i have written a trigger such that whenever an math and english test scores are updated then automatically the admission status field on application object is updated to placement exam.IT works fine now, but if i change the admission status and then try to update the two field values on contact record it gives me an error. Please find below the code and error.i would appreciate any kind of help.thank you

 

trigger AdmissionStatus on Contact (after insert,after update) {

List<EnrollmentrxRx__Enrollment_Opportunity__c> application=[Select Id from EnrollmentrxRx__Enrollment_Opportunity__c where EnrollmentrxRx__Applicant__c in: Trigger.New Limit 1];
List<EnrollmentrxRx__Enrollment_Opportunity__c> application2 = new List<EnrollmentrxRx__Enrollment_Opportunity__c>();
for(Contact con : Trigger.New)
{
if(con.Math_Placement_Exam_Score__c!=null && con.English_Placement_Exam_Score__c!=null)
{
if(application.size()>0)
{
for(EnrollmentrxRx__Enrollment_Opportunity__c application1 : application )
{
application1.EnrollmentrxRx__Admissions_Status__c = 'Placement Exam';
application2.add(application1);
}
}
}

}
update application2;
}

 

Error:

 

Error:Apex trigger AdmissionStatus caused an unexpected exception, contact your administrator: AdmissionStatus: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0BS0000002zp9SMAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, EnrollmentrxRx.EOBeforeUpdate: execution of BeforeUpdate caused by: System.Exception: EnrollmentrxRx:Too many SOQL queries: 21 (EnrollmentrxRx): []: Trigger.AdmissionStatus: line 20, column 1

  • June 14, 2010
  • Like
  • 0

have an contact object and an academic schedules object.
Contact object and academic schedules object are in a master-detail relationship, where master is contact and detail is academic schedules.So, One contact can have more than one detail record(Academic schedules) associated with it.I need to generate a pdf document , so that it captures the values from the contact record and as well as the individual field values from each detail record. Say , supposes, I have A, B, C, D as detail records. Then I might have 1, 2 ,3 ,4 , 5 as field names and these are the fields available on Record A, Record B etc,.
I want to capture Record A with 1 and 4 field value apart from capturing the contact record field values(which is very easy.).How can I do this , Is there way to pull invididual field values when in an master detail relationship.I would really appreciate any reply

 

thank you

  • June 10, 2010
  • Like
  • 0

I have written a trigger which works fine if , i have task created after an contact is created . But I have a situation where a task is created at the same time when an contact record is created .So, it doesn't allow me to update the contact record.

I have created a custom field in contact for counting the total open activities.

i would really appreciate any help in solving this...thank you

 

trigger CountContact on Task (after insert,after update  )
{
        if(Trigger.IsUpdate || Trigger.IsInsert)
        {
       String ContactId = Trigger.New[0].whoId;  
       if(ContactId.substring(0,3) =='003')
       {
            List<Task> Tasks = [Select Id from Task where Status =: 'Not Started' and whoId =: ContactId ];
            Contact C = [Select id,Total_open_Activity__c from Contact where Id =:Trigger.New[0].WhoId]  ;
           
            C.Total_open_Activity__c = Tasks.size();
            //Trigger.New[0].addError('>>'+Tasks.size());
         //   update C;     
           
       }
       }

  • June 07, 2010
  • Like
  • 0

Hi

 

I want to display a field in the contact with an option yes or no ,  so if there is any open activity assosciated with that contact it shows yes else no....

 

any ideas, solutions , approach will be really appreciated

 

thank you

 

 

  • May 27, 2010
  • Like
  • 0

Hi i am developing a visual force pages in the portal , I have an application which has two related document records.Application and document are two related custom object.I have an admission status field in the application object. Once the application field status changes to interview complete , then two documents are generated . I have created a link in the portal , where when a user clicks on it , takes him to application page , then if he clicks on other link it takes him to the documents page.now, i need to show the generated documents in the page. how can do this ??/ any ideas ???

  • May 24, 2010
  • Like
  • 0

Hi

 

I have student enrollment application ,  I want to create a user interface such that.

 

There are three links.

 

1) enter student info

 

2)your application

 

3) documents.

 

The 1) is related to the contact standard object,  2) is related to the applications custom object 3) is related to the admissions custom object.

 

Now, the student click on the 1st link , he enters the contact info, clicks 2nd link enters application details. and when he requires the document to submitted he clicks on the 3rd link and submits the documents.

 

Now, once a contact is created a related application is generated ( a trigger is written for this.

 

I am really confused in starting this..I would really appreciate any ideas , solutions , approach to the solutions...anything is appreciated.

 

thank you

  • May 04, 2010
  • Like
  • 0

Hi

 

I have student enrollment application ,  I want to create a user interface such that.

 

There are three links.

 

1) enter student info

 

2)your application

 

3) documents.

 

The 1) is related to the contact standard object,  2) is related to the applications custom object 3) is related to the admissions custom object.

 

Now, the student click on the 1st link , he enters the contact info, clicks 2nd link enters application details. and when he requires the document to submitted he clicks on the 3rd link and submits the documents.

 

Now, once a contact is created a related application is generated ( a trigger is written for this.

 

I am really confused in starting this..I would really appreciate any ideas , solutions , approach to the solutions...anything is appreciated.

 

thank you

 

  • May 04, 2010
  • Like
  • 0

Hi

 

I want to create a field in contact object and check through that field if there is a task or not.

Ex.: if there is not task the field show some value that there is no task  and vice -versa...

 

I need help on this....appreciated , any idea, solution, approach...

 

thank you

 

 

  • April 30, 2010
  • Like
  • 0

Hi I have an issue with the after update , I have an application object and recommender object.I have an custom field as recommenders email address in application, once a student enters the email address and trigger should fire and create a corresponding recommender object record , it works fine for the first time.But if I make any changes in the recommender's email address it doesn't change that in the corresponding recommender object record.

 

Only after insert will not work in my scenario, because an application record it created once an contact record is created .So, i need to update the application record.

 

The problem is I am checking for if the recommender record is empty or not with recs.size==0, if it is not empty it recognizing it , but not updating....Please...help....me...

 

 

Trigger Rectrigger on EnrollmentrxRx__Enrollment_Opportunity__c (after insert,after update)
{
  Set<Id> appids= New Set<Id>();
  for(EnrollmentrxRx__Enrollment_Opportunity__c appli : Trigger.New)
  {
      appids.add(appli.Id);
  }
 
  List<TestErx__Recommender__c> recs=[select TestErx__Application_ID__c from TestErx__Recommender__c where TestErx__Application_ID__c in : appids];
  System.Debug('Size=='+recs.size());
  if(recs.size()==0)
  {
      for (EnrollmentrxRx__Enrollment_Opportunity__c newApplication: Trigger.New)
      {
          if (newApplication.TestErx__Recommender_s_email_address__c != null)
          {
              recs.add(new TestErx__Recommender__c(
              
              TestErx__Application_ID__c = newApplication.Id,
              
              TestErx__Recommender_E_mail_Address__c=newApplication.TestErx__Recommender_s_email_address__c,
              
              TestErx__First_name__c=newApplication.TestErx__Recommender_s_first_name__c,
              
              TestErx__Surname__c=newApplication.TestErx__Recommender_s_last_name__c));
          }
      }
  }
  upsert recs;
 

  • April 27, 2010
  • Like
  • 0

Hi

 

I have an application custom object, I need the 15 digit or 18 digit record id  of the application object to be populated in the field created in this object.

 

Help me !!!

 

thank you

 

  • April 26, 2010
  • Like
  • 0

Hi

 

I have an application custom object and recommender custom object, I have an look up relationship from the application to the recommender.I have an pick list field status in both of these objects, and the values are received and not received.Once , I have the status pick list field  as received in the recommender custom object, I need even the status pick list field in the application field to automatically change to received.Can anyone give me an idea on writing a trigger to kick start with this....I would appreciate any help...

 

thank you

 

 

  • April 25, 2010
  • Like
  • 0

Hi

 

I have created a public sites page , where a person who is outside salesforce system , enters data and clicks save.So, I want to create an other visual force page with a simple thank you message .So, that when a person click this save button it takes him to the thank you page.I would really appreciate any suggestions , ideas  , solutions..help me !!!!

 

thank you

 

  • April 22, 2010
  • Like
  • 0

My org is an student enrollment application.I have an contact object, application custom object and recommender custom object and admissions custom object to name a few.When a student fills the contact details , automatically an application is generated for that particular student which has all the application details.And the application object has an related list admission document which has an document name and document status like statement of intent , letter of documentation etc...which is a pick list.And the document status has a pick list of required, read for approval etc...

I need to create an recommender email address in the application object such that as soon as the student fills his application with the recommender's email address ,an email shoots to the recommender saying that that particular student is requesting an letter of recomendation.Over here the recommender is the professor who will be recommending the student.And in the email the professor should click an link , which takes him to the visual force page with all the details.( all the fields related to the recommender and applicant name) , So, I have created an recommender object which is a related list of application.So, that when a professor enters a data, it creates a record.Now, the issue is I need to get the student name automatically populated in the visual force page such that he knows to which student he is recommending.And second issue is I need to get the recommender object record to be created/inserted to that particular students application.And the third issue is I need to get the document name changed to letter of recommendation as soon as the recommender object record is created in the student's application object. Over her, recommender object and admission document object are not related to each other , Although they are related to applications object. These are my issues .I would really appreciate any help in solving me this problem.
Now, i have done is created a trigger , such that when an recommender's email address is entered in the field of application an related recommender object is created with application ID and applicant name populating automatically...
Now,
to populate the applicant name in your VF page first I need  to insert the applicantId into the Recommender object Lookup filed. This will be done into the same trigger which I  created for the  Recommender record.

 

Now I have to  pass the Recommender Id into your Site VF page URL. This link will be into the Emial.

 

https://<your company doman> /<yourVF Page Name>?Id=< Recommender Id >

 

Now i need to write a  class controller to get this Id

 

My classConstructor()

{

String Id= Pagereferce.get(“Id”)

 

//Then select the Recommender record

Recommender rd=[Select id, name,xyz… from  Recommender__c ]

}

I am not able to get hold of the exact logic and syntax....please..please guide me...
I am lost after this ...I need to pass the ID onto the URL ..So, that I can put a link in the email template....but how ???I am totally lost here...need help ...
thank you

 

  • April 21, 2010
  • Like
  • 0

Hi

 

I have written a simple visual force page for mass updating a field value, but when I try to update more than 10 records I face this error Too many fields describes: 11 .... I have not used any custom controller or extensions...There might be a work around to  over come this limitation...Please I would really appreciate any help ...thank you 

  • September 17, 2010
  • Like
  • 0

Hi 

 

I am trying to install a CTI adapter for my organization and integrate the telephony system ...I am having an huge problem in solving this...Does anyone has an idea on this.....Any help would be really appreciated...thank you

 

 

thank you 

 

  • June 17, 2010
  • Like
  • 0

Hi I have an contact object and application object. As soon as an contact oject is created , then related application is created.

I hae two fields as math score and english score and field as admission status on application object .

Now, i have written a trigger such that whenever an math and english test scores are updated then automatically the admission status field on application object is updated to placement exam.IT works fine now, but if i change the admission status and then try to update the two field values on contact record it gives me an error. Please find below the code and error.i would appreciate any kind of help.thank you

 

trigger AdmissionStatus on Contact (after insert,after update) {

List<EnrollmentrxRx__Enrollment_Opportunity__c> application=[Select Id from EnrollmentrxRx__Enrollment_Opportunity__c where EnrollmentrxRx__Applicant__c in: Trigger.New Limit 1];
List<EnrollmentrxRx__Enrollment_Opportunity__c> application2 = new List<EnrollmentrxRx__Enrollment_Opportunity__c>();
for(Contact con : Trigger.New)
{
if(con.Math_Placement_Exam_Score__c!=null && con.English_Placement_Exam_Score__c!=null)
{
if(application.size()>0)
{
for(EnrollmentrxRx__Enrollment_Opportunity__c application1 : application )
{
application1.EnrollmentrxRx__Admissions_Status__c = 'Placement Exam';
application2.add(application1);
}
}
}

}
update application2;
}

 

Error:

 

Error:Apex trigger AdmissionStatus caused an unexpected exception, contact your administrator: AdmissionStatus: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0BS0000002zp9SMAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, EnrollmentrxRx.EOBeforeUpdate: execution of BeforeUpdate caused by: System.Exception: EnrollmentrxRx:Too many SOQL queries: 21 (EnrollmentrxRx): []: Trigger.AdmissionStatus: line 20, column 1

  • June 14, 2010
  • Like
  • 0

have an contact object and an academic schedules object.
Contact object and academic schedules object are in a master-detail relationship, where master is contact and detail is academic schedules.So, One contact can have more than one detail record(Academic schedules) associated with it.I need to generate a pdf document , so that it captures the values from the contact record and as well as the individual field values from each detail record. Say , supposes, I have A, B, C, D as detail records. Then I might have 1, 2 ,3 ,4 , 5 as field names and these are the fields available on Record A, Record B etc,.
I want to capture Record A with 1 and 4 field value apart from capturing the contact record field values(which is very easy.).How can I do this , Is there way to pull invididual field values when in an master detail relationship.I would really appreciate any reply

 

thank you

  • June 10, 2010
  • Like
  • 0

Hi

 

I want to display a field in the contact with an option yes or no ,  so if there is any open activity assosciated with that contact it shows yes else no....

 

any ideas, solutions , approach will be really appreciated

 

thank you

 

 

  • May 27, 2010
  • Like
  • 0

Hi

 

I want to create a field in contact object and check through that field if there is a task or not.

Ex.: if there is not task the field show some value that there is no task  and vice -versa...

 

I need help on this....appreciated , any idea, solution, approach...

 

thank you

 

 

  • April 30, 2010
  • Like
  • 0

Hi

 

I have an application custom object, I need the 15 digit or 18 digit record id  of the application object to be populated in the field created in this object.

 

Help me !!!

 

thank you

 

  • April 26, 2010
  • Like
  • 0

Hi

 

I have created a public sites page , where a person who is outside salesforce system , enters data and clicks save.So, I want to create an other visual force page with a simple thank you message .So, that when a person click this save button it takes him to the thank you page.I would really appreciate any suggestions , ideas  , solutions..help me !!!!

 

thank you

 

  • April 22, 2010
  • Like
  • 0

Hi

 

I have 2 custom objects application and recommender , in the application I have a field name as recommender email address .So, I need to come up with an trigger such that when an recommender email address is filled , the trigger should be fired which in turn  creates a recommender object which is associated with an application and application ID should be populated.

 

I would really appreciate any help in solving this...any ideas, solutions are most welcome....

  • April 20, 2010
  • Like
  • 0

Hi

 

I have an student application, there is a college website with a page for request information.A student enters the info in the page , submits it and then the data is sent to database.I do not have to do anything here.Now, an email is sent from an email address of the database to the admission office with the student info which he entered while ago...like first name , last name email address...etc....I need to write an email to apex...such that..if the student record is present create a task , if not present create a record and task...Here , student record is the contact record....Now, can we do this using email to apex...if yes how...??/ If no, then how can I do this..?? Any ideas, suggestions are welcome....

 

 

thank you

 

 

  • April 15, 2010
  • Like
  • 0

Hi

 

I have an situation on my hand.I work on a student enrollment application.

 

1)So, the task is a college has an request information form , so, when a student enters the data in it then it should create a  contact for that student if the record is not present and create a task...

 

2) I have an junior day information form , where the student enters the data then a corresponding contact is created and then an event is generated for this contact....

 

Any solution , idea and hints are appreciated....Please ...Please....This has to be done using email to apex .....???

 

How can I do that ...Please help ....

 

 

thank you

 

 

 

 

  • April 13, 2010
  • Like
  • 0

Hi

My org is an student enrollment application.I have an contact object, application custom object and recommender custom object and admissions custom object to name a few.When a student fills the contact details , automatically an application is generated for that particular student which has all the application details.And the application object has an related list admission document which has an document name and document status like statement of intent , letter of documentation etc...which is a pick list.And the document status has a pick list of required, read for approval etc...

I need to create an recommender email address in the application object such that as soon as the student fills his application with the recommender's email address ,an email shoots to the recommender saying that that particular student is requesting an letter of recomendation.Over here the recommender is the professor who will be recommending the student.And in the email the professor should click an link , which takes him to the visual force page with all the details.( all the fields related to the recommender and applicant name) , So, I have created an recommender object which is a related list of application.So, that when a professor enters a data, it creates a record.Now, the issue is I need to get the student name automatically populated in the visual force page such that he knows to which student he is recommending.And second issue is I need to get the recommender object record to be created/inserted to that particular students application.And the third issue is I need to get the document name changed to letter of recommendation as soon as the recommender object record is created in the student's application object. Over her, recommender object and admission document object are not related to each other , Although they are related to applications object. These are my issues .I would really appreciate any help in solving me this problem.

  • April 13, 2010
  • Like
  • 0

Hello.

 

I have to know how I can upload document from visualforce page ?

Is there standart upload dialog  ?

 

Something like

<apexpage:uploaddocument name="upname">

 

 

 

Is it possible ?

Thank you.

Message Edited by Burdah-Moden on 03-14-2010 11:56 PM

Does anyone know how to write a trigger that would copy a value from a custom field to standard field?

 

I have never coded with apex before, so sorry if my question doesn't make sense.

 

We have been using a custom picklist to store certain info about our clients, but custom fields are not available for a PDF merge.

Our app exchange partner has suggested that we develop a trigger to copy the value from the custom field to the currently unused

"Industry" standard field, which is available for merge.

Does anyone out there know how to call an email template from a custom button?
 
Thanks in advance.
  • August 03, 2007
  • Like
  • 0