+ Start a Discussion
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

Naren9Naren9 
Hi All,
In Salesforce Lightning, do we have any option to remove/disable the Drilldown/View report hyper link on Dashboard?.

Thanks,
Naren
Best Answer chosen by Naren9
NagendraNagendra (Salesforce Developers) 
Hi Naren,

Sorry for this issue you are facing.

Unfortunately, this is not possible as of now. There is an idea which is active on the success community for which you can upvote so that it can be available in the mere future.

You can find the idea at the below link. Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
MedhanieHabteMedhanieHabte 
I seem to be stuck on this trailhead module or write negative tests unit, while I have 93 percent code coverage, I can't seem to get the code coverage to hit 100 percent at the "returnValue" piece doesn't seem to hit.
My code is as follows.

Calculator Class
 
public class Calculator {
 public class CalculatorException extends Exception{}

  public static Integer addition(Integer a, Integer b){
   return a + b;
    }

   public static Integer subtraction(Integer a, Integer b){
    return a - b;
    }

 public static Integer multiply(Integer a, Integer b){
  if(b==0 || a==0){
  throw new CalculatorException('It doesn\'t make sense to multiply by 
   zero');
  }
  return a * b;
  }

 public static Decimal divide(Integer numerator, Integer denominator){
  if(denominator == 0){
  throw new CalculatorException('you still can\'t divide by zero');
   }
 Decimal returnValue = numerator / denominator;
  if(returnValue < 0){
    throw new CalculatorException('Division returned a negative value.' + 
 returnValue);
 }
   return returnValue;
  }


 }

And my test class as follows
 
@isTest
   public class Calculator_Tests {

@isTest
 public static void addition() {
    Calculator.addition(1, 0);
   }
@isTest
  public static void subtraction() {
    Calculator.subtraction(1, 0);
   }

@isTest
 public static void divide_throws_exception_for_division_by_zero() {
 Boolean caught = false;
 try {
    Calculator.divide(1, 0);
  } catch (Calculator.CalculatorException e) {
    System.assertEquals('you still can\'t divide by zero', e.getMessage(), 
  'caught the right exception');
    caught = true;
   }
   System.assert(caught, 'threw expected exception');
   }

  @isTest
 public static void divide_throws_exception_for_division_by_two() {
 Boolean caught = true;
 try {
    Calculator.divide(1, 2);
 } catch (Calculator.CalculatorException e) {
    System.assertEquals('you still can\'t divide by zero', e.getMessage(), 
  'caught the right exception');
    caught = true;
   }
   System.assert(caught, 'threw expected exception');
 }


@isTest
public static void multiply_by_one() {
  Boolean caught = false;
  try {
    Calculator.multiply(1, 0);
    } catch (Calculator.CalculatorException e) {
    System.assertEquals('It doesn\'t make sense to multiply by zero', 
    e.getMessage(), 'caught the right exception');
     caught = true;
    }
    System.assert(caught, 'threw expected exception');
  }

@isTest
 public static void multiply_by_two() {
  Boolean caught = true;
  try {
     Calculator.multiply(1, 2);
   } catch (Calculator.CalculatorException e) {
    System.assertEquals('It doesn\'t make sense to multiply by zero', 
  e.getMessage(), 'caught the right exception');
    caught = true;
   }
   System.assert(caught, 'threw expected exception');
}   
}

 
Best Answer chosen by MedhanieHabte
Abdul KhatriAbdul Khatri
How come a division returned a negative value with positive numbers? I don't think that is the right Scenario. 

Infact you can change that not accepting the negative value like this 
 
public static Decimal divide(Integer numerator, Integer denominator){
        if(denominator == 0){
            throw new CalculatorException('you still can\'t divide by zero');
        }
        if(numerator < 0 || denominator < 0)
        	throw new CalculatorException('negative value(s) not allowed.');
        
        Decimal returnValue = numerator / denominator;

        return returnValue;
    }

and add another test method
@isTest
    public static void divide_throws_exception_for_negative_number() {
        Boolean caught = true;
        try {
            Calculator.divide(-1, 2);
        } catch (Calculator.CalculatorException e) {
            System.assertEquals('negative value(s) not allowed.',e.getMessage());
            caught = true;
        }
        System.assert(caught, 'threw expected exception');
    }

I hope this will help.​
Best Answer chosen by abhishek satpute
AbhishekAbhishek (Salesforce Developers) 
May I request you please check the Salesforce documentation on  "SOQL Relationship Queries" check the below link?

https://developer.salesforce.com/blogs/developer-relations/2013/05/basic-soql-relationship-queries.html   (https://developer.salesforce.com/blogs/developer-relations/2013/05/basic-soql-relationship-queries.html  )


Basic Examples of SOQL RELATIONSHIPS:
Child > Parent (Standard Object)


Selectid,Account.Name,Account.Phone,Account.industry,Account.Type,Account.Rating,Account.website,Account.Ownership,Account.AnnualRevenue,Account.NumberOfEmployees,Account.CleanStatus from Contact
Child >Parent(Custom Object)


Selectid,COLLEGE__r.Name,COLLEGE__r.Contact__c,COLLEGE__r.Count__c,COLLEGE__r.Highest_Marks__c,COLLEGE__r.Address__cfrom Studnt__c

Parent >Child(Standard object)
select Name, Industry, (select AssistantName, Email from contacts)from ACCOUNT


Parent >Child (Custom Object)
1select id,Name,(select Studnt__c.name__c from Studnts__r) from College__C


For further reference check this,

https://developer.salesforce.com/forums/?id=906F00000009BgeIAE


If it helps you and closes your query by marking it as solved so that it can help others in the future.

Thanks.
Ryan Mastbergen 4Ryan Mastbergen 4 

Hello,

I am stuck on a validation rule -

If Sub Category is either 'Attestation Form Complete' or 'Attestation Form Incomeplete', all the other fields listed must not be blank.

The current formula will not let me create the record even if all the fields listed are completed.  Any suggestions would be helpful.
 

Thanks!
User-added image

Best Answer chosen by Ryan Mastbergen 4
Maharajan CMaharajan C
Hi Ryan,

There is a problem in your formula:

Please try the below one:
 
AND(OR(
ISPICKVAL(Sub_Category__c,"Attestation Form Complete"),
ISPICKVAL(Sub_Category__c,"Attestation Form InComplete")
),
OR(
ISPICKVAL(Creditable_Coverage__c,""),
ISBLANK(Start_Date__c),
ISBLANK(End_Date__c),
ISPICKVAL(Type_of_Coverage__c,""),
ISPICKVAL(Relationship_to_Member__c,""),
ISPICKVAL(Verbal_Permission_Obtained__c,"")
))

Thanks,
Maharajan.C
sai manojsai manoj 
i need guidance regarding DataLoader any one please suggest to complete Challenge 8
 
Best Answer chosen by sai manoj
LinThawLinThaw
Hi sai, please try with salesforce default dataloader.
User-added image
and please refer my csv files.
User-added image
Regards,
LinThaw
Akash jena 3Akash jena 3 
i have 3 fields 
field 1- mr
field 2- bean
in the field 3 i have to show 'mr bean '
basically i have to show the 2 fields value in the 3rd field
Best Answer chosen by Akash jena 3
CharuDuttCharuDutt
Hii Akash 
it can be done with formula field 
field 3 will be Data TypeFormula type text
Data TypeFormula  


field1__c + '' + field_2__c
Amine ElkhaAmine Elkha 
Hi all, 

I am on Create Object-Specific Quick Actions unit on Trailhead and somehow when I get to Test the Action in the Salesforce Mobile App, nothing happens on the app. I cannot see the Properties Custom Object even in the navigation menu. I have been following all the steps exactly as they appear on each task, one by one and I also passed the challenge. So, clearly I am doing the right thing, but it bugs me that I cannot see the results on the Mobile App.

I have tried everything and looked everywhere but it seems that my Salesforce App is not connected to Trailhead or something! I apologise in advance if I am not making any sense as I am new to Salesforce. 

I would really appreciate it if anyone have been through the same issue and found a solution or workaround. 

Many Thanks.
A
Best Answer chosen by Amine Elkha
SwethaSwetha (Salesforce Developers) 
HI ,
We have a separate Trailhead team who can help you with these issues. So, can you please use the below link to reach out to them so that one of the Engineers will get in touch with you.
Support: https://trailhead.salesforce.com/en/help?support=home

Please mark this answer as best if it helps so that others facing same issue will find it useful.Thanks
Best Answer chosen by Srinivas Testing
Glyn Anderson 3Glyn Anderson 3
There no built-in way to know which loop iteration you're on.  You have to keep track of it yourself.  Something like the code below:

<pre>
Integer loopCount = 0;
for ( Object obj : listOfObjects )
{
    // do stuff here...
    loopCount++;
}
</pre>
Best Answer chosen by apoorva pandey
Purushotham YellankiPurushotham Yellanki
Hi Apoorva,

Try below Code in you Dev Console and see if this is what you are looking for. Basically reverse triangle logic is same in almost all OOP languages, it doesn't matter if it is Java or Apex all we are going to use is for loops!

String revTriangle = '';
Integer x = 1;
Integer y = 1;
for (x = 1; x <= 10; x++)
{
for (y = x; y <= 10; y++)
{
if (y<=x)
revTriangle +='*';
else
revTriangle+='*';
}
revTriangle+='\n';
}   

System.debug('ReverserTriangle: \n' + revTriangle);




Thank you