• ALL STAR
  • 19014 Points
  • Member since 

  • Chatter
    Feed
  • 602
    Best Answers
  • 0
    Likes Received
  • 18
    Likes Given
  • 0
    Questions
  • 5790
    Replies
Hello,
I have a error for finish excersice.

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ETLSLWHV

Can someone help me
Mirian Pilli

 

We are making the switch to Salesforce (from GoldMine) and we are working to implement a system that will automatically route phone calls to the appropriate trip adviser based on their destination specialization and phone availability status. This system will be looking at a custom field on a custom object we have (User Setting.user_status__c) to determine who is available. 

I have been searching to try and find anything that gives me an idea of how best to accomplish this, and I feel like all the pieces are there for me to do so (the UserPresence status, accessed by the embeddable widget, maybe using Salesforce's streaming api to push changes to RC widget and desktop application to update the HUD) but I don't know where to start in regards to having the RC embeddable listen to changes on a custom field in Salesforce. 

Is this possible? 

I am stuck in this step. My tests are running and I have 100% coverage, but there is something Trailhead is not liking. Do you know what can it be?

Here is my OrderTests class:
@IsTest
private class OrderTests {
    
	   
    @testSetup static void SetupTestData(){
        TestDataFactory.InsertTestData(5);
    }

    
    @isTest static void OrderUpdate_UnitTest(){
        //retrieve the orders saved by TestDataFactory
        Map<Id, Order> orders= new Map<Id, Order>([SELECT Id, Status FROM Order]);
        //save the original Product2 record in a map
        Map<Id, Product2> originalProductMap = new Map<Id, Product2>();
        //Loop through a query of OrderItems related to the orders
        List<OrderItem> items = [SELECT Id, Product2Id, Product2.Quantity_Ordered__c, Quantity
                                 FROM OrderItem
                                 WHERE OrderId IN :orders.keySet()];
        //ToDo: Populate the map with the Id of the related Product2 as the key and Product2 record as the value
        for ( OrderItem oi : items){
            Product2 p = oi.Product2;
            if (!originalProductMap.containsKey(p.Id)) {
                originalProductMap.put(p.Id, p);
            } 
        }
        //update the Status of the orders
        List<Order> updatedOrders = new List<Order>();
        for (Order order : orders.values()) {
            order.Status = Constants.ACTIVATED_ORDER_STATUS;
            updatedOrders.add(order);
        }
        //get the amounts to be order for each Product
        //declare a map to save the Amounts for each product
        Map<Id, Integer> prodAmounts = new Map<Id, Integer>();
        //get the aggregated amounts by product id
        AggregateResult[] groupedResults  = [SELECT Product2Id, SUM(Quantity) FROM OrderItem
                                             WHERE Product2Id IN :originalProductMap.keySet() 
                                             GROUP BY Product2Id];
        for (AggregateResult ar : groupedResults)  {
             prodAmounts.put(String.valueOf(ar.get('Product2Id')),Integer.valueOf(ar.get('expr0')));
        }                                     
        //update the orders in the DB
        update updatedOrders;
        //retrieve the products affected by the orders update
        Map<Id, Product2> updatedProductMap = new Map<Id, Product2>([SELECT id, Quantity_Ordered__c 
                                                                     FROM Product2 WHERE
                                                                     id IN :originalProductMap.keySet()]);
        for (Product2 origProd : originalProductMap.values()) {
            TestDataFactory.VerifyQuantityOrdered(origProd,updatedProductMap.get(origProd.Id), prodAmounts.get(origProd.Id));
        }
    }

}

and my TestDataFactory
 
/**
 * @name TestDataFactory
 * @description Contains methods to construct and/or validate commonly used records
**/
public with sharing class TestDataFactory {

    /**
     * @name ConstructCollaborationGroup
     * @description
    **/
    public static CollaborationGroup ConstructCollaborationGroup(){
        //ToDo: Ensure this method returns a single Chatter CollaborationGroup
        //    whose Name starts with 'TEST' followed by the INVENTORY_ANNOUNCEMENTS constant
        //    and configured so anyone can join, see and post updates.
        return (new CollaborationGroup(Name = 'TEST' + Constants.INVENTORY_ANNOUNCEMENTS,
                                       CollaborationType = 'Public'));        
    }

    /**
     * @name CreateProducts
     * @description Constructs a list of Product2 records for unit tests
    **/
    public static List<Product2> ConstructProducts(Integer cnt){
        for (Schema.PicklistEntry fam : Constants.PRODUCT_FAMILY){

        }
        //ToDo: Ensure this method returns a list, of size cnt, of uniquely named Product2 records
        //  with all the required fields populated
        //  and IsActive = true
        //  an Initial Inventory set to 10
        //  and iterating through the product family picklist values throughout the list.
        List<Product2> products = new List<Product2>();
        Integer i = 0;
        for (Integer x = 0; x < cnt; x++ ){
            if (i > Constants.PRODUCT_FAMILY.size() -1 ) i = 0;            
            Product2 p = new Product2(Name = 'product' + x,
                                      Initial_Inventory__c = 10,
                                      IsActive = true,
                                      Family = Constants.PRODUCT_FAMILY[i].getLabel());
            i++;                          
            products.add(p);
        }
        return products;
    }

    /**
     * @name CreatePricebookEntries
     * @description Constructs a list of PricebookEntry records for unit tests
    **/
    public static List<PricebookEntry> ConstructPricebookEntries(List<Product2> prods){

        //ToDo: Ensure this method returns a corresponding list of PricebookEntries records
        //  related to the provided Products
        //  with all the required fields populated
        //  and IsActive = true
        //  and belonging to the standard Pricebook
        List<PricebookEntry> pbentries = new List<PricebookEntry>();
        for (Product2 p : prods){
            PricebookEntry pb = new PricebookEntry(IsActive = true,
                                       UnitPrice = 10,
                                       Pricebook2Id = Constants.STANDARD_PRICEBOOK_ID,
                                       Product2Id = p.Id);
            pbentries.add(pb);                           
        }
        return pbentries;
    }

    /**
     * @name CreateAccounts
     * @description Constructs a list of Account records for unit tests
    **/
    public static List<Account> ConstructAccounts(Integer cnt){
        //ToDo: Ensure this method returns a list of size cnt of uniquely named Account records
        //  with all of the required fields populated.
        List<Account> accounts = new List<Account>();
        for (Integer x=0; x<cnt; x++) {
            Account acc = new Account(Name = 'account ' + x);
            accounts.add(acc);
        }
        return accounts;
    }

    /**
     * @name CreateContacts
     * @description Constructs a list of Contacxt records for unit tests
    **/
    public static List<Contact> ConstructContacts(Integer cnt, List<Account> accts){
        //ToDo: Ensure this method returns a list, of size cnt, of uniquely named Contact records
        //  related to the provided Accounts
        //  with all of the required fields populated.
        List<Contact> contacts = new List<Contact>();
        Integer y = 0;
        for (Integer x = 0; x < cnt; x++){
            if (y > accts.size() - 1) y = 0;
            Contact c = new Contact(FirstName = 'cont'+y,
                                    LastName = 'Last ' + y,
                                    AccountId = accts[y].Id );
            contacts.add(c);                        
            y++;
        }
        return contacts;
    }

    /**
     * @name CreateOrders
     * @description Constructs a list of Order records for unit tests
    **/
    public static List<Order> ConstructOrders(Integer cnt, List<Account> accts){
        //ToDo: Ensure this method returns a list of size cnt of uniquely named Order records
        //  related to the provided Accounts
        //  with all of the required fields populated.
        Integer y = 0;
        List<Order> orders = new List<Order>();
        for (Integer x = 0; x < cnt; x++) {
            if (! (y < accts.size())) y = 0;
            Order ord = new Order(AccountId = accts[y].Id,
                                  PriceBook2Id = Constants.STANDARD_PRICEBOOK_ID,
									Name = 'order '+ x,
                                    Status = Constants.DRAFT_ORDER_STATUS,
                                    EffectiveDate = date.today());
            orders.add(ord); 
            y++;               
        }
        return orders;
    }

    /**
     * @name CreateOrderItems
     * @description Constructs a list of OrderItem records for unit tests
    **/
    public static List<OrderItem> ConstructOrderItems(integer cnt, list<pricebookentry> pbes, list<order> ords){
        //ToDo: Ensure this method returns a list of size cnt of OrderItem records
        //  related to the provided Pricebook Entries
        //  and related to the provided Orders
        //  with all of the required fields populated.
        //  Hint: Use the DEFAULT_ROWS constant for Quantity as it will be used in the next challenge
        List<OrderItem> orditems = new List<OrderItem>();
        Integer y = 0;
        for (Integer x = 0; x < cnt; x++) {
            if (y > pbes.size() - 1) y = 0;
            OrderItem oi = new OrderItem(OrderId = ords[y].Id,
                                            PricebookEntryId = pbes[y].Id,
                                            Quantity = Constants.DEFAULT_ROWS,
                                            UnitPrice = 1);
            orditems.add(oi);
            y++;
        }
        return orditems;
    }

    /**
     * @name SetupTestData
     * @description Inserts accounts, contacts, Products, PricebookEntries, Orders, and OrderItems.
    **/
    public static void InsertTestData(Integer cnt){
        //ToDo: Ensure this method calls each of the construct methods
        //  and inserts the results for use as test data.
        CollaborationGroup cg = ConstructCollaborationGroup();
        insert cg;
        system.debug('inserted CollaborationGroup');
        List<Product2> prods = ConstructProducts(cnt);
        insert prods;
        system.debug('inserted products');
        List<PricebookEntry> pbes = ConstructPricebookEntries(prods);
        try {
            insert pbes;
            system.debug('inserted PriceBookEntries');
        } catch (Exception e) {
            system.debug('exception: ' + e.getMessage());
        }
        List<Account> accts = ConstructAccounts(cnt);
        insert accts;
        system.debug('inserted Accounts');
        List<Contact> conts = ConstructContacts(cnt, accts);
        insert conts;
        system.debug('inserted Contacts');
        List<Order> orders = ConstructOrders(cnt,accts);
        insert orders;
        system.debug('inserted orders');
        List<OrderItem> ordItems = ConstructOrderItems(cnt, pbes, orders);
        insert ordItems;
        system.debug('inserted OrderItems');
    }
    
    public static void VerifyQuantityOrdered(Product2 originalProduct, Product2 updatedProduct, Integer qtyOrdered) {
        system.debug('Original Product.quantity = ' + originalProduct.Quantity_Ordered__c);
        system.debug('qtyOrdered = '+ qtyOrdered);
        system.debug('updated product.quantity = ' + updatedProduct.Quantity_Ordered__c);
        
        system.assertEquals(qtyOrdered, updatedProduct.Quantity_Ordered__c - originalProduct.Quantity_Ordered__c );
    }

}

 
Hello,
I am having issues with the week 1 Trailhead training ->Quick Start: Lightning Experience for Closers -> Hunt Your Prospect Project.  I am unable to convert the Lead to an Opportunity.  I keep getting the following message when I click Convert:
User-added imageIs anyone else having this issue?  I have gone through the steps as indicated in the directions and keep getting the same error message.  Please advise.
Thanks,
Elena
How to run a schedulable class every 1 min?
I'm using a lightning-datatable in LWC, and hooking into 'oncellchange' to ensure that any inline editing is automatically included in the underlying javascript data model immediately.

I then have another button 'Recalculate' that is not in the data-table, and this button will 'action' the change and perform some calculations elsewhere on page.

On click of the 'Recalculate' button, I would like the yellow highlights on the inline edited cells of the data-table to be cleared, but I can't work out how.  This is so the user can see that their changes have been applied.

Does anyone have any idea?
I am trying to verify my changes for the in the project  Create Reports and Dashboards for Sales and Marketing Managers (Visualize Your Data). I see the below error instead, the other challenges in the project worked fine. 

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: VVGCJZDP
Please help! Hours of work doing this superbadge - then I get this error after successful completing about 30% of the challenge.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: NGHFSZXZ
Hi Team, i'm doing the module Build a Discount Calculator in Step 4 and when I try to verify my challenge with a Trailhead playground I receive the next error:

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: GJODIZOO
Error ID: RPAFOKOJ , Tried completing Visualize Your Data lesson from Create Reports and Dashboards for Sales and Marketing Managers Modules  in several different new enviroments. still getting the following error message with a changing error ID everytime: 

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FNJYPQBK
I have one too. I'm trying to complete the challenge for "Map Your Workflow Criteria to Process Criteria"

"There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ZCMXATUO"

I can't move onto my next challenge without completeing this one:(
Hi,
When are validation rules applied when using Salesforce for
Outlook? While saving the record or Every time data is synchronized with the server?


Thanks,
Himabindu
Dears,

I can't add a field in work order report "Service Report language", Even it's added into report type layout.

Can anyone advise me how can i enable it's in report.

Regards,
Soundar.
Hi all, 

Still get the error message of the challenge 3) Create Seed Bank Agencies: 
Challenge Not yet complete... here's what's wrong: 
We can't find Agency records in the Account object.


Tried to follow all the steps of other earlier questions, no success sofar. And start from scratch again Am i missing a step? 

Please help me! 
I'm getting an error on the Prepare Your Salesforce Org for Users badge in the Create Chatter Groups section.

I'm following the directions down to a T but I keep getting this: "Ensure that you are following all the instructions for posting to a Chatter group."

While trying to complete che challenge, the following message appear:

Step not yet complete in [my personal developer edition]
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: IZYHXZTM.

Can someone help me?Thanks.

Created a button under the contact object, while it appears in SF and works as expected, it does not appear in the partner community.

/{!$ObjectType.Account}/e?retURL= {!Account.Id}=RecordType=0121N000000qrnM&en)}
Hi All,
I am getting this error when I am trying to create a 'No Show Prediction'.

Trailhead:
Trailhead
I followed all the steps as suggested in the trailhead. But when I click 'Build Prediction'. I am getting the following error

Error creating Application on EP for Id 0Pp1U000000PFVZSA4

Error which creating prediction
Can someone let me know how to clear this error
In how many ways a salesforce classic app be migrated to lightning app?

one way is from "appmanager" upgrade the classic app, I just wanted to know is there any other way to migrate a classic app to lightning?
How to create a developer org with 250 mb of storage limit?
What am I missing? Can anyone help me out.
I'm integrating Athena to Salesforce. I'm getting error:
[149]|DEBUG|Response Body<?xml version="1.0" encoding="UTF-8"?>
USER_DEBUG <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>********-****-****-****-*************</RequestID></Response>

Here is my code:
public class AWSHelper {
	 private string HTTPRequestMethod ='GET';
    private string canonicalURI = '/' ;	//since we dont have any path
    private string canonicalQueryString= 'Action=DescribeRegions&Version=2015-10-01' ;
    private string canonicalHeaders ;
    private string signedHeaders ;
    private string requestPayload;
    private string access_key ='********************';
    private string secret_key ='****************************************';
    private string service = 'iam';
    private string contentType = 'application/x-www-form-urlencoded; charset=utf-8';
    private string host = 'iam.amazonaws.com';
    private string region = 'us-east-1';
    private string endpoint = 'https://iam.amazonaws.com';
    private string request_parameters = 'Action=DescribeRegions&Version=2015-10-01&AUTHPARAMS' ; 
    // Version Dates for Different Services:-  
    // Athena Version=2017-05-18, EC2 Version=2015-10-01, IAM Version=2012-10-17
    
        	
    private string canonical_request ;
    private string algorithm = 'AWS4-HMAC-SHA256';

    public  string getISO8601DateTime(){
        return System.now().formatGMT('YYYYMMdd\'T\'HHmmss\'Z\'');
        //+ ' !!============!! ------ > '+ System.now().formatGMT('yyyyMMdd\'T\'HHmmss\'Z\''); 
    }
    
    public  string getISO8601Date(){
        return System.now().formatGMT('YYYYMMdd');
        //+ ' !!============!! ------ > '+ System.now().formatGMT('yyyyMMdd\'T\'HHmmss\'Z\''); 
    }
   
    public string payLoad(string payload){
        // in case of GET request we have empty payload
        Blob hash = Crypto.generateDigest('sha256',Blob.valueOf(payload));
        return EncodingUtil.convertToHex(hash);
    }
    
    public Blob sign(Blob key, string message){
        string algorithm='HmacSHA256';
        Blob output=Crypto.generateMac(algorithm, Blob.valueof(message), key);
        return output;
        
    }
    public  void buildCanonicalString()
    {
        Blob key=Blob.valueof('AWS4'+secret_key);
        
        
        // TASK 1
		canonicalHeaders='content-type:' + contentType + '\n' + 'host:' + host + '\n' + 'x-amz-date:' + getISO8601DateTime() +  '\n';
        signedHeaders='content-type;host;x-amz-date';
        
        canonical_request=HTTPRequestMethod + '\n' + canonicalURI + '\n' +
            						canonicalQueryString+ '\n' +canonicalHeaders +'\n' +signedHeaders +'\n' + payload('');
        System.debug('canonical_request-->'+canonical_request);
		
        
        
		//  string hmac='SHA-256';
        Blob targetBlob = Blob.valueOf(canonical_request);
        Blob hash = Crypto.generateDigest('SHA-256', targetBlob);	//using SHA-256
        Blob hash2 = Crypto.generateMac('hmacSHA256', targetBlob, key);		//using hmacSHA256
        String canonical_request_hash = EncodingUtil.convertToHex(hash);
        String canonical_request_hash2 = EncodingUtil.convertToHex(hash2);
        
        System.debug('canonical_request_hash---->'+canonical_request_hash);
		System.debug('canonical_request_hash2---->'+canonical_request_hash2);
        
        // TASK2
        string credential_scope = getISO8601Date() + '/' + 'us-east-1' + '/' + 'ec2' + '/' + 'aws4_request\n';
        string stringToSign=algorithm + '\n' +  getISO8601DateTime() + '\n' +  credential_scope + '\n' + canonical_request_hash2;
        
        System.debug('stringToSign--->'+stringToSign);
        // task 3 Calculate the AWS Signature Version 4
        Blob keySecret = Blob.valueOf('AWS4' + secret_key);
    	Blob keyDate = Crypto.generateMac('hmacSHA256', Blob.valueOf(getISO8601Date()), keySecret);
    	Blob keyRegion = Crypto.generateMac('hmacSHA256', Blob.valueOf(region), keyDate);
    	Blob keyService = Crypto.generateMac('hmacSHA256', Blob.valueOf(service), keyRegion);
    	Blob keySigning = Crypto.generateMac('hmacSHA256', Blob.valueOf('aws4_request'), keyService);
		// string keysigningstring = EncodingUtil.convertToHex(keySigning);
        
        
         Blob blobToSign = Blob.valueOf(stringToSign); // from task 2
        Blob hmac = Crypto.generateMac('hmacSHA256', blobToSign, keySigning);
        String signature = EncodingUtil.convertToHex(hmac);
        
        
        
		/* Blob blobToSign = Blob.valueOf(stringToSign);
    	Blob blobToSignhmac = Crypto.generateMac('hmacSHA256', keySigning, blobToSign);
    	String signature = EncodingUtil.convertToHex(blobToSignhmac);
        */
        
               
		// Task 3 Calculate Signature
		//Blob signing_key =getSignatureKey (secret_key, getISO8601Date(), region, service);
        //Blob signature=sign(signing_key,stringToSign);
		//string finalSignature=EncodingUtil.convertToHex(signature).toLowerCase();
        // Task 4 Add Signining Information to Header
      
        String authorization = 'AWS4-HMAC-SHA256'
        + ' ' + 'Credential=' + access_key + '/' + credential_scope
        + ', ' + 'SignedHeaders=' + signedHeaders
        + ', ' + 'Signature=' + signature
		;
		
    	system.debug('authorization----->'+authorization);
        system.debug('getISO8601Date----->'+getISO8601Date());
		HttpRequest req = new HttpRequest();
        string endpoint= endpoint+'?'+canonicalQueryString  +
            	'&X-Amz-Algorithm=AWS4-HMAC-SHA256&'+
                    '&X-Amz-Credential='+EncodingUtil.urlEncode((access_key + '/' + credential_scope), 'UTF-8')+
                    +'&X-Amz-Date='+getISO8601Date()+
                    '&X-Amz-Expires=60'+
                    '&X-Amz-SignedHeaders='+signedHeaders+
            		'&X-Amz-Signature='+signature+
            		'&AWSAccessKeyId='+access_key;

       	req.setEndpoint(endpoint);	// Use authorization_header or querystring
        req.setMethod(HTTPRequestMethod);
		// req.setHeader('Authorization', authorization);
       	req.setHeader('content-type' , contentType);
        //req.setHeader('host','iam.amazonaws.com');
        //req.setHeader('x-amz-date',getISO8601Date());
        
		// req.setHeader('X-Amz-Credential',access_key+'/'+getISO8601Date()+'/us-east-1/s3/aws4_request');
		// req.setHeader('X-Amz-Date',getISO8601Date());
       	
        //req.setHeader('x-Amz-Host',host);
        
		// req.setHeader('X-Amz-Expires','604678');
		// req.setHeader('X-Amz-SignedHeaders','host');
		// req.setHeader('x-amz-content-sha256', 'UNSIGNED-PAYLOAD');
            
		// req.setHeader('X-Amz-Signature',finalSignature); 
		// Http ht = new Http();
		HttpResponse res = new Http().send(req);
        system.debug('endpoint'+endpoint);
		System.debug('Response Body'+res.getBody());
		//System.debug('Status'+res.getStatus());        
    }
}

Thanks in advance​​​​​​​
I WANT TO CONNECT QUICKBOOKS TO SALESFORCE USING AN api CALL WITHOUT A 3RD PART APPLICATION.
PLEASE HELP WITH CODE AND THE PROCES OR STEPS.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: JLJKDJUN
Close errors
Hi, 
I have a managed package with different triggers. 
Is there a way to get the calling source that invoked the trigeer action? for example if other package initiated the action - get its namespace,
also if it's from other context like an action from email etc...
I need to get as much information as possible regarding the action's source.

Thanks.


 
User-added image Error occur is Salesforce.com can't validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you.

How can I get all Objects except the System Objects in SF?

Here's my code. But I need to revise it to get only the needed Objects.

@AuraEnabled
	public static List<SelectOption> fetchAllObjects(){
        Set<String> listObjs = new Set<String>();
        for(MyCustomSettings__c cs : [Select Id, Objects__c From MyCustomSettings__c]){
            listObjs.add(cs.Objects__c);
        }

		List<SelectOption> objList = new List<SelectOption>();
        Set<String> csObjNames = new Set<String>();
        Map<String, String> mapName = new Map<String, String>();
        Map<String, String> mapLabel = new Map<String, String>();
		for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
            System.debug(objTyp.getDescribe().getLabel());

            if ( objTyp.getDescribe().isCreateable()) {
                csObjNames.add(objTyp.getDescribe().getLabel());
                    mapName.put(objTyp.getDescribe().getLabel(), objTyp.getDescribe().getName());
                    mapLabel.put(objTyp.getDescribe().getName(), objTyp.getDescribe().getLabel());
            }
		}

        List<String> objNamesCast = new List<String>();
        objNamesCast.addAll(csObjNames);
        objNamesCast.sort();

        for(String s : objNamesCast){
            String objTypeName = mapName.get(s);
            String objTypeLabel = mapLabel.get(objTypeName);
            if(!listObjs.contains(objTypeName)) objList.add(new SelectOption(objTypeName,objTypeLabel));
            else objList.add(new SelectOption(objTypeName,objTypeLabel, true));
        }

		return objList;   
	}
Hi Folks,
Good day to all!
I have a requirement to display user details and all the users reporting to this user in role heirarchy in a related list below on home page.

I tried achieving this using LIghtning Flow but this solutioon failed as i wasn't able to hide Finish button by giving an alternative custom component as this solution wasn't acceptable to the end user.

Please suggest whether this was achievable through lightning component code. Also, it would be of immense help if someone could share some sample code.
Hi 

I want to clone the Opportunity related object records when I press the custom clone quick action

Example; if I press the custom Clone  button on the Opportunity Object Then I need to clone Opportunity record Including the Related Products and Contracts  

Please help me with this...!
I created a permission set that connects my user to the authenticator app each time but when I tried to log in my user salesforce requested the code written in the app. when I wrote the code it refused to login. each code written doesn't work. I can't connect to my dveloper account can anyone help
 I am looking for a a button code that would  pull rows from a file attached to that record and creates records on another object salesforce
I do not have spell check in Salesforce notes.  I need it added
Hi Team,

I have visual force pages mentioned below in my org,
FileNotFound
ForgotPasswordConfirm
IdeasHome
SiteLogin
SiteRegisterConfirm
SiteTemplate
StdExceptionTemplate
Unauthorized
UnderConstruction
AnswersHome
BandwidthExceeded
Communicationrefresh

I do not see any controller for these VF pages.
Certain of these VF pages have been access in the past 90 days as per report from information for "visualforceaccessmetrics" object.

How do I find out to know which process within salesforce is calling these pages without any controller?

Many Thanks in advance!
I'm frustrated with the issue of aura:id not being dynamic.  I spent hours only to find out this limitation and now need to rethink how to do this entire task. 

I have a simple list of Accounts.  I want the user to be able to select one or more of these using a checkbox (ui:inputCheckbox).  I dynamically created a unique aura:id for each row using the Account's Id.  I was going to use component.find to figure out which rows have been checked.  But it looks like aura:id can't be built dynamically.

Do I now assume I need to just do this via standard Javascript?  I'm assuming there must be a way to do this common task in Lightning.  Any ideas?
Trying to add css class in lightning:tab, but always getting the aura:id value as undefind, I am trying to load my third tab as red in color onload of the component.
here is the component
<lightning:tabset selectedTabId="tabRec" aura:id="tabset" > 
         <lightning:tab label="Lead1" aura:id="tab1" class="tabPadding"> 
         <lightning:tab label="Lead2" aura:id="tab2" class="tabPadding">
         <lightning:tab label="Lead3" aura:id="tab3" class="tabPadding"> 

</lightning:tabset>


Here is the helper, calling this function in init
applyCSS: function(cmp, event) { 
        var cmpTarget = cmp.find("tab3"); 
        alert(JSON.stringify(cmpTarget)); 
        $A.util.addClass(cmpTarget, 'changeMe');
 },


This is style
 
.THIS .changeMe { 
      background:red!important; 
}

 
Working in lightning. I have built a lightning component where i am able to open a modal window by having a user click on an image in the component as if it were a button.

So far, so good. 

What I need to do is launch a flow in that modal window when it opens and then have the modal close when the user clicks the finish button in the flow.

I have the flow name as well as the url, just not sure how to make it launch when the modal opens.

Any thoughts, suggestions, resoruces out there?

Thanks much,
Steve
Can anyone please advise how to connect to Salesforce in Excel 2016? The option to connect to Salesforce From Other Sources is not available

Thanks, Lisa
https://trailhead.salesforce.com/content/learn/modules/picklist_admin/picklist_admin_manage

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ETPFOPNW
I have in place a custom preference / profile center built using a CloudPage. At the moment I am adding the link to the preference center using a AMPScript in the email template. This is what the AMPScript looks like and is entered into the 'href' attribute of the 'a' tag:
 
%%=CloudPagesURL(1682)=%%

The main functionality I would like to achieve is to be able to provide link to an individual's preference cente via a link on a website. I already have in place a API connection to Marketing Cloud. I am be able to provide the respective subscriber key via the API.

My question is there a way to generate the full URL based on the AMPScript CloudPageURL somehow in Marketing Cloud without the need to send an email?
Thanks.
I  have a vf page which has a button named "proceed" on line 154. what it should do is to display the form2 which is apex:form and hide form which is also apex:form.
I am trying to do it using javascript $j('form[id$=form2]').show(); and $j('form[id$=form]').hide();
This method is not working.
Can anyone please help me as to why this does not work
`
<apex:page controller="Email_Quotation_Controller" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" >    
    <script src='/canvas/sdk/js/publisher.js' type='text/javascript' ></script>   
    <script src="/soap/ajax/40.0/connection.js" type="text/javascript" ></script>   
    <script src="/soap/ajax/40.0/apex.js" type="text/javascript" ></script>
    <script src="/sforce/one/40.0/api.js" type="text/javascript" ></script>   
    <apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
    
    <apex:includescript value="{!URLFOR($Resource.CKEditorAirco, 'ckeditor/ckeditor.js')}" />
    
    
    
    
    <script >
    
    
    function hideContactList(){
        $j('form[id$=form2]').show();
        $j('form[id$=form]').hide();
    }
    
    function back(){
        showSpinner();
        CallApexMethodBack();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function back2(){
        showSpinner();
        CallApexMethodBack2();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function selectToEmail(){
        showSpinner();
        CallApexMethodSelectToEmail();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function sendTemplates(){
        showSpinner();
        CallApexMethodSendTemplates();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function showSpinner(){
        document.getElementById('loader').style.display = 'block';
    }
    function hideSpinner(){
        document.getElementById('loader').style.display = 'none';
    }
    </script>
    
    <style>
        tr.spaceUnder > td{
        padding-bottom: 1em;
        }    
        .cError{
        font-weight: bold;
        color: #c00;
        text-align: center
        }
        .title{
        font-family: inherit;
        font-weight: 500;
        line-height: 1.1;
        color: #2e4153;
        font-size: 18px;
        }   
    </style>
    <style>
        .slds-form-element{
        margin-bottom: 0px;
        }
    </style>
    
    <apex:slds />
    
    <body>    
        <!-- REQUIRED SLDS WRAPPER -->
        <div class="slds">    
            <div class="slds-spinner_container" style="display:none;" id="loader">
                <div class="slds-spinner slds-spinner--large" aria-hidden="false" role="alert">
                    <div class="slds-spinner__dot-a"></div>
                    <div class="slds-spinner__dot-b"></div>
                </div>
            </div>
            <!-- MASTHEAD -->
            <div class="slds-text-heading--large slds-text-align--left" style="margin-bottom:50px"> </div>
            
            <div class="slds-text-heading--medium slds-text-align--left" style="margin-bottom:30px"> </div>
            <!-- / MASTHEAD -->    
            
            <!-- PRIMARY CONTENT WRAPPER -->
            <div class="myapp">
                
                <div class="slds-container--center slds-container--small">
                    
                    <apex:form id="form" rendered="{!emailNotSelected}">
                        <apex:actionFunction name="CallApexMethodSelectToEmail" action="{!selectToEmail}" rerender="toEmailsOutPutText, messagePanel" oncomplete="hideSpinner(),hideContactList()"/>
                        <apex:actionFunction name="CallApexMethodBack" action="{!Back}" oncomplete="hideSpinner()"/>
                        
                        <apex:outputPanel id="emailSetPanel">
                            
                            <apex:pageBlock >
                                <div id="emailErrorDiv" class="cError" style="display:none;">Error: No Contact selected. <br/> NO Select at least one Contact in Quotation to proceed to send mail.</div>
                                
                                <div class="title"><b>Customer Contacts:</b></div>
                                <div>&nbsp;</div>
                                <apex:pageBlockTable width="50%" value="{!contactInnerClassList}" var="c" id="tblResults">                       
                                    <apex:column >
                                        <apex:facet name="header"><apex:outputPanel >Select</apex:outputPanel></apex:facet>
                                        <apex:inputCheckbox value="{!c.selected}"/>    
                                    </apex:column>
                                    <apex:column >
                                        <apex:facet name="header"><apex:outputPanel >Name</apex:outputPanel></apex:facet>
                                        <apex:outputtext >{!c.name}</apex:outputtext>     
                                    </apex:column>
                                    <apex:column >
                                        <apex:facet name="header"><apex:outputPanel >Email</apex:outputPanel></apex:facet>
                                        <apex:outputtext >{!c.email}</apex:outputtext>    
                                    </apex:column>
                                </apex:pageBlockTable>                         
                            </apex:pageBlock>
                            
                            <div>&nbsp;</div>
                            <div>&nbsp;</div>
                            <div class="title"><b>Internal Users:</b></div>
                            <div>&nbsp;</div>
                            
                            <apex:pageBlock id="pbselect">
                                <div align="left">
                                    <apex:selectList id="myselect" value="{!internalUsersSelected}" multiselect="true" size="10">
                                        <apex:selectOptions value="{!items}"/>
                                    </apex:selectList>
                                </div>
                            </apex:pageBlock>          
                            
                            <div align="center">
                                <div>&nbsp;</div>		
                                <span id="proceed2" >
                                    <div class="slds-text-align--center">
                                        <a class="slds-button slds-button--brand" onclick="selectToEmail();">Proceed</a>
                                        <a class="slds-button slds-button--brand" onclick="back();">Go Back</a>
                                    </div>                
                                </span>
                            </div>    
                            
                        </apex:outputPanel>             
                    </apex:form>  
                </div>
                
                <apex:form id="form2" style="display:none;" > 
                    <apex:actionFunction name="CallApexMethodSendTemplates" action="{!sendTemplates}" oncomplete="hideSpinner()"/>
                    <apex:actionFunction name="CallApexMethodBack2" action="{!Back}" oncomplete="hideSpinner()"/>
                    
                    <apex:outputPanel id="emailOutputPanel">
                        
                        <table width="100%">
                            <b>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>To: </b></td>
                                    <td width="90%"><apex:outputText value="{!toEmails}" id="toEmailsOutPutText"/></td>            
                                </tr>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Cc: </b></td>
                                    <td width="90%"><apex:inputTextarea value="{!ccemails}" style="width:100%"/></td>             
                                </tr>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Email Template: </b></td>
                                    <td width="90%">
                                        <apex:selectList value="{!tmpltName}" id="Template" size="1" label="Email Template">
                                            <apex:selectOptions value="{!templates}"/>
                                            <apex:actionSupport event="onchange" action="{!populatetemplate}"/>
                                        </apex:selectList>                 
                                    </td>             
                                </tr>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Email Subject: </b></td>
                                    <td width="90%"><apex:inputText value="{!emailSubject}" style="width:100%" /></td>             
                                </tr>                         
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Email Body: </b></td>
                                    <td width="90%"><apex:inputtextarea value="{!emailBody}" id="Body1" styleClass="ckeditor"/></td>           
                                </tr>           
                            </b>                        
                        </table>
                        
                        <div class="slds-container--center slds-container--small">
                            <div>&nbsp;</div>
                            <div>&nbsp;</div>
                            <span id="send" >
                                <div class="slds-text-align--center">
                                    <a class="slds-button slds-button--brand" onclick="sendTemplates();">Send Email</a>
                                    <a class="slds-button slds-button--brand" onclick="back2();">Go Back</a>
                                </div>                
                            </span>                
                        </div>   
                        
                    </apex:outputPanel>       
                </apex:form>            
                <apex:outputPanel rendered="{!emailSelected}">
                    <script>
                    $j('form[id$=form2]').show();
                    </script>
                </apex:outputPanel>           
                
            </div>
            <!-- / PRIMARY CONTENT WRAPPER -->    
            
            
            <apex:outputPanel id="thePricePanel">        
                <!-- Custom error message -->
                <apex:outputpanel rendered="{!warningFlag}">
                    <div class="slds-notify_container">
                        <div class="slds-notify slds-notify--alert slds-theme--alert-texture" role="alert">
                            <button class="slds-button slds-notify__close slds-button--icon-inverse" title="Close">
                                <svg aria-hidden="true" class="slds-button__icon">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#close')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <span class="slds-assistive-text">Info</span>
                            <h2>{!warningMsg}</h2>
                        </div>
                        <p>&nbsp;</p>				  		  
                    </div>    
                </apex:outputpanel>
                <apex:outputpanel rendered="{!errorFlag}">
                    <div class="slds-notify_container">
                        <div class="slds-notify slds-notify--alert slds-theme--error slds-theme--alert-texture" role="alert">
                            <button class="slds-button slds-notify__close slds-button--icon-inverse" title="Close">
                                <svg aria-hidden="true" class="slds-button__icon">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#close')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <span class="slds-assistive-text">Error</span>
                            <h2>
                                <svg aria-hidden="true" class="slds-icon slds-icon--small slds-m-right--x-small">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#ban')}"></use>
                                </svg>{!errorMsg}</h2>
                        </div>
                        <p>&nbsp;</p>				  		  
                    </div>    
                </apex:outputpanel>
                <apex:outputpanel rendered="{!successFlag}">
                    <div class="slds-notify_container">
                        <div class="slds-notify slds-notify--alert slds-theme--success slds-theme--alert-texture" role="alert">
                            <button class="slds-button slds-notify__close slds-button--icon-inverse" title="Close">
                                <svg aria-hidden="true" class="slds-button__icon">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#close')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <span class="slds-assistive-text">Success</span>
                            <h2>
                                <svg aria-hidden="true" class="slds-icon slds-icon--small slds-m-right--x-small">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/custom-sprite/svg/symbols.svg#custom19')}"></use>		        
                                </svg>{!successMsg}</h2>
                        </div>
                        <p>&nbsp;</p>				  
                    </div>    
                </apex:outputpanel>
                <!-- Custom error message -->
            </apex:outputPanel>
            
            
        </div>
        
        <!-- / REQUIRED SLDS WRAPPER -->    
        <apex:includeScript value="{!$Resource.SLDSDynamicLookupScript}"/>
        
    </body>
    
</apex:page>
I created a "contacted" custom field that will say yes or no if a call is more than/less than 2 minutes. However, this field is in the Activities since call duration is there and call duration was the basis of the formula field for "contacted." The challenge is I need to bring this "contacted" field under Lead details but I cannot create a custom field since it will have syntax error: check spelling because call duration is not a field in Lead. How can I achieve this? Any ideas? 
I have a lookup relationship between Order Line and Contact Objects where Contact is the parent. I am writing a batch class which looks for certain criteria on Order Line and send email to Contacts excluding the duplicates. 

Right now I have  2 duplicate Order Lines for the Contact and the batch is supposed to send 1 email. But in this code, there are 3 emails sent out. Can someone help with this?
 
global class BatchSendEmails implements Database.Batchable<SObject>
{
global Database.QueryLocator start(Database.BatchableContext BC){
	return Database.getQueryLocator([select id,Contact__r.Email,Contact__c,Account__c from Order_Line__c 
                                     where Order__r.OrderApi__Date__c = LAST_N_DAYS:3]);
}
      
    global void execute (Database.BatchableContext BC, List<Order_Line__c> scope){
         List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
                                 List<String> email = new List<String>(); 
      
       List<Order_Line__c> sollist = [SELECT Id, Item__c, Contact__c,Order__c ,Contact__r.Email FROM Order_Line__c
        WHERE Order__r.Date__c = LAST_N_DAYS:3 AND Item__r.Name = 'Test'];
       
        Set<Id> solids = new Set<Id>();
        for(Order_Line__c ol : ollist){
            if(ol.id != null){
               olids.add(ol.Contact__c);
                system.debug('Added Contacts'+olids);
            }
        }
        
        AggregateResult[] groupedResults = [
        SELECT COUNT(Id) dups, Item__c, Contact__c,Order__c,Contact__r.Email
        FROM Order_Line__c
        WHERE Contact__c =:solids and Sales_Order__r.Date__c = LAST_N_DAYS:3 
        AND Item__r.Name = 'Test'    
        GROUP BY Item__c,Contact__c,Contact__r.Email,Order__c
         HAVING COUNT(Id) = 1];

        for(AggregateResult ar:groupedResults){
            String custid = (ID)ar.get('OrderApi__Contact__c');
            
          //	email.add(custid);
            
        List<Order_Line__c> sollist1 = [select id, Contact__r.Email,Order__c from Order_Line__c where id=: ar.Id limit 1];
            email.clear();
                email.add(ollist[0].OrderApi__Contact__r.Email); */
                                 List<String> ccemail = new List<String>();                                 
                                 ccemail.add('test@test.com');
    							 Contact c = [select id, Email from Contact where email <> null limit 1];
            try{                             
EmailTemplate templateId = [Select id from EmailTemplate where name = 'Email'];                                                   
                    system.debug(email);
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                 OrgWideEmailAddress owa = [select id, DisplayName, Address from OrgWideEmailAddress where address = 'testing@test.org' limit 1];
                                            system.debug(email.size());
                                            mail.setToAddresses(email);
                                            mail.setccAddresses(ccemail);
                                            mail.setOrgWideEmailAddressId(owa.id);
                                            mail.setTargetObjectId(c.Id);
           									mail.setTreatTargetObjectAsRecipient(false);
                                            mail.setTemplateID(templateId.Id); 
                                            mail.setSaveAsActivity(false); 
                                            mails.add(mail);
                                            system.debug(mail);
											
                          
                                 Messaging.sendEmail(mails);
            }catch(Exception e){
                system.debug('Exception occured' +e);
            }
                
    }
    }
        
    global void finish(Database.BatchableContext BC){
        
    }
}

 
  • November 28, 2018
  • Like
  • 1
Hi,

I previously had a Developer Account where I added an app (+- 6 months ago)

Now, when I try to log in on that account, it does not recognize me.
I tried to change my password. Salesforce says it sent me an email but it never arrives
I need to get the account back because all the work has already been done

It was a connected app

I had to create a new account under a different name just to be able to post here

Please help!

Thanks
 
Apex class :-

    global class BlockIEPolicyCondition implements TxnSecurity.PolicyCondition {
     public boolean evaluate(TxnSecurity.Event e) {
      List<User> users = [SELECT ProfileId FROM User WHERE Id = :e.UserId];
            String profileId = (String)users.get(0).get('ProfileId');
            List<Profile> profiles = [SELECT Name FROM Profile WHERE Id = :profileId];
            String profileName = (String)profiles.get(0).get('Name');
            LoginHistory eObj = [SELECT Browser FROM LoginHistory WHERE Id = :e.data.get('LoginHistoryId')];
            string profileName1 = '"' +profileName + '"';
            String P=system.label.BlockIEPolicyProfile;
    Boolean ismatch = p.contains(profileName1);
    if(ismatch){
      if(eObj.Browser == 'IE 11' || eObj.Browser == 'IE 10' || eObj.Browser == 'IE 9' || eObj.Browser == 'IE 8') {
       return true;
     }
     }
    
     return false; 
    }
     }
I want to achieve one requirement that when Manager A logs in to his Org, then he should see only employees under him not under any other manager using lookup. Can someone help me to achieve it?
Trying to test the App in Salesforce1 - When I click "App Launcher" and then Salesforce.com I get this error message: Python 2.5 is no longer available. Please refer to https://goo.gl/aESk5L for more information. 

Please help so I can move forward. Thank you!
I would like to connect my org to the external data using OData 4.0. I have been configured the External Data Source and automatically create External Object.
But there is a problem when creating record in the external object. After save button clicked, then error dialog appears, see image below:
User-added image
Actually the data that I inserted was successfully created, but I still meet this error.
FYI, I have been configured the primary key on OData configuration and MySQL database.
I have a custom object called 'Class_Allocation__c' and have a lookup field on this object called 'Related_Contact__c.  I need expert help to write a trigger on Class_Allocation__c to auto copy the contact Id into this field based on 'Student__Name__c' field on Class_Allocation__C and Student_id_from_Student_object__c (on contact)
  • September 15, 2017
  • Like
  • 1
Hello All,
I need to be able to update an Azure database from Salesforce.  Mainly for Cases and Lawyers, when cases or lawyers get updated I need to update the Azure DB as well.
I have seen the examples that talk about Azure to Salesforce, but I have not seen anything talking about Salesforce to Azure.
I have looked at both the Salesforce WCF and RestAPI https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/
But again these go from Azure to Salesforce.

Is it possible to go the other way?  What would be the best approch to this as I have seen many differnt approches to connecting.
We don't want any syncing of data, just to make a .NET call when Salesforce records get updates ect.. to update our Azure DB.
Thanks,
K.
HELP
I am a brand new admin and I know nothing about the admin side of SalesForce.  Can someone explain to me how I can check if my org is using a single sign-on or HTTPS call outs?   I need to know if the default certificate retirement on 8/7/17 will affect my org before 8/7/17.   I've been reading about it but none of it makes sense to me.
when I was installing an app from appexchange, I got the oauth error. My account is the type of 30-day-free. 

Error code : 1800。

who can help me?
  • May 17, 2017
  • Like
  • 1
I have following scenario and want to set up partner community license.

1. Have profile Customer service rep.
2. He has access to only Order object.

i know we need to set Account as partner and then contacts need to be enabled as partner and then create user and assign the partner community profile.
But if i have no.of users and want to assign them Partner Community License  and Customer service repprofile, how i should proceed to implement this?

Could you please suggest?
I found an error in a Trailhead, thought I'd help anyone else with the same problem. While trying to solve the Using Events to Add Markers to the Map section of the Build an Account Geolocation App trailhead I kept receiving an error about a null value. Debugging the code I found that the map variable in AccountMapController.js was null. This is because the accounts were loading faster than the Leaflet.js libraries. To get around this I changed the accountsLoaded function to recursively check if the map existed only add markers once the map was an object:

   if(component.get("v.map") != null){
            var map = component.get("v.map");

            alert(map);
            
            var accounts = event.getParam("accounts");
            for (var i=0; i<accounts.length; i++) {
                var account = accounts[i];
                var latLng = [account.Location__Latitude__s, account.Location__Longitude__s];
                L.marker(latLng, {account: account}).addTo(map);
            }  
        }else{
            accountsLoaded(component, event, null); 
        }

Hello,

I am creating my first visualforce email. 
 

I am trying to list the Opportuntiy; owner, contact roles, and  opportuntiy team all on email template. I been able to figure out how to add the opportunity contact roles but I can't figure out how to add the Opportuntiy Owner and Opportuntiy team through the email code. 

Please see my visualforce code below. Thanks in Advance! 

<messaging:emailTemplate subject="Testing VF" recipientType="User" relatedToType="Opportunity">
<messaging:plainTextEmailBody >
Hello,
 
This is testing the text section....
Opportunity Name: {!Relatedto.name}
Account: {!Relatedto.account.name}
Amount: {!Relatedto.amount}
 
Contact Roles for this Opportunity:
<apex:repeat value="{!RelatedTo.OpportunityContactRoles}" var="ContactRole">
{!ContactRole.Contact.Name} {!ContactRole.Contact.Email}
</apex:repeat>
<apex:repeat var="team" value="{!relatedTo.opportunityteammembers}">
</apex:repeat>

Thanks!
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

Hello Experts,

I have created excel workbook with help of VF page & XML Spreadsheet Reference. However I am not able to insert the company's logo in the first sheet. Can any one please suggest me how to insert an image in the sheet. Below is the VF code :

<apex:page controller="XYZ_controller" sidebar="false" showHeader="false"  contentType="application/vnd.ms-excel#{!object.Name__c}_Bid_Preview.xls" cache="true" action="{!changeProposalStatus}">
    {!xmlheader}
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
      xmlns:o="urn:schemas-microsoft-com:office:office"
      xmlns:x="urn:schemas-microsoft-com:office:excel"
      xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
      xmlns:html="http://www.w3.org/TR/REC-html40">
         
        <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
            <AllowPNG/>
        </OfficeDocumentSettings>
        
        <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
            <WindowHeight>7845</WindowHeight>
            <WindowWidth>12045</WindowWidth>
            <WindowTopX>630</WindowTopX>
            <WindowTopY>630</WindowTopY>
            <ProtectStructure>False</ProtectStructure>
            <ProtectWindows>False</ProtectWindows>
        </ExcelWorkbook>

<Worksheet ss:Name="Cover">
  <Table>
  <Column ss:Width="70" ss:StyleId="s_plain"/>
  <Column ss:Width="100" ss:StyleId="s_plain"/>
  <Column ss:Width="100" ss:StyleId="s_plain"/>
  <Column ss:Width="250" ss:StyleId="s_plain"/>

    <Row>
        <Cell  ss:Index="2" ss:StyleID="s9_confidential" ss:MergeAcross="3"><Data ss:Type="String">CONFIDENTIAL</Data></Cell>
    </Row>
    <Row></Row>
      
<I NEED TO INSERT AN IMAGE HERE i.e COMPANY'S LOGO> (For testing, any logo will do)

<Row ss:AutoFitHeight="1">
        <Cell  ss:Index="2" ss:StyleID="s_cover_heading" ss:MergeAcross="3"><Data ss:Type="String">Test Data</Data></Cell>
    </Row>
    <Row>
        <Cell  ss:Index="2" ss:StyleID="s_cover_heading_lab" ss:MergeAcross="3"><Data ss:Type="String">Test Data</Data></Cell>
    </Row>
    <Row></Row>
    
</Worksheet> 
   </Workbook>  
</apex:page>
    
I request your swift support and help on this. Your efforts would be greatly appreciated. Thanks in advance...!!
  • July 21, 2016
  • Like
  • 1