• Michael Cerullo
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Are there any advantages to using the Force.com Migration Tool instead of just using the Deploy/Retrieve options in Workbench? Thanks in advance for your help.
I want to make sure a SOQL is not empty before I start working with it.  Is there a way to perform the below code without using 2 SOQL statements?  Thanks in advance for your help!

Account[] alist = new Account[]{};

if(![SELECT Id FROM Account WHERE LastModifiedDate = TODAY].isEmpty()){
     alist = [SELECT Id FROM Account WHERE LastModifiedDate = TODAY];
     for(Account a : alist){
          //do some code...
     }
}
 
I'm inserting an Account, followed by an Opportunity.  Then, I run a SOQL to make sure the name field on Account is not null.  However, it keeps showing as null.  I know I can do a SOQL directly on Account, but this is just a simplified question for the real issue I'm trying to solve.  Does anyone know why this is showing as null?  Thanks in advance for your help!

Account a = new Account();
        a.Name = 'Universal Containers';
        a.BillingStreet = 'Market';
        a.ShippingStreet = '1 Market';
        a.BillingCity = 'San Francisco';
        a.ShippingCity = 'San francisco';
        a.BillingPostalCode = '94105';
        a.ShippingPostalCode = '94105';
        a.BillingState = 'California';
        a.ShippingState = 'California';
        a.BillingCountry = 'United States';
        a.ShippingCountry = 'United States';
insert a;

Opportunity o = new Opportunity();
       o.Name = 'Universal Containers';
       o.Account = a;
        o.CloseDate = Date.today();
        o.StageName = 'Submitted';
        insert o;
        
Opportunity o = [SELECT Id, Account.Name FROM Opportunity WHERE Id = :o.Id LIMIT 1];
System.Assert(o.Account.Name != null);
//This assert always fails even tough I know the Account and Opportunity were successfully inserted and the the Account.Name field is populated.
I am facing an issue while configuring SSO. I have 2 free Developer Edition orgs.  One is set up as the Identity Provider using Salesforce's built-in IDP service.  I set up the othe org as a Service Provider. In the IDP org, I added the Service Provider as a connected app as defined under "Setup" > "Security Controls" > "Identity Provider".  I also assigned a profile to the connected app. I should end up with a new Service Provider listed under Identity Provider. However, when I go to the Identity Provide page under "Setup" > "Security Controls" > "Identity Provider", the list of Service Providers is empty . What could be the possible reason? Am I missing any other step? Below is a link to the workbook exercise I am following:

https://developer.salesforce.com/page/Implementing_Single_Sign-On_Across_Multiple_Organizations

Thank you for your help!
Are there any advantages to using the Force.com Migration Tool instead of just using the Deploy/Retrieve options in Workbench? Thanks in advance for your help.
I want to make sure a SOQL is not empty before I start working with it.  Is there a way to perform the below code without using 2 SOQL statements?  Thanks in advance for your help!

Account[] alist = new Account[]{};

if(![SELECT Id FROM Account WHERE LastModifiedDate = TODAY].isEmpty()){
     alist = [SELECT Id FROM Account WHERE LastModifiedDate = TODAY];
     for(Account a : alist){
          //do some code...
     }
}
 
I'm inserting an Account, followed by an Opportunity.  Then, I run a SOQL to make sure the name field on Account is not null.  However, it keeps showing as null.  I know I can do a SOQL directly on Account, but this is just a simplified question for the real issue I'm trying to solve.  Does anyone know why this is showing as null?  Thanks in advance for your help!

Account a = new Account();
        a.Name = 'Universal Containers';
        a.BillingStreet = 'Market';
        a.ShippingStreet = '1 Market';
        a.BillingCity = 'San Francisco';
        a.ShippingCity = 'San francisco';
        a.BillingPostalCode = '94105';
        a.ShippingPostalCode = '94105';
        a.BillingState = 'California';
        a.ShippingState = 'California';
        a.BillingCountry = 'United States';
        a.ShippingCountry = 'United States';
insert a;

Opportunity o = new Opportunity();
       o.Name = 'Universal Containers';
       o.Account = a;
        o.CloseDate = Date.today();
        o.StageName = 'Submitted';
        insert o;
        
Opportunity o = [SELECT Id, Account.Name FROM Opportunity WHERE Id = :o.Id LIMIT 1];
System.Assert(o.Account.Name != null);
//This assert always fails even tough I know the Account and Opportunity were successfully inserted and the the Account.Name field is populated.