• thomast
  • NEWBIE
  • 295 Points
  • Member since 2011
  • Senior Support Engineer
  • roundCorner


  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 5
    Questions
  • 45
    Replies
I'm working on sandbox refresh code. For some reason, the portion of my test that makes sure I've inserted the task I want it not getting any code coverage. Here's my class:
global class SandboxRefreshScript implements SandboxPostCopy {
    global void runApexClass(SandboxContext context) {
        // Change value of Alias below to the Alias of user who should own the group
        // ensuring that it is unique among your users
        List<User> groupOwner = [SELECT Id, Username FROM User WHERE Alias = 'MKolo'];
        Id grpOwnerId = groupOwner[0].Id;
        
        // Create a Chatter Group for Payment Pipeline Changes
        List<CollaborationGroup> groups = new List<CollaborationGroup>();
        
        CollaborationGroup pipeline = new CollaborationGroup(
            CollaborationType = 'Public',
            Description = 'Group for showing changes to the cashflow pipeline. ',
            Name = 'Payment Pipeline Changes',
            OwnerId = grpOwnerId
        );
        groups.add(pipeline);
        
        //Create another Chatter Group for All Spark
        CollaborationGroup allSpark = new CollaborationGroup(
            CollaborationType = 'Public',
            Description = 'All Spark group. ',
            Name = 'All Spark',
            OwnerId = grpOwnerId
        );
        groups.add(allSpark);
        
        //Create another Chatter Group for Hiring Notifications
        CollaborationGroup hiringNotifications = new CollaborationGroup(
            CollaborationType = 'Private',
            Description = 'Hiring Notifications group. ',
            Name = 'Hiring Notifications',
            OwnerId = grpOwnerId
        );
        groups.add(hiringNotifications);
        
        insert groups;
        
        //Create a Task for yesterday (so it's immediately overdue) that
        //reminds to update Process Builders to use the new Chatter Groups.
        Task newTask = new Task(
        	Subject = 'Fix Process Builders',
            ActivityDate = Date.today()-1
        );
        insert newTask;

    }
}

And here's my test class:
@isTest
class TestSandboxRefreshScript {
    
    @isTest
    static void testMySandboxPrep() {
        
        Test.startTest();
        
        Test.testSandboxPostCopyScript(
            new SandboxRefreshScript(), UserInfo.getOrganizationId(),
            UserInfo.getOrganizationId(), UserInfo.getOrganizationName());
        
        Test.stopTest();
        
        // Test for Payment Pipeline Changes
        List<CollaborationGroup> chGroup = [SELECT Id, CollaborationType from CollaborationGroup WHERE Name = 'Payment Pipeline Changes'];
        System.assertEquals(1, chGroup.size(), 'Chatter Group List size not equal to 1');
        System.assertEquals('Public', chGroup[0].CollaborationType, 'Chatter group is not public');
        
        // Test for All Spark
        List<CollaborationGroup> chGroup2 = [SELECT Id, CollaborationType from CollaborationGroup WHERE Name = 'All Spark'];
        System.assertEquals(1, chGroup.size(), 'Chatter Group List size not equal to 1');
        System.assertEquals('Public', chGroup[0].CollaborationType, 'Chatter group is not public');
        
        // Test for Hiring Notifications
        List<CollaborationGroup> chGroup3 = [SELECT Id, CollaborationType from CollaborationGroup WHERE Name = 'Hiring Notifications'];
        System.assertEquals(1, chGroup.size(), 'Chatter Group List size not equal to 1');
        System.assertEquals('Private', chGroup[0].CollaborationType, 'Chatter group is not private');
        
        //Test for Task Insert
        List<Task> tasks = [SELECT Id from Task WHERE ActivityDate = Yesterday];
        System.assertEquals(1, tasks.size(), 'Task Group List size not equal to 1');

    }
}

When I run the test,  there is no coverage for lines 41-45 and I don't understand why?
This task, creating a Static Resource from:
Download the current version of the jQuery Mobile JavaScript library, currently jQuery Mobile 1.4.4, in the ZIP format.
The newest version, 1.4.5 is 7MB and of course does not upload.
 

Hi Everyone

 

Has anybody integrated Amazon SES web Service with Salesforce. If yes, please guide me to the right direction.

 

Thanks

Sid

We are using Professional edition and we now a widget that creates an invoice in Quickbooks once an opportunity is marked Closed/Won.  We would like to make a validation rule so that only certain roles can save the record as Closed/Won.  The role that would be able to save a record is "Admin Manager"

I'm not a programmer at all but I can copy and paste and follow directions real good.

Thanks for your help,

Jeremy

Status__c ="Active"&&Text(Service_Frequency__c)="1"&& Serv_Freq_Count__c<>0&&
Status__c ="Active"&&Text(Service_Frequency__c)="1"&& Serv_Freq_Count__c<>1 ||
Status__c ="Active"&&Text(Service_Frequency__c)="2"&& Serv_Freq_Count__c<>0 &&
Status__c ="Active"&&Text(Service_Frequency__c)="2"&& Serv_Freq_Count__c<>2 ||
Status__c ="Active"&&Text(Service_Frequency__c)="3"&& Serv_Freq_Count__c<>0 &&
Status__c ="Active"&&Text(Service_Frequency__c)="3"&& Serv_Freq_Count__c<>3 ||
Status__c ="Active"&&Text(Service_Frequency__c)="4"&& Serv_Freq_Count__c<>0 &&
Status__c ="Active"&&Text(Service_Frequency__c)="4"&& Serv_Freq_Count__c<>4 ||
Status__c ="Active"&&Text(Service_Frequency__c)="5"&& Serv_Freq_Count__c<>0 &&
Status__c ="Active"&&Text(Service_Frequency__c)="5"&& Serv_Freq_Count__c<>5 ||
Status__c ="Active"&&Text(Service_Frequency__c)="6"&& Serv_Freq_Count__c<>0 &&
Status__c ="Active"&&Text(Service_Frequency__c)="6"&& Serv_Freq_Count__c<>6 ||
Status__c ="Active"&&Text(Service_Frequency__c)="7"&& Serv_Freq_Count__c<>0 &&
Status__c ="Active"&&Text(Service_Frequency__c)="7"&& Serv_Freq_Count__c<>7

 

We currently have a formula that lets us know if the days of the week checked match the number of times it is picked up a week

 

So if the service frequency is 3 and Mon, Wed, Fri (three days) is checked, the user can save the record.

 

If the service frequency is 3 and Mon and Wed (two days) are checked, the user can not save the record.

 

Also this validation allows no service days to be checked

 

Now I need to exclude profiles from being affected by this validation. How do I add several profiles to the validation above?

 

 

 

  • February 04, 2011
  • Like
  • 0

The following code works but not the way I expected.   The problem is if the checkbox is true, the fomula continues to add 1 everytime the record is updated. 

 

IF(Sys_SA_6_1__c = True, 1,0) +
IF( Sys_SA_6_2__c = True, 1,0) +
IF( Sys_SA_6_3__c = True, 1,0) +
IF( Sys_SA_6_4__c = True, 1,0) / 4

 

What I would prefer to have is like the following.  But the PRIORVALUE is not allowed with a checkbox. 

 

( IF(PRIORVALUE(Sys_SA_6_1__c) = False, 1, 0) +

IF(PRIORVALUE(Sys_SA_6_1__c) = False, 1, 0) +

IF(PRIORVALUE(Sys_SA_6_1__c) = False, 1, 0) +

IF(PRIORVALUE(Sys_SA_6_1__c) = False, 1, 0) ) / 4

 

Does anyone have a suggestion on how to resolve?  Ultimately, I want a field (%) to determine how many checkboxes are true for the first time and divide by 4 to support the % (knowning that the checkbox could  be true at any given time).

Hi i have on Opp. a Date/time field called "reminder email"

 

Now i set up a workflow rule with a time trigger to send an email according to that date/time field (0 hours after date/time field) and chose: When a record is created, or when a record is edited and did not previously meet the rule criteria and criteria are met

the criteria is "reminder email" not equal to : blank

 

now my problem is if that date is changed, a new time based workflow will not be created for the new date, unless i erase that field , save the page, then put in a new date/time

 

could i use maybe a: formula evaluate to true type of criteria?

 

with maybe like a formula that says: whenever new value not equal to old value fire workflow rule?

 

if that is good or if you have any other solution, please let me know how

 

Thx

  • January 31, 2011
  • Like
  • 0

The requirement is

 

  1. Send notification emails to a particular email address whenever there is an email activity in a case. The notification should contain the email body.
  2. The notification emails should contain the attachments that were part of the email that triggered the notification.
  3. The notification emails of case should form a conversation thread in gmail (the specified email address is gmail)

 

I am able to complete the first 2 requirements, but the 3rd one is causing troubles. It works partially though. With all that I have heard Gmail uses the Subject line to group emails into a conversation thread. I have a constant Subject but still the notification emails create new conversation threads for each new day.

 

Example

Day 1 – there are 8 email activities in the case 1 and there are 2 email activities in case 2. The apex code sends 8 notifications related to case 1 that form a conversation thread and 2 notifications for case 2 that form another conversation thread. (this is correct)

Day 2 – there are 3 email activities in case 1 and there are 4 email activities in case 2. The apex code sends 3 notifications related to case 1 but this forms a new conversation thread and is not part of the same conversation thread created on day 1.

 

How can I form a single thread for each case instead of single thread of each case on each day?

 

I tried using the setInReplyTo and setReferences but got errors and the notification was not sent. Will this help in the threading problem, what are the other options?

 

Thanks

KD

 

I am new to formula fields. Need some assistance

 

I have a Picklist field "Service Purchased" and "Number of Lines ported" with 1-10.

 

Trying to create a formula field which will determine if it is a "Ported", "Non-Ported" or "Non-OV" order based off of these two fields.

 

If service purchased does not contains "OV" say "Non-OV" and If Number of Lines ported Not equal to 0 say "Ported" otherwise say "Non-Ported"?

 

I have this so far, but it needs help!!!!!

 

 

IF(
AND(

NOT(CONTAINS(TEXT(Services_Purchased__c) , "OV",""))),
"Non OV",

( Number_Lines_Ported__c   <> 0,"Ported", "Non-Ported")

The last bullet of the SOSL challenge says, "The 'searchContactsAndLeads' method must accept an incoming string as a parameter, find any contact or lead that matches the string as part of either the first or last name and then return those records." 

But the text above says that SOSL searches based on word boundaries, and I couldn't figure out a way to do sub-string searches, ie, one where a search for "mit" would return results for "Smith". I passed the challenge with just a basic SOSL query, but I don't think that it meets that last criterion, strictly speaking. 
The upsert example in the Manipulating Records with DML (https://developer.salesforce.com/trailhead/force_com_programmatic_beginner/apex_database/apex_database_dml) lesson is:
upsert sObjectList Account.Fields.MyExternalId;
Is there a "__c" missing at the end of that? Can someone explain the difference between using the [Object].Fields.[FieldName] notation and the fieldname-only notation that is used in the Apex Code Developers' Guide? When would I use one over the other? Here's the example DML statement from the Developers' Guide:
upsert acctList myExtIDField__c;


 

I can authenticate to Trailhead with the Dev org credentials I use for all my community profiles, but when I try to authenticate that org with the "Connect to Your Developer Edition" button above the Challenges, I am led through the OAuth, but then end up at this URL (brackets and ellipses added to remove codes):

https://dfc-org-production-site.secure.force.com/orgtrailheadauth?code=aPrxl0v[...]e6N2G._regTiYVbjA%3D%3D&state=origin_host%3Ddfc-site.herokuapp.com%26user_id%3D223791%26ts%3D1413906236%[...]efc8c72e8a1858f219e

The message on the page is:

Authorization Required 

You must first log in or register before accessing this page. 
If you have forgotten your password, click Forgot Password to reset it. 

The URL parameters look a little malformed, with URL encoded ampersands and equals instead of the actual characters, and perhaps a missing ampersand and/or parameter name between the end of the "code" parameter and the beginning of the "user_id".

Is there any way to configure Eclipse to use the Apex editor with all its syntax highlighting, code-assist and -folding goodness, when editing Visualforce email templates? 

 

Thanks!

 

--

Thomas Taylor

Director of IT

Greater Philadelphia Cultural Alliance

 

I'm trying to create a VF template to email Clicktools survey invitations. Clicktools allows for passing values to the survey as parameters on the URL. I was able to succesfully deploy this survey with this URL structure yesterday using Clicktools' email template builder. (Yes, I could create URLencoded formula fields on the Contact, but dangit, I want to get the VF to work!)

While I can't be sure, since all I'm getting is a general "Syntax Error" message when I try to save, I think the problem must be in the URL building, and most likely the 3rd parameter. That parameter in the URL feeds a multi-line Text question in Clicktools, and should be the concatenated Salutation, First & Last;; Title; Account Name; Contact Email, separated by pipes, eg:
&q3=Mr.%20Thomas%20Taylor|Director%20of%20IT|Greater%20Phila%20Cultural%20Alliance|foobar@philaculture.org

 

 

<messaging:emailTemplate    subject="Complete the Community Engagement Questionnaire"
                           recipientType="Contact"
                           relatedToType="Account" >

<messaging:htmlEmailBody>
<html dir="ltr">
   <head>
       <title></title>
   </head>

   <body>
       <table width="100%" border="0">
           <tbody>
               <tr height="91px" bgcolor="#4F78D6">
                   <td align="right">
                   <apex:image value="{!$Resource.CALogoWhOnB}" /></td>
               </tr>
           </tbody>
       </table>
       <p>Dear {!recipient.FirstName},</p>
       <p>The Cultural Alliance needs your help. We know that arts
and culture play a vital role yadda yadda yadda </p>
          <p>The survey takes 15 minutes to complete. To begin, click:
          <apex:outputLink value="http://www.clicktools.com/survey?iv=123idnumber456">
             <apex:param name="q1" value="{!recipient.Id}" />
             <apex:param name="q2" value="{!relatedTo.Id}" />
             <apex:param name="q3" value="{!URLENCODE({!recipient.Salutation}+' '+{!recipient.FirstName}+' '+{!recipient.LastName})}|{!URLENCODE({!recipient.Title})}|{!URLENCODE({!relatedTo.Name})}|{!URLENCODE({!recipient.Email})}"
/>
              Community Engagement Questionnaire
          </apex:outputLink>
          . Please complete the questionnaire by <b><u>February 4<sup>th</sup></u> </b>.</p>
       <p>Couple more paras of HTML below.</p>
     </body>
</html>

</messaging:htmlEmailBody>
</messaging:emailTemplate>

 Many thanks for any guidance you're willing to offer this aspiring VisualForce builder!

 

 

 

I'm working on sandbox refresh code. For some reason, the portion of my test that makes sure I've inserted the task I want it not getting any code coverage. Here's my class:
global class SandboxRefreshScript implements SandboxPostCopy {
    global void runApexClass(SandboxContext context) {
        // Change value of Alias below to the Alias of user who should own the group
        // ensuring that it is unique among your users
        List<User> groupOwner = [SELECT Id, Username FROM User WHERE Alias = 'MKolo'];
        Id grpOwnerId = groupOwner[0].Id;
        
        // Create a Chatter Group for Payment Pipeline Changes
        List<CollaborationGroup> groups = new List<CollaborationGroup>();
        
        CollaborationGroup pipeline = new CollaborationGroup(
            CollaborationType = 'Public',
            Description = 'Group for showing changes to the cashflow pipeline. ',
            Name = 'Payment Pipeline Changes',
            OwnerId = grpOwnerId
        );
        groups.add(pipeline);
        
        //Create another Chatter Group for All Spark
        CollaborationGroup allSpark = new CollaborationGroup(
            CollaborationType = 'Public',
            Description = 'All Spark group. ',
            Name = 'All Spark',
            OwnerId = grpOwnerId
        );
        groups.add(allSpark);
        
        //Create another Chatter Group for Hiring Notifications
        CollaborationGroup hiringNotifications = new CollaborationGroup(
            CollaborationType = 'Private',
            Description = 'Hiring Notifications group. ',
            Name = 'Hiring Notifications',
            OwnerId = grpOwnerId
        );
        groups.add(hiringNotifications);
        
        insert groups;
        
        //Create a Task for yesterday (so it's immediately overdue) that
        //reminds to update Process Builders to use the new Chatter Groups.
        Task newTask = new Task(
        	Subject = 'Fix Process Builders',
            ActivityDate = Date.today()-1
        );
        insert newTask;

    }
}

And here's my test class:
@isTest
class TestSandboxRefreshScript {
    
    @isTest
    static void testMySandboxPrep() {
        
        Test.startTest();
        
        Test.testSandboxPostCopyScript(
            new SandboxRefreshScript(), UserInfo.getOrganizationId(),
            UserInfo.getOrganizationId(), UserInfo.getOrganizationName());
        
        Test.stopTest();
        
        // Test for Payment Pipeline Changes
        List<CollaborationGroup> chGroup = [SELECT Id, CollaborationType from CollaborationGroup WHERE Name = 'Payment Pipeline Changes'];
        System.assertEquals(1, chGroup.size(), 'Chatter Group List size not equal to 1');
        System.assertEquals('Public', chGroup[0].CollaborationType, 'Chatter group is not public');
        
        // Test for All Spark
        List<CollaborationGroup> chGroup2 = [SELECT Id, CollaborationType from CollaborationGroup WHERE Name = 'All Spark'];
        System.assertEquals(1, chGroup.size(), 'Chatter Group List size not equal to 1');
        System.assertEquals('Public', chGroup[0].CollaborationType, 'Chatter group is not public');
        
        // Test for Hiring Notifications
        List<CollaborationGroup> chGroup3 = [SELECT Id, CollaborationType from CollaborationGroup WHERE Name = 'Hiring Notifications'];
        System.assertEquals(1, chGroup.size(), 'Chatter Group List size not equal to 1');
        System.assertEquals('Private', chGroup[0].CollaborationType, 'Chatter group is not private');
        
        //Test for Task Insert
        List<Task> tasks = [SELECT Id from Task WHERE ActivityDate = Yesterday];
        System.assertEquals(1, tasks.size(), 'Task Group List size not equal to 1');

    }
}

When I run the test,  there is no coverage for lines 41-45 and I don't understand why?
I'm posting here in an effort to get what is clearly a gap/bug in functionality some attention. I tried the route of Salesforce support, but as always it was a frustrating weeks long process that ended with them suggesting I post an Idea to the IdeaExchange so it can remain unacknowledged for 3-5 years. 

Issue:  It is possible to upload a file to Chatter Files in a way that doesn't activate any triggers.

Ways to upload a file to chatter:
  1. 'Upload Files' link on the 'Files' tab
  2. Create a new Chatter post, using the 'File' post type
  3. Comment on an existing Chatter post, and use the 'Attach File' link

2 of these methods fire a trigger: 
  1. A trigger on ContentVersion will fire for uploads directly to the File Tab
  2. A trigger on FeedItem will fire if the file is uploaded on a File chatter post

However, it is possible to upload a file through a Chatter comment without firing any trigger!

Even if a trigger is in place on FeedItem, this trigger will only fire upon submitting the comment as a whole - it is possible to upload the attached file to a comment before the comment is even submitted!

Steps to replicate (upload to Files without firing a trigger):
1. Find a chatter post you can add a comment to.
2. Click the 'Attach File' link and select a file
3. An upload progress bar will complete - this is the point where a trigger should have fired!
4. Don't press the 'cancel' link on the attached file. So long as this isn't pressed, it doesn't matter whether the comment is actually posted or not.
5. Now go to your Files tab: voila, the comment's attached file was uploaded, even though the comment was never posted!

User-added image

Again, no trigger is fired on any object when a file is uploaded using this method. Clearly the file upload should not be allowed to complete until after the comment is posted, but this is not the case.

Am I going crazy here, or is this clearly unexpected behavior that needs to be fixed? Why am I having such a hard time trying to get Salesforce to acknowledge this is a real issue? 

 
The last bullet of the SOSL challenge says, "The 'searchContactsAndLeads' method must accept an incoming string as a parameter, find any contact or lead that matches the string as part of either the first or last name and then return those records." 

But the text above says that SOSL searches based on word boundaries, and I couldn't figure out a way to do sub-string searches, ie, one where a search for "mit" would return results for "Smith". I passed the challenge with just a basic SOSL query, but I don't think that it meets that last criterion, strictly speaking. 
This task, creating a Static Resource from:
Download the current version of the jQuery Mobile JavaScript library, currently jQuery Mobile 1.4.4, in the ZIP format.
The newest version, 1.4.5 is 7MB and of course does not upload.
 
The upsert example in the Manipulating Records with DML (https://developer.salesforce.com/trailhead/force_com_programmatic_beginner/apex_database/apex_database_dml) lesson is:
upsert sObjectList Account.Fields.MyExternalId;
Is there a "__c" missing at the end of that? Can someone explain the difference between using the [Object].Fields.[FieldName] notation and the fieldname-only notation that is used in the Apex Code Developers' Guide? When would I use one over the other? Here's the example DML statement from the Developers' Guide:
upsert acctList myExtIDField__c;


 

I can authenticate to Trailhead with the Dev org credentials I use for all my community profiles, but when I try to authenticate that org with the "Connect to Your Developer Edition" button above the Challenges, I am led through the OAuth, but then end up at this URL (brackets and ellipses added to remove codes):

https://dfc-org-production-site.secure.force.com/orgtrailheadauth?code=aPrxl0v[...]e6N2G._regTiYVbjA%3D%3D&state=origin_host%3Ddfc-site.herokuapp.com%26user_id%3D223791%26ts%3D1413906236%[...]efc8c72e8a1858f219e

The message on the page is:

Authorization Required 

You must first log in or register before accessing this page. 
If you have forgotten your password, click Forgot Password to reset it. 

The URL parameters look a little malformed, with URL encoded ampersands and equals instead of the actual characters, and perhaps a missing ampersand and/or parameter name between the end of the "code" parameter and the beginning of the "user_id".

I'm working on a force.com sites page and just got the italicized message below from our web developers. I've had SFDC disable clickjack protections but it didn't work; should I ask them to allow a higher trust setting? Any other advice? Thanks!

The "X-Frame-Options" header needs to be set on the page being embedded in the iFrame (not the calling/parent page), which would be the page being delivered from the "rocketshiphr.force.com" domain.

"X-Frame-Options" is used on pages to control if, and when, a page can be displayed in an iFrame.  Currently, the page coming from "rocketshiphr.force.com" has this set to "SAMEORIGIN", which is why this is not working.  Whoever is responsible for "rocketshiphr.force.com" will need to remove the "X-Frame-Options" header completely.  The "ALLOW-FROM" option is not fully supported across all browsers, so it is not recommended to use that method.

You will need to contact "force.com" about this matter as there is nothing we can do on our end to have this work.  If "force.com" cannot do this, then the only other option you have is to provide a link on that page that points to the URL you are trying to embed in the iFrame.
I have a "readOnly" field by layout in a Chatter Action-Update, It works in browser no when it is used in @Salesforce1 bug/no bug?

What do you think? I understand that you will put in the layout only the fields that you want to allow the user to update... but maybe you would like to have more info.

However , once again, it makes sense to have only the ones that you will allow to update... but then.... why does the chatter action work in browser and no in Salesforce1????

Ideas? Opinions ? 
My company has offered to pay for SF dev training, and I'm having a hard time deciding which one to attend. My role is to enhance and maintain the development of an app in the AppExchange that integrates with our company's service, with the possibility of creating additional apps to enhance customer experience.  I forsee most of my work being done in Apex/VF code.

Reading the course descriptions, I get the sense that DEV401 is for those with little coding background, and DEV501 is more code-focused. With this assumption, I'm leaning toward DEV501, since I have a coding background - just not necessarily in Apex/Visualforce. 

Because the training is a considerable financial investment, and I can only attend one of the classes, I wanted to post to the forum to see if my assumptions were correct, or if I was off base. With six months of SF development experience, would I be lost going straight into DEV501?
Hi

I need to create Two fields
1. Picklist
2. Formula Field

I have one Picklist Field when i select Picklist Value. I need to display automatically For Date/Time Of Formula Field.

so i need to create one Formaula Field. In Formaula Field i need to write Formula.
Please help me.

Hi Everyone

 

Has anybody integrated Amazon SES web Service with Salesforce. If yes, please guide me to the right direction.

 

Thanks

Sid

Hi Friends,

 

Can we assign text field and number fields to record types or we can only assign picklist values to record layouts.Please help soon

 

Thanks,

Trick 

  • February 17, 2011
  • Like
  • 0

Hi Friends,

 

 

I have to understand some existing validation rule which I need to modify and then use it again.Can somebody please help me in understanding this rule.

 

Rule is given below:-

 

IF( 
AND( 
(ISPICKVAL(Channel_Opportunity__c ,"Direct")),
Not(ISPICKVAL( StageName ,"Identified")), 
$RecordType.Id ="0127000005ELJ",
$User.ProfileId <>"00e700000wujI"), 
ISPICKVAL( Bid_Strategy__c,"" ) 
,false)

 

 

Can u please explain what this validation rule seems to be doing and what is the role of $RecordType.ID and  $User.ProfileId and why are we using them.Please help.I know I am asking a bit too much but I also know that people in this forum have high calibre.

 

Trick

 

  • February 17, 2011
  • Like
  • 0

Hi All,

    I have a below formula fields

Market Segment 1

Market Segment 2

Market Segment 3

 

where Market Segment 1 is

 

CASE ( MarketSpecialty__c ,
"Hospital-Anesthesiology","ANESTHESIA",
"Hospital-Breast Surgery","SURGERY",
"Hospital-Cardiac Anesthesia","ANESTHESIA",
"Hospital-Cardiology","CARDIOLOGY",
"Hospital-Cath Lab","CARDIOLOGY",
"Hospital-CCU (Dedicated)","CRITICAL CARE",
"Hospital-Emed","EMED",
"Hospital-Endocrinology","ENDOCRINOLOGY",
"Hospital-General Surgery","SURGERY",
"Hospital-Hospitalist (Gen Med)","CRITICAL CARE",
"Hospital-ICU/CCU","CRITICAL CARE",
"Hospital-IMT","vascular",
"Hospital-Interv Rad","INTERVENTIONAL RADIOLOGY",
"Hospital-LD/OB/GYN","OB/GYN",
"Hospital-MSK","MSK",
"Hospital-Nephrology","NEPHROLOGY",
"Hospital-Neurology","NEUROLOGY",
"Hospital-Oncology","ONCOLOGY",
"Hospital-Orthopedics","MSK",
"Hospital-Physical Med & Rehab","MSK",
"Hospital-Picu/Nicu","CRITICAL CARE",
"Hospital-Radiology","RADIOLOGY",
"Hospital-Rheumatology","MSK",
"Gov-Deploy","DEPLOYABLE",
"Hospital-Sports Med","MSK",
"")

 

Market Segment 2 and Market Segment 3 has similar values and end result is

Market Segment = MarketSegment1__c & MarketSegment2__c & MarketSegment3__c

 

but now the problem is i want to add few more values to 

 

Market Segment 1,Market Segment 2 and Market Segment 3 but it's saying my formula is too big, initially i want to change this to picklist but i have some 1000+ reports which use these fields so i can't change it, any idea how to add few more values by reducing the formula field, any help is appreciated .

 

TIA!

 

 

Hi,

 

Can i create a formula using a lookup object fields? For instance i have a custom object and got a lookup with account

i need a formula which uses a field from the account object

 

For eg.

 

"PJ_"&SHORTNAME&"_"&UNIQUE-SEQ-NUM (UNIQUE)

 

Where shortname is a field in account object.. If using formaula is not possible is there anyway to achieve it?

 

Thanks

 

Prady

 

 

 

  • February 15, 2011
  • Like
  • 0
Hi,
I have an junction object with three lookup fields to three budget types (other objects). They are filled in depended on selected record type.
As result of formula I want to have 18 character Id.
Formula:
CASE(RecordType.Name,
'Product Budget', EMS_Product_Budget_gne__r.Id,
'Region Budget', EMS_Region_Budget_gne__r.Id,
EMS_Territory_Budget_gne__r.Id)

Compiled size: 523 characters. Great but it returns 15char Id. Lets use CASESAFEID()
CASESAFEID( CASE(RecordType.Name,
'Product Budget Allocation', EMS_Product_Budget_gne__r.Id,
'Region Budget Allocation', EMS_Region_Budget_gne__r.Id,
EMS_Territory_Budget_gne__r.Id) )

Error: Compiled formula is too big to execute (9,780 characters). Maximum size is 5,000 characters.
CASE(RecordType.Name,
'Product Budget Allocation', CASESAFEID( EMS_Product_Budget_gne__r.Id),
'Region Budget Allocation', CASESAFEID( EMS_Region_Budget_gne__r.Id),
CASESAFEID( EMS_Territory_Budget_gne__r.Id) )

Error: Compiled formula is too big to execute (8,374 characters). Maximum size is 5,000 characters

Why is it that expensive? Is there a way to wokaround this?



I have a regular old PDF file on my desktop, and that same PDF file is attached to a record in Salesforce.  Now, when I change the PDF's extension on my computer to ".txt", I can then open it and read the texttual data that makes up the file.  I need to extract some data at the beginning of the ".txt" version of the file that details how many pages the PDF consists of, but I need to do this for many PDF files that are already in Salesforce.

I discovered the "String pdf = System.EncodingUtil.base64Encode(a.Body)" method, which apparently converts the base64 blob representation of the file into an unencoded string... but when I looked at the actual output, I realized that it was totally different compared to the ".txt" version of the PDF on my desktop.  It seems that I'm not encoding/decoding the attachment Body blob to the correct format, but I'm totally clueless as to what to convert it to, or what method I would need to use to convert it.

Does anyone have any ideas as to how I would convert the PDF data to whatever format it gets converted to when I just change the extension on my computer and view it in notepad?

Thanks!