• bkradmin
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies

Hi, we need to get campaigns to work with Accounts instead of contacts or leads. We need to be able to directly add accounts, and we need accounts to be able to be "campaign members" directly - not through contacts or leads. I realize this will likely involve some customization, but I have no idea what level of customization we are looking at. Can anyone suggest a way forward? The less customization the better. Thanks!

I am a beginner admin, so this question may be way above my pay grade, but here goes: Is there any way, using a custom formula or button or some other non-code based tool, for me to get a field populated with a specific piece of data from a specific URL? For example, let's say I want to populate a "Billing City" field with the information I get from a URL. So I went to the URL, looked at the page source, and got this line of data which displays the city I want: "</span><br /><span itemprop="addressLocality">Toronto</span>". How do I instruct Salesforce to take that name; i.e. "Toronto", and put it in my field?

Normally, after an Opportunity is created, a Payment is automatically created with it. We rely heavily on this function. For some reason, this stopped working spontaneously. No settings were changed to my knowledge. Can anyone suggest where we can look? 

I am getting an error on a test class that I am not understanding: "First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [Hospital__c]" 

 

Can anyone help?

 

Here is the test class:

 

@isTest
private class TestHospitalization {
static testMethod void myUnitTest() {
     //make Contact
     Date sdate1=date.today();
     sdate1=sdate1-1;
     Date sdate2=sdate1.addMonths(3);
        Contact NewCont = new Contact (FirstName='Test', LastName='Name');
       insert NewCont;
       Account NewAcct = new Account (Name='Test');
       insert NewAcct;
       Hospitalization__c NewHosp = new Hospitalization__c (Client__c=NewCont.Id, Hospital__c=NewAcct.Id,Date_of_admission__c=sdate1);
       insert NewHosp;
       Hospitalization__c NewHosp2 = new Hospitalization__c (Client__c=NewCont.Id, Hospital__c=NewAcct.Id,Date_of_admission__c=sdate2);
       insert NewHosp2;
       NewHosp.Bed__c='1';
       update NewHosp;
       NewHosp.Date_of_admission__c=sdate2;
       update NewHosp;
   }
}

 And here is the trigger:

 

trigger CurrentHospital on Hospitalization__c (after update,after insert) {
List <Contact> UpCont=new List <Contact>();
//List <Contact> TestCont=new List <Contact>();
List <Id> TestCont=new List <Id>();
List <Contact> YesCont=new List <Contact>();

Set <Contact> MyCont=new Set <Contact>();
Map <Id, Hospitalization__c> ContHosp=new Map<Id,Hospitalization__c>();
Contact thisCont=new Contact();
//Id thisCont=new Id();
for (Hospitalization__c l : Trigger.new) {
  //thisCont=l.Client__c;
  TestCont.add(l.Client__c);
}
if(TestCont.size()>0){
    List <Hospitalization__c> HasHosp=[SELECT Client__r.Name,Client__r.Hospitalization__c,Id,Currently_in_Hospital__c FROM Hospitalization__c WHERE Client__c IN :TestCont ORDER BY Currently_in_Hospital__c ASC];
        for (Hospitalization__c b: HasHosp){
          thisCont=b.Client__r;
          if(MyCont.contains(thisCont)){
             MyCont.remove(thisCont);
      }
        if(b.Currently_in_Hospital__c==0&&thisCont.Hospitalization__c!=null){
          thisCont.Hospitalization__c=null;
          MyCont.add(thisCont);
        } else if(b.Currently_in_Hospital__c==1) {
          thisCont.Hospitalization__c=b.Id;
          MyCont.add(thisCont);
        }
        
      }
      if(MyCont.size()>0){
      UpCont.addAll(MyCont);
      }
    /*for (Integer i=0; i < TestCont.size(); i++){
        if(TestCont[i].Hospitalization__c==null){
            UpCont.add(TestCont[i]);
        }
    }*/
}

  
if(UpCont.size()>0){
update UpCont;//all contacts should be updated one way or the other
}
}

 

I am a programming-illiterate admin who recently hired a free-lance programmer to write a simple trigger for our org and provide directions for deployment. He finished the job, and now directed me to write the test class prior to deployment. I had a look at the instructions and its Greek to me. He now offered to do it for me, at an extra cost. Does it make sense that this would not be considered a natural part of the trigger development and would require an extra cost?

I'll try to keep this as brief as possible:

 

We are a Canadian non-profit which needs to send tax-deductible receipts to our donors once a year. Each receipt has a unique receipt number, but can have multiple donations listed on each. 

 

We have all the data set up from the Salesforce side (donation objects, automatic assignment of receipt numbers, etc.). Now we are thinking about output. The quickest way we have now to get the data on actual paper is to run a report with our donation information, receipt numbers, and donor information, export it to excel, and then set up a complicated mail merge document we created that understands how to group donations by receipt number to create pages. 

 

This is obviously not ideal. We would like to do all the document creation within Salesforce. I think this is too customized for the doc creation apps, and anyways we don't like monthly subscriptions. 

 

We are wiling to invest in creating something to ease this process, but we don't have an idea about wha tthat would look like. Does anyone have any idea what would be involved in doing this all in Salesforce? Are we talking about VF pages? If so, what would the procedure be?

 

 

I am very new to Apex. I am looking to write a trigger that will dynamically update a field on an Account page with the value of a field on a Contact page (where the contact belongs to that account). So, for example, the Accound field would be called "Vice President's Personal Number" and it would pull its value from the mobile number of the contact whose role matches "Vice President". I imagine this is a pretty simple trigger to write, but I can't find any examples of this to get me started. 

Hi, I am very new to formulas and SF and can't seem to get SF syntac right. I keep getting errors on this formula. I would really appreciate some help! 

 

If ((RecordType.Id), ("012E0000000MoYF") || ( RecordType.Id), ("012E0000000Mu8O") || ( RecordType.Id), ("012E0000000MoYN") || ( RecordType.Id), ("012E0000000MoYQ")),
( IF(ISPICKVAL(npe01__PreferredPhone__c, "Home"), HomePhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Other"), OtherPhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Work"), npe01__WorkPhone__c,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Mobile"), MobilePhone, Account.Phone
),
( IF(ISPICKVAL(npe01__PreferredPhone__c, "Home"), HomePhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Other"), OtherPhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Work"), npe01__WorkPhone__c,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Mobile"), MobilePhone, Employer_Number__c
)

I am trying to write a formual for a field on an account that would display data from a contact. For example, say I have an account that has multiple contacts, each with a distinct identifier; (there is one "President", one "Vice President", and one "COO"). I want a field on the account page to display, for example, the Last Name of whichever contact is identified as "President". How would I go about this?

 

I have seen this question discussed in reverse, but never this way. 

I am a beginner admin, so this question may be way above my pay grade, but here goes: Is there any way, using a custom formula or button or some other non-code based tool, for me to get a field populated with a specific piece of data from a specific URL? For example, let's say I want to populate a "Billing City" field with the information I get from a URL. So I went to the URL, looked at the page source, and got this line of data which displays the city I want: "</span><br /><span itemprop="addressLocality">Toronto</span>". How do I instruct Salesforce to take that name; i.e. "Toronto", and put it in my field?

Normally, after an Opportunity is created, a Payment is automatically created with it. We rely heavily on this function. For some reason, this stopped working spontaneously. No settings were changed to my knowledge. Can anyone suggest where we can look? 

I am getting an error on a test class that I am not understanding: "First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [Hospital__c]" 

 

Can anyone help?

 

Here is the test class:

 

@isTest
private class TestHospitalization {
static testMethod void myUnitTest() {
     //make Contact
     Date sdate1=date.today();
     sdate1=sdate1-1;
     Date sdate2=sdate1.addMonths(3);
        Contact NewCont = new Contact (FirstName='Test', LastName='Name');
       insert NewCont;
       Account NewAcct = new Account (Name='Test');
       insert NewAcct;
       Hospitalization__c NewHosp = new Hospitalization__c (Client__c=NewCont.Id, Hospital__c=NewAcct.Id,Date_of_admission__c=sdate1);
       insert NewHosp;
       Hospitalization__c NewHosp2 = new Hospitalization__c (Client__c=NewCont.Id, Hospital__c=NewAcct.Id,Date_of_admission__c=sdate2);
       insert NewHosp2;
       NewHosp.Bed__c='1';
       update NewHosp;
       NewHosp.Date_of_admission__c=sdate2;
       update NewHosp;
   }
}

 And here is the trigger:

 

trigger CurrentHospital on Hospitalization__c (after update,after insert) {
List <Contact> UpCont=new List <Contact>();
//List <Contact> TestCont=new List <Contact>();
List <Id> TestCont=new List <Id>();
List <Contact> YesCont=new List <Contact>();

Set <Contact> MyCont=new Set <Contact>();
Map <Id, Hospitalization__c> ContHosp=new Map<Id,Hospitalization__c>();
Contact thisCont=new Contact();
//Id thisCont=new Id();
for (Hospitalization__c l : Trigger.new) {
  //thisCont=l.Client__c;
  TestCont.add(l.Client__c);
}
if(TestCont.size()>0){
    List <Hospitalization__c> HasHosp=[SELECT Client__r.Name,Client__r.Hospitalization__c,Id,Currently_in_Hospital__c FROM Hospitalization__c WHERE Client__c IN :TestCont ORDER BY Currently_in_Hospital__c ASC];
        for (Hospitalization__c b: HasHosp){
          thisCont=b.Client__r;
          if(MyCont.contains(thisCont)){
             MyCont.remove(thisCont);
      }
        if(b.Currently_in_Hospital__c==0&&thisCont.Hospitalization__c!=null){
          thisCont.Hospitalization__c=null;
          MyCont.add(thisCont);
        } else if(b.Currently_in_Hospital__c==1) {
          thisCont.Hospitalization__c=b.Id;
          MyCont.add(thisCont);
        }
        
      }
      if(MyCont.size()>0){
      UpCont.addAll(MyCont);
      }
    /*for (Integer i=0; i < TestCont.size(); i++){
        if(TestCont[i].Hospitalization__c==null){
            UpCont.add(TestCont[i]);
        }
    }*/
}

  
if(UpCont.size()>0){
update UpCont;//all contacts should be updated one way or the other
}
}

 

I'll try to keep this as brief as possible:

 

We are a Canadian non-profit which needs to send tax-deductible receipts to our donors once a year. Each receipt has a unique receipt number, but can have multiple donations listed on each. 

 

We have all the data set up from the Salesforce side (donation objects, automatic assignment of receipt numbers, etc.). Now we are thinking about output. The quickest way we have now to get the data on actual paper is to run a report with our donation information, receipt numbers, and donor information, export it to excel, and then set up a complicated mail merge document we created that understands how to group donations by receipt number to create pages. 

 

This is obviously not ideal. We would like to do all the document creation within Salesforce. I think this is too customized for the doc creation apps, and anyways we don't like monthly subscriptions. 

 

We are wiling to invest in creating something to ease this process, but we don't have an idea about wha tthat would look like. Does anyone have any idea what would be involved in doing this all in Salesforce? Are we talking about VF pages? If so, what would the procedure be?

 

 

Hi, I am very new to formulas and SF and can't seem to get SF syntac right. I keep getting errors on this formula. I would really appreciate some help! 

 

If ((RecordType.Id), ("012E0000000MoYF") || ( RecordType.Id), ("012E0000000Mu8O") || ( RecordType.Id), ("012E0000000MoYN") || ( RecordType.Id), ("012E0000000MoYQ")),
( IF(ISPICKVAL(npe01__PreferredPhone__c, "Home"), HomePhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Other"), OtherPhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Work"), npe01__WorkPhone__c,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Mobile"), MobilePhone, Account.Phone
),
( IF(ISPICKVAL(npe01__PreferredPhone__c, "Home"), HomePhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Other"), OtherPhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Work"), npe01__WorkPhone__c,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Mobile"), MobilePhone, Employer_Number__c
)