You need to sign in to do that
Don't have an account?

Unable to set up free developer org.
Formula field for calculate age by using DOB
HI All,
How to create a fomula field for my age field ? It will be calculated by using the Date_of_Birth__c field. I have a fomula.
IF(MONTH(TODAY())>MONTH(DOB_API),YEAR(TODAY())-YEAR(DOB_API),IF(AND(MONTH(TODAY())=MONTH(DOB_API),DAY(TODAY())>=DAY(DOB_API)),YEAR(TODAY())-YEAR(DOB_API),(YEAR(TODAY())-YEAR(DOB_API))-1))
That's from Ankit's blog. But I don't know how to use it and where to use it.
Thanks in Advance


Yes thats a correct formula , you can use above
If you want to go for smaller formula
Use this one : From http://forceschool.blogspot.com/2011/06/age-calculation-formula.html
IF(ISNULL(DOB__c) , DOB__c , FLOOR((TODAY()-DOB__c +1)/365.2425))
Now to your question how to use it.
1) Create a formula field return type Integer
2) Use any of the formula , replace your date field API Name with DOB__c
Then you will see this Calculated Age in your formula field.

Trailhead Recommendations?
I registered with trailhead.
I’m an SDR looking to expand my Salesforce skill set. Let’s pretend I have none. Particularly looking for the basics around reporting, and any other trails that may be beneficial to spend some time with.
My goal is to have a competent understanding of SF to build my sales as I enter a closing role and the relevant tools in SF that will help me gain an advantage.
Thanks in advance!

Below are few trailhead links, hope it helps:)
https://trailhead.salesforce.com/en/content/learn/modules/sales_admin_sales_reports_for_lex
https://trailhead.salesforce.com/en/content/learn/modules/sales-activity-analysis

Remove role filter on reports
We had our report filtered by "all" (i.e. "all oportunities"), now it appear as "all oportunities under role: X".
I think that this is a change from the latest release, but we need to be able to filter by just "all" like we had before.
Is there some way to achieve that without creating more roles?
Thanks.


How to add custom field into Task (Salesforce standard object)?



In Salesforce, you cannot directly add custom fields to standard objects like the Task object.
As mentioned in https://help.salesforce.com/s/articleView?id=000387017&type=1 Since Events and Tasks are both part of the Activities object, you will need to create your custom fields at the Activities level. To differentiate between Task and Event custom fields, select the appropriate page layouts on step 4 of 4 during the field creation process. The field can be added to both Tasks and Events, or just one of the objects.
If this information helps, please mark the answer as best. Thank you

Exception: duplicate value found: <unknown> duplicates value on record with id: <unknown>: []
Hi
I'm new to this so please forgive my ignorance.
I'm getting the exception when:
- insert an Opportunity
- insert a ContentVersion
- post the new ContentVersion to the Opportunity's chatter feed
- delete the Opportunity
Does anybody know why, and if so, how to overcome the exception?
I am using API version 26.0
Thanking you in advance
private static void TestOpportunityDeletion()
{
// create an opportunity
Opportunity opp = new Opportunity() ;
opp.Name = 'Test Name' ;
opp.StageName = 'Test Stage Name' ;
opp.CloseDate = Date.Today() ;
insert opp ;
// attach a document to its chatter feed
ContentVersion doc = new ContentVersion() ;
doc.Title = 'Test Version' ;
doc.PathOnClient = 'test version.docx' ;
doc.VersionData = Blob.ValueOf( 'test content' ) ;
doc.Origin = 'H' ;
insert doc ;
FeedItem post = new FeedItem() ;
post.Type = 'ContentPost' ;
post.ParentID = opp.Id ;
post.RelatedRecordID = doc.id ;
insert post ;
// delete the opportunity
delete opp ;
}



How to add Custom Objects to an App after creation of the objects?
Hi,
I am following the book "Developement with the Force.com platform" by JasonOuelette.
When creating the Custom Objects, I did not check the box to be visible in a tab, and so I could not add this object to the Custom App I was creating. Now I have a created fields and relationships in the custom object. How do I add this Object to the Custom App?
thanks
Svidya



It looks you havent create custom Tabs while defining custom objects first you need to create custom Tab for new objects Creating Tab Setup -->App Set up---> Create---> Tabs Click on new Tab [drop down shows all untabed objects ] select your object, set Tab style , click Next select profiles Save Adding To App Setup -->App Set up---> Create---> Apps Click on edit, edit available tab section Save Done Thanks, Bala

What happen when we get error in insert DML , which is used after database.insert()
How many total records will be committed to the database in this transaction?
A. 100
B. 2,100
C. 2,000
D. 0
Considering the salesforce documentation of Database.insert() when allOrNone is false, the answer should be A i.e 100. But, when I checked this on Anonymous window in developer console I get answer as D i.e 0.
Please help me with this solution.


All insertions took place in one transaction and the transaction fails, so all records are rolledback even the one inserted form Database.insert().

Service Console navigation bar customizing
i have a problem with the navigation bar in the service console. Why is this so different from the sales navigation bar?
I can not add some special tabs. I want to have the Tabs for Cases and for tasks in parallel on the navigation bar. As is see i can only have one "main" Tab where i can switch between them, but i can not have 2 tabs with "cases" and "tasks". is this right?
And when i add some new tabs like different cases they become very small and there is not text anymore. How can i change this behaviour? This is impractical..




Coming to Point 1 we may not be able to add two tabs like what you highlited.
Coming to the second request that when we pin the tab you are not able to see the label. This is known behaviour were an idea is open for the same . You can upvote this so salesforce may consider this in future releases.
https://ideas.salesforce.com/s/idea/a0B8W00000GdbLTUAZ/pin-tab-in-sales-console-should-keep-the-title-displayed
If this solution helps, please mark it as best answer.
Thanks,

SOAP header requires a String however Apex class is a complex type
Now unfortunately, the Apex class is sending the complex type information whereas the external system is expecting a string only.
Ie, External System format requires:
<soapenv:Header> <web:SessionType>none</web:SessionType> <web:PasswordText>topsecret</web:PasswordText> <web:UsernameToken>BROKER</web:UsernameToken> </soapenv:Header>However Salesforce is sending:
<env:Header> <PasswordText xmlns="http://siebel.com/webservices"> <inputParam>topsecret</inputParam> </PasswordText> <SessionType xmlns="http://siebel.com/webservices"> <inputParam>none</inputParam> </SessionType> <UsernameToken xmlns="http://siebel.com/webservices"> <inputParam>BROKER</inputParam> </UsernameToken> </env:Header>
This is what WSDL2Apex generated:
//Generated by wsdl2apex public class AFGFlexWebservices { public class SessionType_element { public String inputParam; private String[] inputParam_type_info = new String[]{'inputParam','http://siebel.com/webservices',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://siebel.com/webservices','true','false'}; private String[] field_order_type_info = new String[]{'inputParam'}; } public class PasswordText_element { public String inputParam; private String[] inputParam_type_info = new String[]{'inputParam','http://siebel.com/webservices',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://siebel.com/webservices','true','false'}; private String[] field_order_type_info = new String[]{'inputParam'}; } public class UsernameToken_element { public String inputParam; private String[] inputParam_type_info = new String[]{'inputParam','http://siebel.com/webservices',null,'1','1','false'}; private String[] apex_schema_type_info = new String[]{'http://siebel.com/webservices','true','false'}; private String[] field_order_type_info = new String[]{'inputParam'}; } }
Does anyone have any ideas how I can instead send through just a string for each header item rather than all the extra details?


For those who encounter same issue, we went with the Plan B using a REST post callout with manually created XML request body to resolve this. (only had a couple fields to send/receive from external system)
Tips, SOAPaction was required in the headers along with text/xml content type. Then parsed response with Document & XML classes
My Email : maharajansfdc@gmail.com