• goabhigo
  • PRO
  • 2745 Points
  • Member since 2010


  • Chatter
    Feed
  • 81
    Best Answers
  • 6
    Likes Received
  • 3
    Likes Given
  • 62
    Questions
  • 873
    Replies
So far this is what I have come up with
AND(ispickval('Status' NOT, "none"), Len(Text(App))=0 ))
I'm trying to create a validation rule that will not allow a user to create a new case if the 'App' doesn't have an option selected.  The 'status' field is a pick list as well as the 'app' field.  When a case is created the status by default is  new
 
Hi Guys,

How to migrate case support settings in service cloud? can we migrate using change set  or force.com IDE or Packages?

Regards
Ramakrishna
I have a validation rule to write on a call object which has a related object Address. The address object has 2 picklist fields--- Address Type, State
The objective is if if state!=PR AND Address Type=POB do not allow to save the call for that address combination BUT if state=PR AND address type=POB allow to save the call for that address combination.

Would be really helpful if anyone could help! Tried innumerable ways but all failing!

Thanks in Advance!
  • September 23, 2016
  • Like
  • 0
Community, I hope you can help me. I'm stumped. 

I'm the Salesforce admin at our company and I have created a dashboard full of reports with the interntion of packaging that all up and sharing it with our customers. However, once I have packaged up the dashboard, reports and custom fields assciated with the reports, I tested this package first by installing it into another Salesforce account, but the reports do not work... at all.

Just to give you more information, here is the dashboard in our primary SFDC account (which works perfectly)... 
User-added image

On an individual report level, I use Joined Reports and the "assigned" field as the cross-block grouping field...
User-added image

However, once I have installed the package in another SFDC account (which is essentially a mirror of our main account), the dashboard is blank...
User-added image

... and my reports are now MISSING the "assigned" grouping field...
User-added image

I can't even add the "assigned" field back in... it's actually there, it's just invisible and completely inaccessible. I know it's there because when I edit my chart, it still shows "assigned" as the Y-axis...
User-added image

But it's straight-up NOT working. 

PLEASE help :-) 
HI

Team member creates a CONTACT record without trying to ACCOUNT,team member select the hot under the status picklistfield.please tell me how to reslove above one.

THANKS

RANGA
Hello,

How can you create a report for events which are related to Accounts.
I futher wants to create report for events hich are related to opportunitees,etc.

Thank you
  • September 29, 2015
  • Like
  • 0
Hello,

I create a report for my team.

In the report if I am able to see correctly all the results that are concerned to me but in Dashboard I am also seeing the data whiwh are not cencerned to me also.

Thank you
  • September 25, 2015
  • Like
  • 0
Hi,

I was asked by someone to send him the same report every month. So to make it simple, let's say on every 28.MONTH send .csv of Report XY via E-Mail to user@company.com

Is it possible to automate this?

Greets
Hi all,


I have a custom text field that I want to include into a workflow where my end result will be a field update(checkbox). What I want as a rule is when this custom text field is the same then the update won't take place. ie. when abc1234 = abc 1234 then nothing will happen. 

My question is how can I create this rule? (For a contact I have a custom object where it has records. In some cases two records have the same custom text field.)
Below is our code to find the account ID for inserted child records that have a unique identify (R12 Customer Number).  This works great if the R12 Customer Number is a unique match, but we are now consolidating accounts in SFDC and this may contain a string of customer numbers on the account level (example, R12 Customer Number = 'GEN12412;GEN12342;GEN12542' rather than R12 Customer Number = 'GEN12412').

I am trying to figure out how a child record being inserted with the R12 Customer Number = 'GEN12412' can find the right account ID if on the account the R12 Customer Number = 'GEN12412;GEN12342;GEN12542'.  The child record needs to trigger a contains search, but I am not certian how that would look in an Apex Trigger.

 
trigger UpdateCPInvoiceHeaderId on Customer_Order_Header__c (before insert) {
    //get the R12 Customer Numbers and store it in a set.
    set<String> acct = new set<String>();
    set<String> acct2 = new set<String>();
    for(Customer_Order_Header__c i: trigger.new){
        if(i.R12_Customer_Number__c != null){
        acct.add(i.R12_Customer_Number__c);
        }
        }
    
    //query the account records and get the associated IDs 
    map<string, Account> acctMap = new map<string, Account>();
    for(Account a:[SELECT Id, R12_Customer_Number__c FROM Account WHERE R12_Customer_Number__c IN: acct]){
        acctMap.put(a.R12_Customer_Number__c,a);
        }
    
    //update the account value based on the R12 Customer Number in the record    
    for(Customer_Order_Header__c i:trigger.new){
        if(i.R12_Customer_Number__c !=null && acctMap.containsKey(i.R12_Customer_Number__c)){
            i.Account__c=acctMap.get(i.R12_Customer_Number__c).Id;
        }
        
    }
    
}

 
Hi,

How to send "Mass Email" using Visualforce Email Template. The Template wil have images, Screenshots and attachments.
 
HI All,
i am attaching files to an email that I send out form Apex code. I was reading the documentation of email file size limits and came across very conflicting statements. In the help section it is clearly written

"The size limit for multiple files attached to the same email is 25 MB, with a maximum size of 5 MB per file."
(https://help.salesforce.com/apex/HTViewHelpDoc?id=collab_files_size_limits.htm)

But then I also find this in a couple of places

"The max email message size for a complete email message including attachments is 10MB"
(https://developer.salesforce.com/page/Force.com_Email_Services_Size_Limitations)

"Email Services: Maximum Size of Email Message (Body and Attachments):10MB"
"Email services reject email messages and notify the sender if the email (combined body text, body HTML, and attachments) exceeds approximately 10 MB (varies depending on language and character set)."
(https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm)
(https://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_classes_email_inbound_what_is.htm|StartTopic=Content%2Fapex_classes_email_inbound_what_is.htm|SkinName=webhelp)

My question is quite simple ... What limit should I care about if I intend to send attachments through email directly from the controller?

There is a date field, for inserting date of birth.

There is another button to calculate age (in days) which will be displayed below.

How to do that?

Hello ,
         I am Using import wizard for importing my leads from production to developer account. I export all leads from production, i have total 3500 leads. When i tried to import then its display like this:
Result:
Total records processed: 3,555
Leads created: 1,974
Leads not updated: 1,581
Leads updated: 0
Invalid or no-access lead ids: 0
Deleted lead ids: 0
Locked leads: 0
Converted lead ids: 0
Ignored leads because a converted status was specified: 1,581
Duplicates: 0
Violated uniqueness constraints: 0

How to solveout this issue??
Thanks,

 

I need to capture the Contact Address and reder it in order address field if certain picklist value is selected.
I have two Contacts Record Types. Clinician and Customer.
If user selected Clinician from the picklist value, it should capture the clinician address and render it in tyhe new order shipping address.
Likewise iwf customer is selected.

Thanks in advance

i am having a custom button which opens VF page.and creates opportunity from order and orderitem .I also wan to copy line items of order in to opportunitylineitems.
Plese help.I am having all ready except copying lineitems.
thanks in advance...
After attaching a file in 'Notes and Attachment' section whenever I am clicking in view file then I get a url for viewing this file. 
Now the requirement is that this url should be accessible to external users without prompting for login.
Can anybody please help.

Thanks in advance.
Hi,
 I am in a situation where I would like to create a trigger to update account owner. As I am new to triggers I do not have any experience on working with triggers.

My partner portal users requests me a lot through emails to change account owner from admin to their name.

To solve this issue, I created a custom checkbox field called Record_Transfer_Record__c

So now I want to create a trigger if current account owner is Admin and current user has checked the custom checkbox Record_Transfer_Record__c then after he hit the save button then Account Owner get changed from Admin to current user who is checking the checkbox.
I tried this code but hard luck no success :(

trigger AccountOwnerChange on Account (before update)
         {
          if(trigger.isBefore && Trigger.isUpdate)
        {
            for(Account obj: trigger.new)
            {
                if(obj.ownerId = '00590000001OizE')
                {
                 if(obj.Record_Transfer_Request__c == True)
                 
                Account a = [SELECT id, OwnerId FROM Account WHERE id =: Trigger.old[0].Id];
                
                  Trigger.new[0].OwnerId = UserInfo.getUserId();
                   {
                                    


                    
    }            
   }
   }
   }
   }
Please help ..........

 
My Trigger is as following:-

trigger RestrictContactByName on Contact (before insert, before update)
{ //check contacts prior to insert or update for invalid data
For (Contact c : Trigger.New)
{
if(c.LastName == 'INVALIDNAME')
{ //invalidname is invalid
c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML');
}
}
}

--------------------------------------------------
And my Test class as follows:-
@isTest
private class TestRestrictContactByName
{
    @isTest static void TestContact()
    {

        Contact con=new Contact(FirstName='Arjun', LastName='Mahi');
        if(con.LastName=='INVALIDNAME')
        {
             con.AddError('The Last Name "'+con.LastName+'" is not allowed for DML');
            
        }else{insert con;}  
 
        Contact conn=new Contact(FirstName='Arjun', LastName='Kapur');
         if(conn.LastName=='INVALIDNAME')
        {
             conn.AddError('The Last Name "'+conn.LastName+'" is not allowed for DML');
            
        }else {update conn;}  
       
        Contact com=new Contact(FirstName='Rama', LastName='INVALIDNAME');
        
        if(com.LastName=='INVALIDNAME')
        {
             com.AddError('The Last Name "'+com.LastName+'" is not allowed for DML');
            
        }else {insert conn;}
    }
}


plz help me complete this Challenge :)
Thanx in Advance :)
 
I have a Site User who accesses records through a VF page. I am encountering a strange problem where, Files uploaded in Lightning is visible but not the files those were uploaded in Classic.
When debugged, SOQL query is returning all in Execute Anonymous, but Debug Logs show only limited (uploaded in Lightning). Below is the code used for querying the files.
List<ContentDocumentLink> docList = [select ContentDocumentId, ContentDocument.title from ContentDocumentLink where LinkedEntityId =:recordId]; 
​system.debug('docList: ' + docList);
Any idea how to solve this? More importantly any idea why this is happening?
Is there way to get the details of report export? I need to know which user exported, with time stamp. I am guessing this can be done using Analytics API, but not finding any helpful article/notes or any related params in API Guide too.
I have done enough reading, using it in my coding, on some of the design patterns mentioned in this article. I am keen on understanding other design patterns that you implement and found it suitable most. The design patterns normally are borrowed from other languages, which need not necessarily fit Salesforce/Apex coding style.

It will be great if you folks can share your thoughts.

--
Abhilash.
When we enable "Enable clickjack protection for customer Visualforce pages with standard headers" & "Enable clickjack protection for customer Visualforce pages with headers disabled", the Visualforce Page which is overridden the Case (in fact, any object) Edit button/link doesn't work. It just displays blank screen.

Not just edit/new button/link, but any custom component in the Console doesn't work.

As per the Winter'17 release notes - "You can now embed custom Visualforce pages in the Service Console even when clickjack protection is enabled for Visualforce pages. Previously, if you wanted to use Visualforce pages in the Service Console, you needed to disable clickjack protection for all Visualforce pages." --- THIS STILL DOESN"T WORK.


--
Regards,
Abhilash.

 
I have a Hierarchy (a lookup to User) field in User - it is called Mentor. The requirement is simple, when I change the Mentor, an email should be sent to new Mentor and the User.

I have created email field, populated the same using workflow. Then I created an email alert, to send the email to user's email and this newly created email field.

Output is surprising - The email is directed to Mentor and mentor user's mentor is shown!!
To make is clear here is the example:
Keir is the Mentor of Abhilash. The admin changes the mentor, to Bob. Now ideally Bob and Abhilash should get an email about this change. But what happens is Bob gets email as below:

Dear Bob,
Your mentor has been changed/mentee has been assigned. 
Mentor: Buzzard 
Mentee: Bob 


Is there any way to do this without writing apex trigger?

--
Abhilash.
Hi all,

I have created a VF page with couple of reports. These reports are filtered, based on the selection available. For now assume the filter is just the Owner Name. All works well - I have used to show the report chart and have used cacheResults="false" to ensure the reports get refreshed on load. 

Now coming to the issue I am facing - when the user clicks on the report chart the report opens in existing window/tab. I want it to be opened in new tab/window. I have tried using onclick() and < a >tag, but no luck. 

Can anybody suggest if there is a way to do this? 

Here is the very sample code - without filters - just a simple page with report chart.
<apex:page>
     <a href='/00ON0000000LRNi' target='_blank'>
        <analytics:reportChart reportId="00ON0000000LRNi"></analytics:reportChart>
     </a>
</apex:page>

Interestingly the block becomes clickable and opens in new tab. Please note that including the filters in doesn't work for some reports. So I guess this is not the solution. Also note that there is no attributes available in reportChart to open this in new tab.

Please suggest.
I seem to have no clue what's wrong in the report which I created. As per the requirement - Summarize the report by Account Name, the contact’s Full Name, and show the Hobby Name." Here I do not understand Full Name, as in the report we only get First Name, Last Name.
The error says - 
Challenge Not yet complete... here's what's wrong: 
The 'Lightning Hobbies by Contact' report does not appear to have either the correct report type or (most likely) the correct columns.

I have summarized the report by Account Name, then by Last Name. Another column shown is Hobbies Name. The report filter is on Hobby Type (the bucket field) = Outdoor Activities and it is locked.

Does anyone know whats wrong?
I just created new DE. While checking the third challenge in Reports and Dashboard Superbadge I get the following error:
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: TDOUZQDI

--
Abhi
Use Case: The Live Agent code is hosted in a specific page of the website. The visitor/user initiates the chat and in between the user goes/navigates to other page or refreshes the page, all the chat data is lost. The chat window shows "Start Chat" button. Is there a way to retain the data in the same chat session? If yes, how? 

I have gone through the Live Agent Dev Guide and did not find any answer to the same.
We have 3 departments working on the same Account. Ideally I would suggest to go ahead with Account Teams or Record Types. BUT the main issue is that there are same fields accessible to all 3 departments, and all the values are similar.
For eg: Type is picklist with values, New, Existing, Cold.
Department A, Type =New,
Department B, Type = Existing,
Department C, Type = Cold.

How do I deal with this?

Please suggest.
The process works fine, I have tested it. When I click on "Check Challenge", this is what I get:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. 
A flow trigger failed to execute the flow with version ID 3012800000001r1. 
Contact your administrator for help.: []

 
Hi,
I recently was checking the enhancements in Data Import Wizard and found that its not working. Following is the error message I am getting:
Data import_error in uploading csv

The other DE has https://ap1.salesforce.com/setup/dataImporter.app but the current DE has https://ap1.lightning.force.com/setup/dataImporter.app. Is there something to do with Lightning? Attached is the screenshot:
ap1.lightning.force.com....

Have you come across this error? If yes please let me know how you solved it.

BTW, I have tried uploading other .csv. I also have uploaded the data using old import wizard. So there is nothing wrong with .csv file.
I have an org where there are multiple branches (locations) which has similar set of users roles - Area Manager, Branch Manager, Sales Executive. As per the rule, it is best if I create roles like - AM Location1, BM Location1, SE Location1, AM Location2, BM Location2, SE Location2. This is ok if we have very limited branch, BUT not at all good design if we have more. In my case I have 3900+ branches!!!

Problem with creating one set of hierarchy (AM, BM, SE) is that, AM of Location1 can see records created by SE of Location2.

Is there a way to do this? Please suggest.

Is there any best practice to delete the records from Staging objects (which is uploaded daily through Jitterbit)? The data limit has crossed 2000%. Immediate solution would be to delete the records that are processed then schedule a batch class which will run, say weekly, and deletes the success records.


In simple terms how this works is: Staging Account object will be populated daily, the user selects bulk records and clicks on "Process", the controller runs and inserts/updates the Account.

 

Any suggestions?

Hi,

 

I have been hounded by the following questions. I think I know answers to couple of them, but would like to confirm.

 

According to Testing Best Practices, we need to use System.assert methods to prove code behaves properly. Here is a scenario I need answers:

  • My trigger on a child object updates parent fields (kind of roll up, I can't use master-detail)
  • 1st I inserted Account (parent), then inserted Branches, says 5 (child)
  • The trigger runs on insert and updates 'No. of Branches' field of Account
  • Initially when I inserted Account, No. of Branches was 0. Now it should be 5
  • System.debug statements on trigger shows me that Account was updated successfully BUT when I use system.assertEquals(acc.No_of_Branches__c, 5) it fails
  • The System.debug(acc) shows me that the value is still 0, but when I query (as per http://wiki.developerforce.com/page/An_Introduction_to_Apex_Code_Test_Methods - Test.startTest/Test.stopTest section) and see the field is updated

Why?? Do I need to do something extra? Is there any document which explains this behaviour?

 

To test the code for bulk records I use loops (for or while) and insert list of records. Is this the way? I understand that we can also use Test.loadData().

Hi, I have been facing this issue from past 1 week or so. I am unable to reply to questions which has been my hobby from the day I started gaining knowledge in Salesforce. I do not have any formatting option available - I cannot separate texts by paragraphs, don't see any rich text options, no code block option, etc. I have tweeted about this too (https://twitter.com/abhi23k/status/284239265469186048). PS: I have tested this with different browsers (Chrome, Firefox, IE9). No change in issue. (this line is in next para)

Hi I am stuck in a point which I believe is almost 'the end', but I am not just able to write test class for this.

 

I have a flow, which shows a list of Opportunities, one by one based on score. This flow has been referenced in a VF page:

<apex:page controller="OppPriorityController">
    <h1>Opportunity Prioritisation Wokflow</h1>
  <flow:interview name="Opportunity_Prioritisation_Flow" interview="{!myflow}" buttonLocation="bottom">
  <apex:param name="varCurrentUserID" value="{!$User.Id}"/> 
  </flow:interview>
</apex:page>

 The OppPriorityController is below:

public class OppPriorityController {

    // Need not instantiate explicitly the Flow object using the class constructor 
    
    public Flow.Interview.Opportunity_Prioritisation_Flow myflow { get; set; }
    public String getPhoneNumber() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.PhoneNumber; 
             }
    public String getAccountID() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.AccId;
    }
     public String getAccountName() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.AccountName;
    }
     public String getOpportunityID() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.OppId;
    }
     public String getOpportunityName() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.OppName;
    }
}

 The test class which I tried is below:

@isTest (SeeAllData=true)
private class OppPriorityControllerTest {
    public static testMethod void myTestMethodForFlow() {
        PageReference pageRef = Page.OppPriorityPage;
        Test.setCurrentPage(pageRef);
        OppPriorityController oppPriorityController = new OppPriorityController();        
        oppPriorityController.myflow = new Flow.Interview.Opportunity_Prioritisation_Flow(new Map<String, Object>());
        String pNumber = oppPriorityController.getPhoneNumber();
        String accountId = oppPriorityController.getAccountID() ;
        String accountName = oppPriorityController.getAccountName();
        String opportunityID = oppPriorityController.getOpportunityID();
        String opportunityName = oppPriorityController.getOpportunityName();
    }
}

 I received an error: Interview not started.

 

Any help here would be grateful. I tried to serach in various places, but none helped me to solve this.

 

 

 

 

Though I have played around Visual Flow, this particular requirement is taking too much time to solve.

 

The requirement: Opportunities of logged in user, should be shown one-by-one, sorted based on a Opportunity Score field. Opps for logged-in user can be solved using Sharing Settings. But here the critical one is to, show the next opportunity.

For eg: I have 5 Opportunities - Scores 1,2,3,4,5. I need to show Opp with score=5 first, then after 'Next' button is pressed, Opp with score=4 should be shown and so on..

 

Is this really possible in Flows? Please suggest.

Hi,

I have a strange situation here.

 

I have written a web service class which searches for MemberID (which is unique) in Accounts, if its found then it updates that record OR else it inserts new record. The values for each fields in Accounts are supplied as a XML string parameter from Java. So the Java program calls this web service methods by passing XML strings.

 

All works well when tested with some static inputs, however when this method called in bulk, I get he error - 

Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: Member_ID__c duplicates value on record with id: 0019000000CZC83: []

 

I have no clue why and how could this happen? As I am searching for Member_ID__c in my query then inserting if its not found. As an additional step, I replaced 'insert' by 'upsert', still I am getting this exception.

Hi,

 

Hope some of you have come across this issue. System Adminstrator doesn't have permissions like Create and Upload Change Sets, Deploy Change Sets. As you might aware you cannot edit standard profiles. Is there any way to solve this?

 

 

 

I solved it by -

  • Created custom profile by cloning the System Administrator profile, gave the permission
  • Since I myself cannot change profile, I had to login with another system admin then change my profile
  • Then login back and play with Change Sets.

But I am not really sure about this solution, as it is time consuming and also might not be possible if there is no other System Admin !!

 

Suggestions please...

 

When we enable "Enable clickjack protection for customer Visualforce pages with standard headers" & "Enable clickjack protection for customer Visualforce pages with headers disabled", the Visualforce Page which is overridden the Case (in fact, any object) Edit button/link doesn't work. It just displays blank screen.

Not just edit/new button/link, but any custom component in the Console doesn't work.

As per the Winter'17 release notes - "You can now embed custom Visualforce pages in the Service Console even when clickjack protection is enabled for Visualforce pages. Previously, if you wanted to use Visualforce pages in the Service Console, you needed to disable clickjack protection for all Visualforce pages." --- THIS STILL DOESN"T WORK.


--
Regards,
Abhilash.

 
I have a Hierarchy (a lookup to User) field in User - it is called Mentor. The requirement is simple, when I change the Mentor, an email should be sent to new Mentor and the User.

I have created email field, populated the same using workflow. Then I created an email alert, to send the email to user's email and this newly created email field.

Output is surprising - The email is directed to Mentor and mentor user's mentor is shown!!
To make is clear here is the example:
Keir is the Mentor of Abhilash. The admin changes the mentor, to Bob. Now ideally Bob and Abhilash should get an email about this change. But what happens is Bob gets email as below:

Dear Bob,
Your mentor has been changed/mentee has been assigned. 
Mentor: Buzzard 
Mentee: Bob 


Is there any way to do this without writing apex trigger?

--
Abhilash.
Hi all,

I have created a VF page with couple of reports. These reports are filtered, based on the selection available. For now assume the filter is just the Owner Name. All works well - I have used to show the report chart and have used cacheResults="false" to ensure the reports get refreshed on load. 

Now coming to the issue I am facing - when the user clicks on the report chart the report opens in existing window/tab. I want it to be opened in new tab/window. I have tried using onclick() and < a >tag, but no luck. 

Can anybody suggest if there is a way to do this? 

Here is the very sample code - without filters - just a simple page with report chart.
<apex:page>
     <a href='/00ON0000000LRNi' target='_blank'>
        <analytics:reportChart reportId="00ON0000000LRNi"></analytics:reportChart>
     </a>
</apex:page>

Interestingly the block becomes clickable and opens in new tab. Please note that including the filters in doesn't work for some reports. So I guess this is not the solution. Also note that there is no attributes available in reportChart to open this in new tab.

Please suggest.
I seem to have no clue what's wrong in the report which I created. As per the requirement - Summarize the report by Account Name, the contact’s Full Name, and show the Hobby Name." Here I do not understand Full Name, as in the report we only get First Name, Last Name.
The error says - 
Challenge Not yet complete... here's what's wrong: 
The 'Lightning Hobbies by Contact' report does not appear to have either the correct report type or (most likely) the correct columns.

I have summarized the report by Account Name, then by Last Name. Another column shown is Hobbies Name. The report filter is on Hobby Type (the bucket field) = Outdoor Activities and it is locked.

Does anyone know whats wrong?

Hi,

 

In contracts I have a custom field No of Visits. Based on this and contract period (in months) I will have to update a date field - next visit. So Next_Visit_Date__c will be ContractTerm/No_of_Visits__c months ahead of start date (for the first time). Once this date is over, I need to override the same field, this time Next_Visit_Date__c will be ContractTerm/No_of_Visits__c months ahead of previous Next_Visit_Date__c. I have created WFR on creation to fill the next visit date for the first time also have created time based workflow rule which creates a task to notify, as well as update the Next_Visit_date__c. Everything works fine!!

 

But the time based workflow doesn't fire again. I cannot use ISCHANGED() or PRIORVALUE() functions in Evaluation Criteria : When a record is created, or when a record is edited and did not previously meet the rule criteria.

 

I am thinking of creating a custom date field which will store the previous value of Next_Visit_Date__c and use that in the Rule criteria of time based workflow. Is there any better suggestion?

Please let me know.

HI Team,

Please let me how to get rid of this error,

My Controller method.

public void Init()
    {
        System.debug('Test method called');
         strText = ApexPages.currentPage().getParameters().get('str');
        //strText1 = ApexPages.currentPage().getParameters().get('str1');
        System.debug(strText);
        list<String> strTextVal = strText.split(',');
        System.debug(strTextVal[0]);
        System.debug(strTextVal[1]);
        queryData = [select RadioFeild__c, During_Week_Availability__c,Status__c,Reason_Comments__c,Reason_comments_for_Recent_Rejection__c, During_Week_OtherWorkFile__c, During_Week_OtherWorkEst__c,During_Week_FileSelection__c,During_Week__c,During_Week_Debreifs__c,During_Week_Core__c, Reason_Rejection__c, Other3_core__c, Total_Total_time__c, CommentsAvailability__c, Other1Title__c, Other2Title__c, Picklist__c, Date_QAAM__c, Week_Start_Date__c,
                                                  Availability__c, ReasonAvailability__c, Work_Hours__c, Pre_Vet_Reviews__c, BAU_File_Reviews__c, Debriefs__c,
                                                  File_Selection__c, Other_work__c, Other_work_Estimate__c, Total_Work_Time__c, Team_Meeting__c, Huddle__c, 
                                                  Quarterly_Updates__c, Governance_Forums__c, Performance_Reviews__c, Tea_Breaks__c, CPD_e_Learning_Maintenance__c, 
                                                  Coaching__c, PD_Days__c, One_on_Ones__c, Weekly_Tracker_preparation__c, Business_Communications__c, 
                                                  Other__c, Other1__c, Other2__c, Project_Time__c, Other_Time__c, Project_Time_Description__c, 
                                                  Other_Time_Description__c, Shrinkage_time__c, Available_Time__c, Availability_Checking__c, id, Week__C 
                                                  from QAAM_Weekly_Planner__c where Week__C =: strTextVal[0] and CreatedBy.Name =:strTextVal[1]];
        list<String> weekDataStatic = new list<String>{'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'};
            integer i=0;
            
}

My test class

 static testmethod void Init()
    {
        a init = new a();
        init.strText = 'abc,abc';

        init.queryData = [select CommentsAvailability__c, Other1Title__c, Other2Title__c, Picklist__c, 
                                                  Date_QAAM__c, Week_Start_Date__c, Availability__c, ReasonAvailability__c, 
                                                  Work_Hours__c, Pre_Vet_Reviews__c, BAU_File_Reviews__c, Debriefs__c, File_Selection__c,
                                                  Other_work__c, Other_work_Estimate__c, Total_Work_Time__c, Team_Meeting__c, Huddle__c,
                                                  Quarterly_Updates__c, Governance_Forums__c, Performance_Reviews__c, Tea_Breaks__c, 
                                                  CPD_e_Learning_Maintenance__c, Coaching__c, PD_Days__c, One_on_Ones__c, 
                                                  Weekly_Tracker_preparation__c, Business_Communications__c, Other__c, Other1__c, 
                                                  Other2__c, Project_Time__c, Other_Time__c, Project_Time_Description__c, 
                                                  Other_Time_Description__c, Shrinkage_time__c, Available_Time__c, 
                                                  Availability_Checking__c, id, Week__C from QAAM_Weekly_Planner__c];

test.startTest();
        init.Init();
        test.stopTest();

}

Error:
System.NullPointerException: Attempt to de-reference a null object
I have a Site User who accesses records through a VF page. I am encountering a strange problem where, Files uploaded in Lightning is visible but not the files those were uploaded in Classic.
When debugged, SOQL query is returning all in Execute Anonymous, but Debug Logs show only limited (uploaded in Lightning). Below is the code used for querying the files.
List<ContentDocumentLink> docList = [select ContentDocumentId, ContentDocument.title from ContentDocumentLink where LinkedEntityId =:recordId]; 
​system.debug('docList: ' + docList);
Any idea how to solve this? More importantly any idea why this is happening?
There is a record where Owner could "Recall approval process" before, I have removed "Modify All" permission on the profile which was assigned to that owner, now recall approval process button is not visible for him. Is there any way that the owner can recall approval process without "Modify All" permission?
trigger UpdateOwnerID on Case (after insert) {

 

List<Case> cases = new List<Case>();

map<Id,String> userIdbyAlias = new map<Id,String>();  //Keep in mind this will only store one user id per alias
    
    for(User u : [Select id,Name from user where IsActive = true AND Profile.Name = 'AH JP – Customer Request Agent'])
    {
            userIdbyAlias.put(u.Id,u.Name);
            system.debug('*** User names'+userIdbyAlias);
     }
  system.debug('**List of user from profile **'+userIdbyAlias);
   for (Case c : [Select Id, OwnerId, CreatedById From Case Where Id IN : Trigger.newMap.keySet()]) {

     for(User u :userIdbyAlias.keySet()){

     if(u.contains(c.OwnerId)) {

            c.OwnerId = userIdByAlias.get(u).Id;
            cases.add(c);
       }
  
     }
  }
   if(cases.size() > 0)
            update cases;
            system.debug('*** Final Output ***'+cases);
}
HI All,

can anyone let me know on how can we upload files from salesfore to sharepoint?
and if possble also let me know the steps for the same

Thanks 
This is super frustrating.  I have completed Challenge 8 successfully, but get this error

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: GQNDQNGL
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: KHXLXNMW



i have tried doing this in new org but same error occurs.Please help.
Getting Stuck with Following error while verifying Challenge 8 .Tried in multiple Trailhead Playgrounds and Developer Edition,But no Success.
Any known Isuues ?

User-added image

 
  • February 13, 2018
  • Like
  • 0
Is there way to get the details of report export? I need to know which user exported, with time stamp. I am guessing this can be done using Analytics API, but not finding any helpful article/notes or any related params in API Guide too.
Hi ,
I want to Generate  my current visualforce page  In Pdf Format when click on a  Custom Button which is on the same page  ,the class  consist a wrapper class which has a checkbox & values , I have created a pagerefernce Method but how to generate in Pdf.

<apex:page standardController="Account" extensions="SolutionParticipationCategoryController" sidebar="False" > 
<head>
<style type="text/css"> 
#rows{
        padding-left:250px;
        padding-Right:250px;
        
}
#cellAlign{
    vertical-align: top;
    border-collapse: collapse;
    border: 1px solid black;
}

 </style>
</head>
    <apex:form >
      <apex:sectionHeader title="Account" subtitle="Key Solutions Inventory "/>
            <apex:pageBlock >
                <apex:pageBlockbuttons >
                    <apex:commandButton value="Open Account" action="{!OpenAccount}"/>
                    <apex:commandButton value="Solution Participation " action="{!SolutionParticipation}" />
                    <apex:commandButton value="Card Program " action="{!cardProgram}" />
                    <apex:commandButton value="View Pdf"  action="{!ViewPDF}"/>
                </apex:pageBlockbuttons>
                                
            
                <table style="border-collapse: collapse;padding:50px;">
                    <tr>
                        <apex:repeat value="{!resultPickValuesMap}" var="M">
                            <td style="vertical-align: top;padding:30px;text-align:left;">
                               <b style="text-align:center;">{!M}</b><br/>
                               <apex:repeat value="{!resultPickValuesMap[M]}" var="temp">
                                   <table>
                                       <tr>
                                           <td style="padding-top:5px;">
                                               <apex:inputCheckbox value="{!temp.isSelected}" disabled="true"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                               <apex:commandLink id="theLink" action="{!solutionList}" target="_blank">
                                                   <apex:param assignTo="{!solName}" value="{!temp.value}" name="solName"/>
                                                   <apex:outputText value="{!temp.value}"/>
                                               </apex:commandLink>
                                            </td>
                                        </tr>
                                   </table>
                               </apex:repeat>
                            </td>
                         </apex:repeat>
                     </tr>
                </table>
            </apex:pageblock>         
    </apex:form>
</apex:page>

controller:-
/* *****
 Date:- 8/1/2018
 Description :- This Class is used to get the Multiselect Values from Account & displayed in New Vf Page on key solution Inventory button & checked 
                If altleast One Solution is Active so the Checkbox get checked. 
*/
public with sharing class SolutionParticipationCategoryController 
{
    public Id acctId{get;set;}
    public String solName{get;set;}
    public Set<String> CategorySelected{get;set;}   
    Public MAP<String,LIST<Account>> accsCategoryByType{get;set;} 
    public Map<String, List<PicklistWrapper>> resultPickValuesMap{get;set;}
    public Set<String> controllKeySet{get;set;}
    public List<PicklistWrapper> enterpriseCardSolutionsList;
    public List<PicklistWrapper> creditList;
    public List<PicklistWrapper> debitList;
    public List<PicklistWrapper> advisorsPlusList;
    Public List<Solution_Participation__c>sp;
    Public Integer count;
    Public Map<String,Integer> checkActMap;
    
    public SolutionParticipationCategoryController(ApexPages.StandardController stdController) 
    {
        acctId = ApexPages.currentPage().getParameters().get('id');
        System.debug('acctId-->'+acctId);
        CategorySelected = new Set<String>();
        resultPickValuesMap = getDependentOptionsImpl();
    }
    public Map<String,List<PicklistWrapper>> getDependentOptionsImpl()
    {
        String objApiName = 'Account';
        String contrfieldApiName = 'Picklist_Independent__c';
        String depfieldApiName = 'Solution_Participation_Category__c';
        String objectName = objApiName.toLowerCase();
        String controllingField = contrfieldApiName.toLowerCase();
        String dependentField = depfieldApiName.toLowerCase();
        
        
        checkActMap = new Map<String,Integer>();
        Map<String,List<PicklistWrapper>> objResults = new Map<String,List<PicklistWrapper>>();
            //get the string to sobject global map
        Map<String,Schema.SObjectType> objGlobalMap = Schema.getGlobalDescribe();
         
        if (!Schema.getGlobalDescribe().containsKey(objectName))
           {
            System.debug('OBJNAME NOT FOUND --.> ' + objectName);
            return null;
           }
        
        Schema.SObjectType objType = Schema.getGlobalDescribe().get(objectName);
        if (objType==null){
            return objResults;
        }
        Bitset bitSetObj = new Bitset();
        Map<String, Schema.SObjectField> objFieldMap = objType.getDescribe().fields.getMap();
        //Check if picklist values exist
        if (!objFieldMap.containsKey(controllingField) || !objFieldMap.containsKey(dependentField)){
            System.debug('FIELD NOT FOUND --.> ' + controllingField + ' OR ' + dependentField);
            return objResults;     
        }
        
        List<Schema.PicklistEntry> contrEntries = objFieldMap.get(controllingField).getDescribe().getPicklistValues();
        List<Schema.PicklistEntry> depEntries = objFieldMap.get(dependentField).getDescribe().getPicklistValues();
         objFieldMap = null;
        List<Integer> controllingIndexes = new List<Integer>();
        for(Integer contrIndex=0; contrIndex<contrEntries.size(); contrIndex++) {            
            Schema.PicklistEntry ctrlentry = contrEntries[contrIndex];
            String label = ctrlentry.getLabel();
            objResults.put(label,new List<PicklistWrapper>());
            controllingIndexes.add(contrIndex);
        }
        List<Schema.PicklistEntry> objEntries = new List<Schema.PicklistEntry>();
        List<PicklistEntryWrapper> objJsonEntries = new List<PicklistEntryWrapper>();
        for(Integer dependentIndex=0; dependentIndex<depEntries.size(); dependentIndex++){            
               Schema.PicklistEntry depentry = depEntries[dependentIndex];
               objEntries.add(depentry);
        } 
        objJsonEntries = (List<PicklistEntryWrapper>)JSON.deserialize(JSON.serialize(objEntries), List<PicklistEntryWrapper>.class);
        List<Integer> indexes;
        Account a = [SELECT Solution_Participation_Category__c,(SELECT Id,solution_name__c,Active__c FROM solution_participations__r) FROM Account WHERE Id =: acctId limit 1];
        List<Solution_Participation__c> mySol = a.solution_participations__r;
        Schema.DescribeFieldResult fieldResult = Account.Solution_Participation_Category__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for(PicklistEntryWrapper pew : objJsonEntries){
        count=0;
            for(Solution_Participation__c solp:mySol){
                if(solp.Active__c==true && solp.solution_name__c==String.valueof(pew.label)){
                    count++;
                    checkActMap.put(String.valueof(pew.label),count);
                }
            }
        }
        if(a.Solution_Participation_Category__c != null )
        {
          
           CategorySelected.addAll(a.Solution_Participation_Category__c.split(';'));
           
        }
       
        //Schema.DescribeFieldResult fieldResult = Account.Solution_Participation_Category__c.getDescribe();
        //List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        
       
        for (PicklistEntryWrapper objJson : objJsonEntries){
            if (objJson.validFor==null || objJson.validFor==''){
                continue;
            }
               indexes = bitSetObj.testBits(objJson.validFor,controllingIndexes);
            sp= [select Id,Active__c, Account__r.Solution_Participation_Category__c From Solution_Participation__c where Account__c =: acctId limit 1];  
            for (Integer idx : indexes)
              {                
                String contrLabel = contrEntries[idx].getLabel();
                
                if(CategorySelected.contains(String.valueof(objJson.label))&&checkActMap.get(String.valueof(objJson.label))>0)
                {
                  
                  
                    objResults.get(contrLabel).add(new PicklistWrapper(objJson.label,true));
                }
                else
                {
                    objResults.get(contrLabel).add(new PicklistWrapper(objJson.label,false));
                }
            }
        }
        objEntries = null;
        objJsonEntries = null;
        system.debug('objResults--->' + objResults);
        return objResults;
    }
    public class PicklistWrapper 
        {
        public String value {get;set;}
        public Boolean isSelected {get;set;}
        
        public PicklistWrapper(String value, Boolean isSelected) 
                {
            this.value = value;
            this.isSelected = isSelected;
        }
    }
    public PageReference solutionList()
    {
        System.debug('SolName-->'+solName);  
        PageReference solutionList = new Pagereference('/apex/SolutionList');
        solutionList.getParameters().put('Id', acctId);
        solutionList.getParameters().put('solName', solName);
        
        solutionList.setRedirect(true);
        
        return solutionList;      
    }
    
  
    public PageReference OpenAccount() 
    {
        Pagereference acc = new Pagereference('/'+acctId);
        acc.setRedirect(true);
        return acc;
    }
    
    Public PageReference SolutionParticipation()
    {
    id ReportId = [Select id from Report where name = 'Solution Participants'].id;
        
    Pagereference sp= new Pagereference('/'+ReportId);
     sp.setRedirect(true);
     return sp;
    
    }
    
    Public PageReference CardProgram()
    {
    id ReportId1 = [Select id from Report where name = 'Card Programs'].id;
    Pagereference cp= new Pagereference('/'+ReportId1);
    cp.setRedirect(true);
    return cp;
    
    }
    
  /*  Public PageReference ViewPDF(){
    pageReference vpdf = page.solutionparticipationPDF;
    vpdf.setRedirect(true);
    return vpdf;
    }*/

}
Hello dear community, I was wondering how exactly to delete an apex class because obviously you can't do that in the production area, I already tried deleting it from my sandbox which worked but it didnt have any impact on my actual production area.
Thanks in advance
This failed for me with the error

The Fulfillment Creation process does not appear to be working properly. Check your action that updates the Adventure Package.

On review of the trailhead information (9/9/2016), there was no listed requirement to update the Adventure package. I suspect there was in the past and this had been lost in an update. 

I got around the error by updating: 
[OpportunityLineItem]
Fulfillment Created = True
Fulfillment State = Created

The requirements should be complete if you don't want to generate frustration within the trailhead audience.



 
My code was this its an emailtemplate. I want to display and convert currency to usd by displaying $. Amount displaying their were correct but i want to display currency symbols in the below code.

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Opportunity"
    subject="Productline Items for Opportunity: {!relatedTo.name}"
    replyTo="support@acme.com" >
   
<messaging:htmlEmailBody >       
    <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
               TD  {font-size: 11px; font-face: verdana }
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="2">
        <p>Dear {!recipient.name},</p>
        <p>Below is a list of products related to the Opportunity:<b> {!relatedTo.name}</b>.</p>
        <br/>Account: <i> {!relatedTo.Account.name}  </i> 
        <br/>Opportunity Owner: {!relatedTo.owner.name}
        <br/>Opportunity Amount: {!relatedTo.Amount}
        <br/>Opportunity Close Date: {!relatedTo.CloseDate} 
  
        <p/>                 
       <table border="0" >
                 <tr >
                     <th>Action</th><th>Product Name</th><th>Product Family</th><th>Quantity</th><th>Unit Price</th><th>Total Price</th>
                  </tr>
    <apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
       <tr>
           <td><a href="https://na1-blitz01.soma.salesforce.com/{!opp.id}">View</a> | 
           <a href="https://na1-blitz01.soma.salesforce.com/{!opp.id}/e">Edit</a></td>
           <td>{!opp.PriceBookEntry.name}</td>
           <td>{!opp.Product_Family__c}</td>
           <td>{!(opp.Quantity)}</td>
           <td>{!(opp.UnitPrice)}</td>
           <td>{!(opp.TotalPrice)}</td>
       </tr>
    </apex:repeat>                
       </table>
       <p />
</font>
      
        </body>
    </html>
</messaging:htmlEmailBody>
   
<messaging:plainTextEmailBody >
Dear {!recipient.name},

Below is a list of products related to the Opportunity: {!relatedTo.name}

Account: {!relatedTo.Account.name}
Opportunity Owner: {!relatedTo.owner.name}
Opportunity Amount: {!(relatedTo.Amount)}
Opportunity Close Date: {!relatedTo.CloseDate} 


[ Product Name ] - [ Product Family ] - [ Quantity ] - [ Units ] - [ Total Price ]
-------------------------------------------------------------------------

<apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
[ {!opp.PriceBookEntry.name} ] - [ {!opp.Product_Family__c} ] - [ {!ROUND(opp.Quantity,0)} ] - [ {!(opp.UnitPrice)} ] - [ {!(opp.TotalPrice)} ]
</apex:repeat>

</messaging:plainTextEmailBody>      
       
       
<messaging:attachment renderas="pdf" filename="Opportunity_Products.pdf">

<img src="http://www.salesforce.com/common/assets/css/images/hdr_apexdn.gif" border="0"></img>

        <p>Dear {!recipient.name},</p>
        <p>Below is a list of products related to the Opportunity:<b> {!relatedTo.name}</b>.</p>
        <br/>Account: <i> {!relatedTo.Account.name}  </i> 
        <br/>Opportunity Owner: {!relatedTo.owner.name}
        <br/>Opportunity Amount: {!(relatedTo.Amount)}
        <br/>Opportunity Close Date: {!relatedTo.CloseDate} 
  
        <p/>  
       


    <apex:datatable border="2" cellspacing="5" var="opp2" value="{!relatedTo.OpportunityLineItems}">
        <apex:facet name="header">Products associated with Opportunity {!relatedTo.name}</apex:facet>
       
          <apex:column value="{!opp2.PriceBookEntry.name}" headerValue="Product Name"/>
          <apex:column value="{!opp2.Product_Family__c}" headerValue="Product Family"/>
        <apex:column value="{!opp2.Quantity}" headerValue="Quantity" />
        <apex:column value="{!opp2.UnitPrice}" headerValue="Units" />
        <apex:column value="{!opp2.TotalPrice}" headerValue="Total Price" />
 
      </apex:datatable>


</messaging:attachment>      
       
</messaging:emailTemplate>

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.