+ Start a Discussion
Katie KourtakisKatie Kourtakis 
I am seeing this error...'Challange Not yet complete...here's what's wrong: The 'Shift Hours' field on the 'Volunteer Shift' record is not working as expected. I'm stuck as to what I am doing wrong. It's probably a simple fix that I'm over looking. Help solving this problem would be greatly appreciated! Thanks!

User-added image
User-added image
User-added image
Best Answer chosen by Katie Kourtakis
bretondevbretondev
Multiply your formula by 24
Laura KempenaarLaura Kempenaar 
Hi all,

Another question from me: I am still working on the admin module within Trailheads and I cant finish it, because in the Create object specific quick actions-part I can't seem to find Properties under Tabs. I did create Property/Properties as an object, but then I have to do this:

Enter Tab in the Quick Find box, then select Tabs.
In the Custom Object Tabs list, click New.
In the Object dropdown list, select Property.

And in that object dropdown list, there is no Property. Can someone tell me what to do here, please? Thanks! :)
Best Answer chosen by Laura Kempenaar
Andras Arva(HU)Andras Arva(HU)
hey @Laura Kempenaar
I was in the same situation, reviewed tab access, even FLS but did NOT helped.
After a while i noticed that if i scroll UP in my mobile it refresh my tabs list ! (where you generally see tabs/recent/connections etc.)
And this was necessary as probably tab names were cached (if i use another mobile to connect that could work w/o it)
H 007H 007 
Hi, I need to setup a integration from Sitecore to Salesforce. So anyone please help me to send data from Sitecore to Salesforce..
Best Answer chosen by H 007
VinayVinay (Salesforce Developers) 
Check below references for sitecore to salesforce integration.

https://himynameistim.com/blog/connecting-sitecore-to-salesforce
https://doc.sitecore.com/xp/en/developers/salesforce-connect/21/sitecore-connect-for-salesforce-crm/index-en.html

Also you can check on appexchange if there are any tools that matches your requirement.

https://appexchange.salesforce.com/

Please mark as Best Answer if above information was helpful.

Thanks,
jkcjkc 
Hi,
I'm in a terrible dilemma with the trigger. I was wondering why there is no id assigned on the record anymore
trigger trigger_Account on Account(before insert, before update){
  for( Account acc : Trigger.new){
    system.debug('Account id: ' + acc.id);
  }
}
this change affected some of my previous triggers
Best Answer chosen by jkc
ManojSankaranManojSankaran
Hi,

Your trigger will fire in two condition before insert and before update.

In before insert - id value wont be there....since the record is not inserted into database.
in before update - id value will be there and you will be albe to use that id for calcualtion.

Only in After Insert you will get the id of that record.


Let me know if you need more clarification. If it answers your question please mark it as answer.

Thanks
Manoj S
Rahul  37Rahul 37 

Hi,

I want to developer a business application like Gmail.

so if i use community site but url showing last www.abc.salesforce.com but i want to create my own custom url like www.abc.com.

So is it possible to create and developer own custom url ?

 

Thanks

Best Answer chosen by Rahul 37
VinayVinay (Salesforce Developers) 
Nope, your application will run on salesforce platform unless you are trying to integrate any third party application like AWS etc.

Thanks,
Sumesh ChandranSumesh Chandran 
The below batch class will be processing a little over 2.5 million records. The START method will be sending in the whole 2.5 million records to the execute method and the execute method does the processing on each of the 2.5 million records inside a for loop. 
Also the for loop has a SOQL inside which I believe cannot be avoided to get the right numbers. 
Is this the right way of doing this or are there any other better ways. Please help!

Also when the running the below batch class I get the First Error: Too many query rows error.
 
global class MDUSquadRawDataBatchTest implements Database.Batchable<sObject>, Database.Stateful {  
    List<Address_Master__c> addressList = new List<Address_Master__c>();
    Set<String> addresses = new Set<String>();
   
    // Start Method
    global Database.QueryLocator start(Database.BatchableContext BC) {
        return Database.getQueryLocator('SELECT Street_Address__c,City_Name__c FROM MDU_Squad_Raw_Data__c');
    }   
    
    // Execute method
    global void execute(Database.BatchableContext BC, List<MDU_Squad_Raw_Data__c> rawData) {        
        for(MDU_Squad_Raw_Data__c mduRawData: rawData) {
            List<MDU_Squad_Raw_Data__c> addressData = [SELECT Street_Address__c,City_Name__c,Province_Code__c,Postal_Code__c,Internet_Service__c,Video_Service__c,Phone_Service__c FROM MDU_Squad_Raw_Data__c WHERE Street_Address__c=:mduRawData.Street_Address__c AND City_Name__c=:mduRawData.City_Name__c];
            String fullAddress = addressData[0].Street_Address__c+' '+addressData[0].City_Name__c+' '+addressData[0].Province_Code__c+' '+addressData[0].Postal_Code__c;
            
            Address_Master__c theAddress = new Address_Master__c();
            if(!addresses.contains(fullAddress.substringBeforeLast(' '))) {
                theAddress.Name = addressData[0].Street_Address__c;
                theAddress.City_Name__c = addressData[0].City_Name__c;
                theAddress.Province_Code__c = addressData[0].Province_Code__c;
                theAddress.Postal_Code__c = addressData[0].Postal_Code__c; 
                fullAddress = addressData[0].Street_Address__c+' '+addressData[0].City_Name__c+' '+addressData[0].Province_Code__c+' '+addressData[0].Postal_Code__c;
                theAddress.Full_Address_Ext_Id__c = fullAddress;

                addresses.add(fullAddress.substringBeforeLast(' '));
                addressList.add(theAddress); 
            }                                                     
        }            
        Database.Upsert(addressList, Address_Master__c.Fields.Full_Address_Ext_Id__c, true);
    }
    // Finish Method    
    global void finish(Database.BatchableContext BC) {
        
    } 
}

I request if someone could please help me with this, as I am dealing with this for some time, with no idea on how to fix this.
Best Answer chosen by Sumesh Chandran
Andrew GAndrew G
if you are still struggling, here is a code example that may point you in the right direction:
//Loop1 - get street and city name data into two lists
list<string> streetList = new List<string>();
list<string> cityList = new List<string>();
for(MDU_Squad_Raw_Data__c mduRawData: rawData) {
  streetlist.add(mduRawData.StreetAddress__c);
  cityList.add(mduRawData.CityName__c);
}
//do query:
List<MDU_Squad_Raw_Data__c> addressData = [SELECT Street_Address__c, City_Name__c, Province_Code__c, Postal_Code__c, Internet_Service__c, Video_Service__c, Phone_Service__c 
    FROM MDU_Squad_Raw_Data__c 
    WHERE Street_Address__c IN :streetList 
        AND City_Name__c IN :cityList];

//Loop addressData to make Map with Key street~city
Map<string,MDU_Squad_Raw_Data__c> mapAddressData = new Map......
for(MDU_Squad_Raw_Data__c raw : addressData){
  //psuedo - if no key, then add
  if !(mapAddressData.containsKey(raw.Street_Address__c+'~'+raw.City_Name__c){
      mapAddressData.add(raw.Street_Address__c+'~'+raw.City_Name__c, raw);
  }
}

//now we loop the original list checking the map for the key and then update as required
list<MDU_Squad_Raw_Data__c > updateList = new....
for(MDU_Squad_Raw_Data__c raw: rawData) {
    if(mapAddressData.containsKey(raw.Street_Address__c+'~'+raw.City_Name__c)){
        MDU_Squad_Raw_Data__c address = mapAddressData.get(raw.Street_Address__c+'~'+raw.City_Name__c);
        //now update the raw record with address record
        raw.postalcode = addres.province code;
//etc
        updateList.add(raw);
     } //endi f
}//end loop
if (updateList.size()>0){
   update udpateList;
}

Regards
Andrew
John De SantiagoJohn De Santiago 

After a lot of persistence I finally was able to get repeating header and footers when rendering a Visualforce page as a PDF. The key to this is the page2PDF support of CSS3. 

 

Here is the css I came up with:

 

<style type="text/css">

@page {

@top-center {

content: element(header);

}

}

div.header {

padding: 10px;

position: running(header);

}

</style>

 

In the visualforce page I have the header setup as a div with the class name "header" the position running command pulls the content in my div and repeats it at the top of every page. The key for some reason is to put your header and footer divs at the top before you put your content on the page.

 

Here is my page

 

<apex:page renderAs="pdf">

<head>

<style type="text/css" media="print">

@page {

@top-center {

content: element(header);

}

@bottom-left {

  content: element(footer);

}

}

 

div.header {

padding: 10px;

position: running(header);

}

div.footer {

display: block;

padding: 5px;

position: running(footer);

}

 

.pagenumber:before {

content: counter(page);

}

.pagecount:before {

content: counter(pages);

}

</style>

</head>

 

<div class="header">

<div>My Header Text</div>

</div>

 

<div class="footer">

<div>Page <span class="pagenumber"/> of <span class="pagecount"/></div>

</div>

 

<div class="content">

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec nulla turpis. Suspendisse eget risus sit amet lectus ornare varius. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean nec urna purus, adipiscing accumsan massa. Nullam in justo nulla, sed placerat mauris. In ut nunc eget libero posuere luctus. Donec vulputate sollicitudin ultrices. Nulla facilisi. Mauris in sapien arcu. Phasellus sit amet quam non mi ornare tincidunt ac quis lectus.</p>

</div>

</apex:page>

 

I cut the content text short for the purpose of this post. I am sure it will just take some more playing around.

 

Hope this helps someone avoid some late nights like I spent trying to figure this out. :smileyhappy:

 

 

Message Edited by JohnDS on 03-10-2010 07:34 PM
Best Answer chosen by Admin (Salesforce Developers) 
John De SantiagoJohn De Santiago

You need to play around with the margin-top setting in the @page tag of the css or add one if you have not already. I usually just put a margin-top: 100px and margin-bottom:80px to keep the content from overlapping the heading. You can use smaller sizes but this allows room for an image.

 

I have also created a component for adding header and footer tags along with sample code. You can download the component from my blog at http://thurly.net/02s7

Saurav Roy 15Saurav Roy 15 
Hello Everyone,
Can anyone please explain the significance of the Test.startTest() and Test.stopTest() in terms of asynchronous calls/apex ? I am aware of the governer limits being reset. 
Best Answer chosen by Saurav Roy 15
AbhishekAbhishek (Salesforce Developers) 
Hi Saurav,

As you have already know by now that Apex is governed by certain boundaries. The term coined for this is 'Governor Limits'.

There are two additional system static methods provided by Apex. These methods, Test.startTest and Test.stopTest, are used when testing governor limits. Or in other words, executing test scenarios with a larger data set.

These static methods allow a test method to separate the Apex resources and governor limits being used to prepare and initialize the dataset from the resources and limits used during the actual test execution.

Bottom Line - 

Governor limits are reset when the Test.startTest appears and the code between Test.startTest and Test.stopTest executes in a fresh set of governor limits (Context changes). Also, Test.stopTest appears, the context is again moved back to the original code.

Example -

you have 100 lines of code in your test class.

you have start test at 30 
you have stop test at 70

So the line of code from 30 -70 is the indifferent context of governor limits and
line 1-30/71-100 in different contexts. 

Total of 2 contexts here.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Regards,
Salesforce Support.
fernandotakaifernandotakai 

Hi!

 

I have a package with a publisher name as MyCorp, but I would love to change to something more meaningful (as my real company name), but I can't find a way of doing it.

 

Is there a way, or do I need to create a new package (or is there any other way)?

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
A_SmithA_Smith

Change the your dev organizations name under Company Profile > Company Information in setup.  It will take up to 30 minutes, but this will change the publisher shown for packages in subscriber orgs.  


Thanks,

Andrew

Rahul Jain 262Rahul Jain 262 
List<Account> lstAccrecords = new list<Account>();
for (integer counter = 1; counter <= 200; counter++)
{
    Account Acc = new Account();
    
        Acc.name = 'Testing for bulkification';
        Acc.AnnualRevenue = '2000'+counter;
        Acc.BillingAddress = 'Delhi';
        Acc.Phone= '898231851'+counter;
    
}
if(!lstAccrecords.isempty())
{
    insert lstAccrecords;
}
Best Answer chosen by Rahul Jain 262
Ruwantha BulegodaRuwantha Bulegoda
You are trying to assign invalid variable types for Annual Revenue and Billing Address. Annual Revenue is an integer value but with your '2000' (with quotes) it is assigned as strings. Remove the quotes. Then the address is a composite field. This means it is created with multiple fields as mentioned below. So you have to populate the city, street, and other values separately. Here is the working code for you. Also please mark this as the correct answer after checking.
List<Account> lstAccrecords = new list<Account>();
for (integer counter = 1; counter <= 200; counter++)
{
    Account Acc = new Account();

    Acc.name = 'Testing for bulkification';
    Acc.AnnualRevenue = 2000+counter;
    Acc.BillingCountry = 'India';
    Acc.BillingCity = 'Bombe';
    Acc.BillingPostalCode = '111';
    Acc.BillingStreet = '';
    Acc.billingCity = '';
    Acc.Phone= '898231851'+counter;

}
if(!lstAccrecords.isempty())
{
    insert lstAccrecords;
}