• Chien
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi there,

Is it possible to create a form or page in SalesForce and make it open to the public, so that people can fill out the form or view the page without logging into the SalesForce?

Thanks a lot,
Sam
  • October 21, 2008
  • Like
  • 0
Hi there,

I am trying to make the account name unique for all the contacts that are imported. So, all the contacts go under one account. Here is my code:

trigger addGroup_tgr on Contact bulk (before insert, before update) {
      Map<String, Contact> contactMap = new Map<String, Contact>();
      for (Contact contact : System.Trigger.new) {
          if (contact.E_Mail__c != NULL){
              //string email = contact.E_Mail__c.trim();
              //if (contact.Email != email){
              //      contact.Email = email;
              //}
              contact.Email = contact.E_Mail__c.trim();
          }

          if (contact.Group__c != NULL){
              String newGroup = contact.Group__c.trim();
              if (Trigger.isupdate) {
                  String oldGroup = System.Trigger.oldMap.get(contact.Id).Group__c;
             
                  if (oldGroup != NULL){
                      String[] result = oldGroup.split('/');
                      Boolean isDuplicate = false;
                 
                      for (String t : result){
                          if (t == newGroup){
                              isDuplicate = true;
                          }
                      }
                 
                      if (isDuplicate != true && oldGroup != newGroup){
                          contact.Group__c = oldGroup + '/' + newGroup;
                      }else if (isDuplicate = true){
                          contact.Group__c = oldGroup;
                      }
                  }else{
                      contact.Group__c = newGroup;
                  }
             
              }else if (Trigger.isinsert){
                  contact.Group__c = newGroup;
              }
         
              if (newGroup == 'delete all'){
                  contact.Group__c = '';
              }
          }else{
              if (Trigger.isupdate){
                  contact.Group__c = System.Trigger.oldMap.get(contact.Id).Group__c;
              }
          }

          contact.Account.Name = 'CEOI Contacts';
          //contact.firstname = 'meow';
      }
}

However, I got the following error message:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger addGroup_tgr caused an unexpected exception, contact your administrator: addGroup_tgr: execution of BeforeUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.addGroup_tgr: line 49, column 11

Anybody can help?
Thanks a lot


Message Edited by Chien on 08-22-2008 07:50 AM

Message Edited by Chien on 08-22-2008 07:51 AM

Message Edited by Chien on 08-22-2008 08:14 AM
  • August 22, 2008
  • Like
  • 0
I am trying to build a many-to-many relastionship between Contacts and a custom object Classes. I also had a join object to make that many-to-many relationship works. The problem is I cannot create a mass email list according to a class name. Is there a way to add the information of Class into Contact's search field list?

I also created a new field "Class Code" under Contacts. I like to add a new class code after the current class code everytime I update it. And, the class code will be like "MSTU 4000/INDT 3000/MATH 5000". So, I have a history of what that student has taken. To do that, I guess I have to retrieve the current class codes, compare them with the new class code, and insert or update it.

I am new to this SalesForce system. Is there a good tutorial that I can take a look?

Thanks a lot,
  • July 31, 2008
  • Like
  • 0
Any body knows how to add a text to the current record of a field before insert or update trigger?

  • July 29, 2008
  • Like
  • 0
Hoping to get some help on installing a fairly new Salesforce labs app from the AppExchange, the "Marketing Request App".

Install is failing on both an Enterprise Edition Sandbox Org and my Developer Org with the following message:

Problem:

marketingrequest.testMarketingRequest()
Component:
Apex Classes(01p30000000D9HU)
Detail:
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id Class.MarketingRequest.testMarketingRequest: line 106, column 9

Anyone have any luck installing this app??

Thanks,
Mark
Hi there,

I am trying to make the account name unique for all the contacts that are imported. So, all the contacts go under one account. Here is my code:

trigger addGroup_tgr on Contact bulk (before insert, before update) {
      Map<String, Contact> contactMap = new Map<String, Contact>();
      for (Contact contact : System.Trigger.new) {
          if (contact.E_Mail__c != NULL){
              //string email = contact.E_Mail__c.trim();
              //if (contact.Email != email){
              //      contact.Email = email;
              //}
              contact.Email = contact.E_Mail__c.trim();
          }

          if (contact.Group__c != NULL){
              String newGroup = contact.Group__c.trim();
              if (Trigger.isupdate) {
                  String oldGroup = System.Trigger.oldMap.get(contact.Id).Group__c;
             
                  if (oldGroup != NULL){
                      String[] result = oldGroup.split('/');
                      Boolean isDuplicate = false;
                 
                      for (String t : result){
                          if (t == newGroup){
                              isDuplicate = true;
                          }
                      }
                 
                      if (isDuplicate != true && oldGroup != newGroup){
                          contact.Group__c = oldGroup + '/' + newGroup;
                      }else if (isDuplicate = true){
                          contact.Group__c = oldGroup;
                      }
                  }else{
                      contact.Group__c = newGroup;
                  }
             
              }else if (Trigger.isinsert){
                  contact.Group__c = newGroup;
              }
         
              if (newGroup == 'delete all'){
                  contact.Group__c = '';
              }
          }else{
              if (Trigger.isupdate){
                  contact.Group__c = System.Trigger.oldMap.get(contact.Id).Group__c;
              }
          }

          contact.Account.Name = 'CEOI Contacts';
          //contact.firstname = 'meow';
      }
}

However, I got the following error message:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger addGroup_tgr caused an unexpected exception, contact your administrator: addGroup_tgr: execution of BeforeUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.addGroup_tgr: line 49, column 11

Anybody can help?
Thanks a lot


Message Edited by Chien on 08-22-2008 07:50 AM

Message Edited by Chien on 08-22-2008 07:51 AM

Message Edited by Chien on 08-22-2008 08:14 AM
  • August 22, 2008
  • Like
  • 0
Any body knows how to add a text to the current record of a field before insert or update trigger?

  • July 29, 2008
  • Like
  • 0