-
ChatterFeed
-
81Best Answers
-
6Likes Received
-
3Likes Given
-
62Questions
-
873Replies
Need help with Error: Syntax error. Missing
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
- Jamie Arias
- January 03, 2018
- Like
- 0
- Continue reading or reply
how to migrate case support settings in service cloud?
How to migrate case support settings in service cloud? can we migrate using change set or force.com IDE or Packages?
Regards
Ramakrishna
- Ramssf70
- July 10, 2017
- Like
- 0
- Continue reading or reply
Validation Rule on Saving a Call for particular address combination
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!
- F Smoak
- September 23, 2016
- Like
- 0
- Continue reading or reply
Packaged Reports Not Working - Standard Fields Missing
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)...
On an individual report level, I use Joined Reports and the "assigned" field as the cross-block grouping field...
However, once I have installed the package in another SFDC account (which is essentially a mirror of our main account), the dashboard is blank...
... and my reports are now MISSING the "assigned" grouping field...
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...
But it's straight-up NOT working.
PLEASE help :-)
- Robert Haines
- May 26, 2016
- Like
- 0
- Continue reading or reply
VALIDATION RULE#1
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
- udayarangareddy mekala
- September 30, 2015
- Like
- 0
- Continue reading or reply
Reports | "Related to" filter in Event | 404
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
- Ab
- September 29, 2015
- Like
- 0
- Continue reading or reply
Dashboard data sharing is not complying with reports
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
- Ab
- September 25, 2015
- Like
- 0
- Continue reading or reply
How to send Report via E-Mail every month
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
- Tobias Gareis
- April 03, 2015
- Like
- 0
- Continue reading or reply
text field not equal to the same value in workflow
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.)
- Tommy Georgiou
- April 03, 2015
- Like
- 0
- Continue reading or reply
Finding Account ID if External ID Contains Value
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; } } }
- cambart14
- March 22, 2015
- Like
- 0
- Continue reading or reply
Send mass Email using Visualforce Email Template
How to send "Mass Email" using Visualforce Email Template. The Template wil have images, Screenshots and attachments.
- ahammad sk
- March 21, 2015
- Like
- 0
- Continue reading or reply
Email Attachment Sizes
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?
- Terence Viban
- March 21, 2015
- Like
- 2
- Continue reading or reply
How to Calculate Age in Day?
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?
- Dutta Sourav
- March 10, 2015
- Like
- 0
- Continue reading or reply
Import Leads through import Wizard
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,
- Pritam Shekhawat
- February 23, 2015
- Like
- 0
- Continue reading or reply
I need help with Apex Code
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
- B&D Developer
- February 23, 2015
- Like
- 0
- Continue reading or reply
Create opportunity with line items from order
Plese help.I am having all ready except copying lineitems.
thanks in advance...
- Linda 98
- February 16, 2015
- Like
- 0
- Continue reading or reply
Need to provide access to external users to uploaded documents in salesforce without prompting for login
Now the requirement is that this url should be accessible to external users without prompting for login.
Can anybody please help.
Thanks in advance.
- ANWESA PRAMANIK
- February 16, 2015
- Like
- 0
- Continue reading or reply
- neha pandey 25
- February 13, 2015
- Like
- 0
- Continue reading or reply
Trigger For Account Owner Update !
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 ..........
- Tecnova Admin
- February 13, 2015
- Like
- 0
- Continue reading or reply
Getting only 66% code coverage. what is wrong in my Test code.??
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 :)
- Yogesh Dighe.
- February 12, 2015
- Like
- 0
- Continue reading or reply
Querying Files in Apex, Classic vs Lightning
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?
- goabhigo
- April 25, 2018
- Like
- 0
- Continue reading or reply
Export report details
- goabhigo
- January 23, 2018
- Like
- 0
- Continue reading or reply
What design patterns do you use/suggest?
It will be great if you folks can share your thoughts.
--
Abhilash.
- goabhigo
- February 15, 2017
- Like
- 0
- Continue reading or reply
Clickjack in Salesforce Console
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.
- goabhigo
- November 28, 2016
- Like
- 1
- Continue reading or reply
Email to User and Manager when Manager is changed
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.
- goabhigo
- August 30, 2016
- Like
- 1
- Continue reading or reply
Opening report in new tab/window in Analytics reportChart
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.
- goabhigo
- August 24, 2016
- Like
- 1
- Continue reading or reply
Superbadge - Create contact and hobby reports
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?
- goabhigo
- June 12, 2016
- Like
- 2
- Continue reading or reply
Using new DE still getting 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
- goabhigo
- June 09, 2016
- Like
- 0
- Continue reading or reply
Chat persistence in Live Agent
I have gone through the Live Agent Dev Guide and did not find any answer to the same.
- goabhigo
- March 02, 2016
- Like
- 0
- Continue reading or reply
Best practices for same Account, different departments/teams
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.
- goabhigo
- July 09, 2015
- Like
- 0
- Continue reading or reply
Error in challenge - Automating Processes with the Lightning Process Builder
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.: []
- goabhigo
- February 24, 2015
- Like
- 0
- Continue reading or reply
Data Import Wizard not working
I recently was checking the enhancements in Data Import Wizard and found that its not working. Following is the error message I am getting:
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:
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.
- goabhigo
- January 27, 2015
- Like
- 0
- Continue reading or reply
Creating roles when there are multiple people with same role but different locations
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.
- goabhigo
- April 23, 2014
- Like
- 0
- Continue reading or reply
Deleting records from Staging object
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?
- goabhigo
- October 18, 2013
- Like
- 0
- Continue reading or reply
Some clarifications needed on Test classes
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().
- goabhigo
- June 08, 2013
- Like
- 0
- Continue reading or reply
No formatting option available
- goabhigo
- December 31, 2013
- Like
- 0
- Continue reading or reply
Test class for Flow
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.
- goabhigo
- August 17, 2012
- Like
- 0
- Continue reading or reply
List of Opportunities in Flow, one-by-one
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.
- goabhigo
- August 08, 2012
- Like
- 0
- Continue reading or reply
DUPLICATE_VALUE, duplicate value found
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.
- goabhigo
- May 25, 2012
- Like
- 0
- Continue reading or reply
System Administrator Profile doesn't have all permissions
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...
- goabhigo
- May 09, 2012
- Like
- 0
- Continue reading or reply
Clickjack in Salesforce Console
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.
- goabhigo
- November 28, 2016
- Like
- 1
- Continue reading or reply
Email to User and Manager when Manager is changed
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.
- goabhigo
- August 30, 2016
- Like
- 1
- Continue reading or reply
Opening report in new tab/window in Analytics reportChart
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.
- goabhigo
- August 24, 2016
- Like
- 1
- Continue reading or reply
Superbadge - Create contact and hobby reports
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?
- goabhigo
- June 12, 2016
- Like
- 2
- Continue reading or reply
Issue with field update through time based WFR
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.
- goabhigo
- January 28, 2012
- Like
- 1
- Continue reading or reply
Attempt to de-reference a null object in Test Class
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
- karthic sankar 9
- October 01, 2020
- Like
- 0
- Continue reading or reply
Querying Files in Apex, Classic vs Lightning
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?
- goabhigo
- April 25, 2018
- Like
- 0
- Continue reading or reply
Recall Approval Process
- Sowndarya Kesari
- March 22, 2018
- Like
- 0
- Continue reading or reply
HI Basically i am changing the owner ship from one user to other user using trigger,i am getting error Error: Compile Error: Method does not exist or incorrect signature: void contains(Id) from the type User at line 21 column 11
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);
}
- Gireesh A 7
- February 16, 2018
- Like
- 0
- Continue reading or reply
How can we upload files from salesforce to sharepoint
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
- Soumyodeep Guha 8
- February 16, 2018
- Like
- 0
- Continue reading or reply
Lightning Rollout Specialist Superbadge
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
- Elizabeth Gardner
- February 13, 2018
- Like
- 0
- Continue reading or reply
I am getting this error while solving challenge 8 in lightning experience rollout superbadge
i have tried doing this in new org but same error occurs.Please help.
- Gaurang dadheech
- February 13, 2018
- Like
- 0
- Continue reading or reply
Rollout Specialist Superbadge - Challenge 8
Any known Isuues ?
- AshJ
- February 13, 2018
- Like
- 0
- Continue reading or reply
Export report details
- goabhigo
- January 23, 2018
- Like
- 0
- Continue reading or reply
i want to generate my visualforce page in Pfd Format
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"/>
<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;
}*/
}
- subodh chaturvedi 17
- January 09, 2018
- Like
- 0
- Continue reading or reply
How to delete an apex class
Thanks in advance
- Bernd Nawrath
- January 27, 2015
- Like
- 0
- Continue reading or reply
LEX Superbadge - Challenge 4 ( Automate the creation of fulfillments)
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.
- Martin Cadman 2016
- September 09, 2016
- Like
- 6
- Continue reading or reply
how to convert currency field and to display with $ in visualforce
<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>
- SFDCTech1
- February 03, 2014
- Like
- 1
- Continue reading or reply
Announcing New Salesforce Developers Discussion Forums
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.
- Lauren Grau
- December 22, 2013
- Like
- 58
- Continue reading or reply