+ Start a Discussion
Joanne Thomas 12Joanne Thomas 12 
Unable to set up free developer org.  Set up process misses out the password step and resetting the password takes me back eventually to the reset window saying the reset link has expired or has been used already.
Best Answer chosen by Joanne Thomas 12
Maharajan CMaharajan C
I have done the reset but you can only recieve the email and proceed further. Otherwise can we connect so that i will create a dev org for you.
My Email : maharajansfdc@gmail.com

 
Chamil MadusankaChamil Madusanka 

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

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

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.

rima khanrima khan 
Hi!
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!
Best Answer chosen by rima khan
manasa udupimanasa udupi
Hi Rima,

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
María Jesús CarmonaMaría Jesús Carmona 
Hi,
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.
Best Answer chosen by María Jesús Carmona
María Jesús CarmonaMaría Jesús Carmona
Solved itself, I think Salesforce put back the "Show all Opportunities" filter.
Lam Ha TuanLam Ha Tuan 
I want to add custom field: StartDate to Task (Salesforce Standard object) but the salesforce does not allow that. Is there any solutions for this problem? 
Best Answer chosen by Lam Ha Tuan
SwethaSwetha (Salesforce Developers) 
HI Lam Ha Tuan,

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
phil.vaseyphil.vasey 

Hi

 

I'm new to this so please forgive my ignorance.

 

I'm getting the exception when:

 

  1. insert an Opportunity
  2. insert a ContentVersion
  3. post the new ContentVersion to the Opportunity's chatter feed
  4. 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 ;
}

Best Answer chosen by Admin (Salesforce Developers) 
Jia HuJia Hu
Before ' delete opp ;' add
delete post;

Then your code will work.
svidyansvidyan 

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

Best Answer chosen by Admin (Salesforce Developers) 
b-Forceb-Force

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

Rahul Garg SFDRahul Garg SFD 
An Apex transaction insert 100 Account records and 2000 Contact records  before encountering a DML exception when attempting to insert 500 Opportunity records. The Account record are inserted by calling the database.insert() method with the allOrNone argument set to false. The Contact and Opportunity record are inserted using the stand-alone insert statement.
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.
Best Answer chosen by Rahul Garg SFD
Rahul Garg SFDRahul Garg SFD
Answer of this Question is D.

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

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..
Best Answer chosen by Benjamin Faltus
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Benjamin,

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,
Emma BindiEmma Bindi 
When parsing WSDL file into Apex we needed to change the header item (user/password) into complex type for Salesforce to accept it. 

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? 
Best Answer chosen by Emma Bindi
Emma BindiEmma Bindi
So! Resolution:
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