• ALL STAR
  • 11211 Points
  • Member since 

  • Chatter
    Feed
  • 370
    Best Answers
  • 0
    Likes Received
  • 12
    Likes Given
  • 0
    Questions
  • 3365
    Replies
I need help with Process Automation Superbadge Challenge # 5.
I cannot get through this challenge. I am keep getting error messages. When I activate the process It gives me following error
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. 
First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You Need Approval From Manager.: []


Validation Rule: for high value opportunities. 
Amount  > 100000( this is my validation rule)


I also try this validation rule as well but got the different error:
AND( 
IsClosed = TRUE, 
Amount > 100000, 
Approved__c <> TRUE 
)

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3011N000000EJ8H. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []

When I Deactivate the process:
I got this error
Challenge Not yet complete... here's what's wrong: 
A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'.

This doesnt make any sense to me because in my ORG I was able to verify the challenge. It did created the Robot Setup Record an also created the Task for the Opprotunity Owner.
Also I am getting this error message i my email
Error element myRule_9_A1 (FlowActionCall).
This approval request requires the next approver to be determined by the Manager field. This value is empty. Please contact your administrator for more information. 
What I am getting this error messages there is something wrong with the Approval Process or the Validation Rule. But I dnt know how to fix this.
One thing I have noticed that When the Opportunity is created with the Stage Negotiation it give me following error in my org.
This is when the Opp stage is Negotiation.
User-added image

User-added image

Here is my Approval Process:
User-added image

User-added image

User-added image

 


 

Hi Team,

Not able to verify the step 5 of the BUSINESS ADMINISTRATION SPECIALIST SUPERBADGE because of the following error:
Challenge Not yet complete... here's what's wrong:&nbsp; Unwanted fields are still present in the 'Residential Opportunity Page' layout.

I cloned the Utility layout as "Residential Opportunity Page" and modified as per the requirement but still facing the same issue.

Please share some details regarding this, your support will be very helpful for me.

Thanks!
I'm writing my first visualforce email template and have successfully displayed everything as needed, except the recipient name. I am sending this via a workflow using an email alert with my visualforce template. The list of recipients (contact records) are pulled as individual lookup field values on the record I am using to populate my email with.
When my workflow fires, the template gets sent to the correct Contact email addresses, I am just not able to get the Contact Name to display in the email. My email just comes out as "Dear  ,"
I'm not sure what I am missing here or where I might have messed up, any help/suggestions would be greatly appreciated!

Here is my template:
<messaging:emailTemplate recipientType="Contact"
relatedToType="Project__c"
subject="Status Report {!relatedTo.name}"

replyTo="explore@primerosystems.com">
<messaging:htmlEmailBody >
<html>

<body>

<p>Dear {!recipient.name},</p>
<p>{!relatedTo.Personal_Note_to_Customer__c}</p>
<p>Below is our status report for {!relatedTo.name} for the week ending .</p>

<table border="0" >
<tr>
<th>Initiative</th>
<th>Blocking Items</th>
<th>Comments</th>
<th>On track with hours?</th>
<th>Comments</th>
<th>Other concerns?</th>
<th>Comments</th>
<th>Sprint/Schedule Status</th>
<th>Comments</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.Initiatives__r}">
<tr>
<td>{!cx.Customer_Name__c}</td>
<td>{!cx.CSBlocking_Items__c}</td>
<td>{!cx.CSComments_Blocking_Items__c}</td>
<td>{!cx.CSOn_track_with_hours__c}</td>
<td>{!cx.CSComments_On_Track__c}</td>
<td>{!cx.CSOther_Concerns__c}</td>
<td>{!cx.CSComments_Other_Concerns__c}</td>
<td>{!cx.CSSprint_Schedule__c}</td>
<td>{!cx.CSComments_Sprint_Schedule__c}</td>
</tr>

</apex:repeat>
</table>

<p/>
<center>

If you have any suggestions as to content that would be more beneficial to you or adjustment of the frequency of our status emails to you, please let us know so that we may adjust to suit your needs better.

</center>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
Hi, When checking the challenge number 6 in the Super Badge Lightning Experience Specialist, I am getting this salesforce internal error.
When i tested the functinality in the trailhead playground manually, it is working as expected.
Let me know if there is any workaround for this.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Delete failed. First exception on row 0 with id 0031N00001JwOMWQA3; first error: DELETE_FAILED, Your attempt to delete Sam the ninja could not be completed because it is associated with the following adventure packages.: null, null : []
Hello everyone,

I am trying to verify the Trailhead challenge found at https://trailhead.salesforce.com/projects/create-reports-and-dashboards-for-sales-and-marketing-managers/steps/visualize-your-data-with-conditional-highlighting-report-charts-and-dashboards?trailmix_creator_id=00550000006yDdKAAU&trailmix_id=prepare-for-your-salesforce-administrator-credential and I keep geting an error when verifying. The error in its netirety is copied below. Can anyone advise what I'm doing wrong or what I'm missing? I've spun up a new org and gone through the remainder of the module to get the data back in, but I keep getting the same type of error. 

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: PARKGGFT
Hey there,

I am building a custom 'Customizable Forecast' tab from scratch using Visualforce and a custom controller to add some new features. One of my requirements is to forecast off of the 'forecast heirarchy' defined in the Setup->Build->Customize->Forecasts (Customizable)->Forecasts Hierarchy. Until now, I've used the UserRoleId Field to find direct reports and subordinate roles/users. How can I use SOQL to query the Forecast Heirarchy for Direct Reports and  subordinate users instead? I can not find any info on an object that contains this information.



 
I am new to salesforce, I heard about Chargify framework. We need http call outs and lots of thing. Can anybody explain what excatly it is and what do we need to set it up. Please provide a simple example to describe it.
Hello,
I am facing a problem with challenge 5 of the Superbadge. Error is:

Challenge Not yet complete... here's what's wrong: 
Ensure that you perform a query to verify the Save button works.

I have saved the 5 records by populating them and trying to work on the save button but unable to catch the error.
Below is my code of Product2Tests...Any help is appreciated.

@isTest (seeAllData=false)
private class Product2Tests {

    /**
     * @name product2Extension_UnitTest
     * @description UnitTest for product2Extension
    **/
    static TestMethod void Product2Extension_UnitTest(){
        Test.startTest();
           PageReference pageRef = Page.Product2New;
           Test.setCurrentPage(pageRef);
          
        
        ApexPages.StandardController controller =new Apexpages.StandardController(new Product2());
            Product2Extension ext = new Product2Extension(controller);
            ext.addRows();
            ext.save();
            System.assertEquals(Product2Extension.productsToInsert.size(), Constants.DEFAULT_ROWS);
        
         
         //if(addValue.equals('Add'))
                  //System.assertEquals(Product2Extension.productsToInsert.size(), 2*Constants.DEFAULT_ROWS);
        
        Integer i=0;
        for(Product2Extension.ProductWrapper pr: Product2Extension.productsToInsert){
            if (String.isBlank(pr.productRecord.Name) || pr.productRecord.Name==null){
                pr.productRecord.Name='Product'+i;
            }
               
            if(String.isBlank(pr.productRecord.Family) ||  pr.productRecord.Family==null ){
                pr.productRecord.Family='Side';
            }
                  
            if(pr.productRecord.IsActive==false){
                pr.productRecord.IsActive=true;
            }
            if(pr.productRecord.Initial_Inventory__c==null){
                pr.productRecord.Initial_Inventory__c=10;
            }
            i++;
                   
        }
        PageReference p=ext.save();
        
        System.assertEquals(Product2Extension.productsToInsert.size(), 5);
        System.debug(Product2Extension.productsToInsert.size());
        
        Test.stopTest();
    }

}
 
While developing a lightning component I wanted to access a sforce object FiscalYearSetting from Controller. Will it work when someone else uses my component?
 
I'm having a problem with my code because I need to get a list of records of a dynamic type, and that is working alright, but then I need to use some of the fields and can't reach them, giving me the error 'Variable does not exist".
Here is a sample of the code:
String queryString = 'select Id, '+ camposMainObj.get(0) +', '+ camposMainObj.get(1)+', '+ camposMainObj.get(2) +', test__c from ' +sObjName+ ' where Id = \''+recordId+'\'';
 List<sObject> obj = database.query(queryString); system.debug('sObjName ::::::::: '+obj);
 string listType = 'List<'+sObjName+'>';
 List<sObject> castRecords = (List<sObject>)Type.forName(listType).newInstance();
 castRecords.addAll(obj);
 system.debug(castRecords);
 ChartObject__c co = new ChartObject__c();
 co.Pai__c = castRecords[0].Id;
co.PaiName__c = castRecords[0].Name;
 co.PaiEmail__c = castRecords[0].Email__c;
 co.PaiPhone__c = castRecords[0].Phone__c;


The variable 'sObjName' contains the correct object type (in this case Pai__c).
Only the Id is recognized. The result query looks like this:
(Pai__c:{Id=a070O00001uWD58QAG, Name=pai1, Phone__c=910987654, Email__c=pai1@mail.com, test__c=asdf}

So I can get every field from the query, but can only get the Id on the new object and it matches the queried one. The Name, Phone__c, Email__c, etc give me that error. I tried many solutions but can't seem to make it work.

Any help is appreciated.

Thank you in advance.
I'm sure I have this right and everthing works perfectly when I create records but whenever I submit I get "Looks like something went wrong, please try again later."

I've searched round the web and confirmed my solution is the same as others (it is) but although the records update correctly, I can't get Trailhead to agree.

Is anyone else having any trouble?
Hi All,

I want all the index fields of an particular object in apex. I have searched throught the Schema describe but couldn't find a way to identify the field as index. Please let me know if somebody have any idea on this.

Regards,
Numaan

User-added image

Getting this error which is referencing a report from a previous step and the 'Close Date' by Calendar Month has no revevancy to that report. I believe the validation is not looking for the correct report here. Any suggestions on getting through this? I've re-done the whole step to try again and it still returns this error.

I am in the Project "Build a Discount Approval Process" at Step "Create Initial Submission Actions". I have now triple and quadruple checked my data but I can't seem to get ahead.

There error message I am receiving says: "Challenge Not yet complete... here's what's wrong: 
The initial submission action is not correct for the 'Discount Approval Process'. VP approval does not appear to be required for discounts over 40% for step #2 in the process."

However, IT IS! :-)

I need help.
Background info: I have been an admin for some time and am quite comfortable with SFDC, however, approvals and me don't get on well.

Thannk you all ahead of time...
I have a right side bar in the console layout. Can we do translation to this right side section labels?
 
Hi, I am using this sample app https://github.com/pozil/salesforce-react-integration to create a React app connected to Salesforce. 

I have created a Connected app inside my Salesforce, enabled OAuth and added a callback Uri that is identical to the one in the sample app. I have also replaced the consumer key and secret in the sample app for the ones in my SF Connected app, yet after entering and submitting my Salesforce login details, net::ERR_CONNECTION_REFUSED is still being thrown on the http://localhost:3000/auth/callback. I was advised that it might have something to do with connecting with older TLS version.
Can anyone suggest what would be required to allow Text Area Long as filters in List View?
Basically client is seeking to see a List View that renders with proper Wrap text  (not just limited to 3 lines) for Text Are Long and use Text Area Long as filters.

I take a bit of development is required. Could anyone list in bullets point the key components/pages to develop for this? 
Thanks
Leonardo Girgenti 
Hey,

The org I usually use to complete trailhead challenges is throwing an error when trying to create the dashboard for this module. It suggested I create a new org, which I did and if the same error popped up, post this code, GHXBFIML.

I created all the reports according to the instructions in my old org. Only created reports to generate numbers with viable metrics for the new org. Same error happened both times.
I just noticed that one of my queries is no longer working in my sandbox after the Spring '18 has been applied to that sandbox.

In particular this is the error SF is returning:
[object Object]: 'mi') < 55 ORDER BY DISTANCE(someObject__c.Geo_Location__c, GEOLOCATION(33.4589034 ^ ERROR at Row:1:Column:199 field 'Geo_Location__c' can not be sorted in a query call

The WHERE clause in my query breaks it and here's what that where clause looks like:
DISTANCE(someObject__c.Geo_Location__c, GEOLOCATION(33.4589034, -112.0889634), 'mi') < 55 ORDER BY DISTANCE(someObject__c.Geo_Location__c, GEOLOCATION(33.4589034, -112.0889634), 'mi')

The Geo_Location__c field is a geolocation type field. This is still working in Winter '18.
Do you know why this change was applied and if there's a workaround this?

Also if you look at SF's documentation they provide a very similar example in their code: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_geolocate.htm
we are getting error . when i open https://dev6-mdlive.cs91.force.com/BrokerPortal/ then we getting error  Bad Message 431
reason: Request Header Fields Too Large and also

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 1248621760-22363 (792711711)

please give me solution
username :sonuiec@gmail.com
 
I need help with Process Automation Superbadge Challenge # 5.
I cannot get through this challenge. I am keep getting error messages. When I activate the process It gives me following error
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. 
First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You Need Approval From Manager.: []


Validation Rule: for high value opportunities. 
Amount  > 100000( this is my validation rule)


I also try this validation rule as well but got the different error:
AND( 
IsClosed = TRUE, 
Amount > 100000, 
Approved__c <> TRUE 
)

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3011N000000EJ8H. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []

When I Deactivate the process:
I got this error
Challenge Not yet complete... here's what's wrong: 
A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'.

This doesnt make any sense to me because in my ORG I was able to verify the challenge. It did created the Robot Setup Record an also created the Task for the Opprotunity Owner.
Also I am getting this error message i my email
Error element myRule_9_A1 (FlowActionCall).
This approval request requires the next approver to be determined by the Manager field. This value is empty. Please contact your administrator for more information. 
What I am getting this error messages there is something wrong with the Approval Process or the Validation Rule. But I dnt know how to fix this.
One thing I have noticed that When the Opportunity is created with the Stage Negotiation it give me following error in my org.
This is when the Opp stage is Negotiation.
User-added image

User-added image

Here is my Approval Process:
User-added image

User-added image

User-added image

 


 
Hi All,

I have added all the Field References in the process builder, but I don't get the reference to [OpportunityLineItem].Id in the picklist.

Field not appearing in the picklist

Can anyone help me regarding this?

Thanks and Regards
Vijay

Hi Team,
FYI Atteched file,I am not able to click "check challenge button" due to disable. 
I have cleared cache and connect to org also.
Can you please help on the same how to enable .

Thanks in advance.
User-added image

Hi Team,

Not able to verify the step 5 of the BUSINESS ADMINISTRATION SPECIALIST SUPERBADGE because of the following error:
Challenge Not yet complete... here's what's wrong:&nbsp; Unwanted fields are still present in the 'Residential Opportunity Page' layout.

I cloned the Utility layout as "Residential Opportunity Page" and modified as per the requirement but still facing the same issue.

Please share some details regarding this, your support will be very helpful for me.

Thanks!
Hi All,

HTML Email Status Related list and send email button not visible for partner community users of Lead object in salesforce classic?
HTML Email Status Related list and send email button not visible for partner community users as well as normal users of Lead object in Lightning Experience?

Thanks,
Malakondaiah
Hi, I am trying to write the apex rest outbound program for below apex inbound rest service. Can you please help me on writing the outbound apex rest service. Thanks..

Apex inbound service:

@RestResource(urlMapping='/RestServiceContactCreation/*')

global class RestServiceContactCreation{
    global class ContactRequestDetails{
        webservice String contactLastName;
    }
    
    global class ContactResponseDetails{
        webservice String contactLastName;
        webservice String contactCreationStatus;
    }
    
    global static ContactResponseDetails insertContactDetails(ContactRequestDetails contRequest){
        ContactResponseDetails contResp = new ContactResponseDetails();
            Contact contactObject = new Contact();
            contactObject.LastName = contRequest.contactLastName;
            try
            {
                insert contactObject;
                contResp.contactCreationStatus = 'Contact is created successfully....!!!!! Contact Id: ' +contactObject.Id;
                return contResp;
                }
            catch(Exception ex){
                String errorMessage = 'Error occurred' +ex.getMessage();
                contResp.contactCreationStatus = errorMessage;
                return contResp;
            }
    }
    
    @HttpPost    
    global static ContactResponseDetails createContact(ContactRequestDetails req){
        ContactResponseDetails res = insertContactDetails(req);
        return res;
    }
}

Apex rest outbound:

public class ContactCreationRestservice_Outbound{

    public String response{get;set;}
    
    public class ContactRequestDetails{
        String contactLastName;
    }
    
    public PageReference CreateContact() {
        ContactRequestDetails contReq = new ContactRequestDetails();
        //find access token using Auth 2.0 
        String Access_Token='access token';

        Httprequest req=new httprequest();
        String domainName= '<domainName>';
        String endPointURL='https://domainName-dev-ed.my.salesforce.com/services/apexrest/RestServiceContactCreation/';
        req.setendpoint(endPointURL);
        req.setHeader('Content-Type', 'application/xml; charset=utf-8');
        req.setBody('<?xml version="1.0" encoding="UTF-8" ?><request><name>'+contactLastName+'</name></request>');
        req.setmethod('POST');
        
        req.setHeader('Authorization','Authorization: Bearer '+Access_Token);
        Http http = new Http();
        HTTPResponse res = http.send(req);
        response=res.getbody();
        System.debug('****************res.getStatusCode();'+res.getStatusCode());
        System.debug('****************res.getbody();'+res.getbody());
        return null;
    }
}
I am stuck at the last Step ! Can somebody help here?

Superbadge - Advanced Apex Specialist - Step 8

 
  • January 04, 2018
  • Like
  • 0
I got stuck in that error, can someone help me
Error step 7
 
OrderTests Class

@isTest
public class OrderTests {
    
    
    
    public  static Map<String, List<Object>> testData;  
    
    @testSetup 
    static void SetupTestData (){
        
        testData = TestDataFactory.InsertTestData(5);
        
    }
    
      @isTest static void OrderExtension_UnitTest() {
	
	 Order rec = [select id, Status from Order limit 1];
        PageReference pageRef = Page.OrderEdit;
        
        //Test.setCurrentPage(pageRef);
        pageRef.getParameters().put('id',rec.id);
        Test.setCurrentPage(pageRef);
        SetupTestData();
         ApexPages.StandardController sc = new ApexPages.standardController(rec);
        OrderExtension ext = new OrderExtension(sc);        
       	System.assertEquals(Constants.DEFAULT_ROWS, ext.orderItemList.size());
        ext.OnFieldChange();
        ext.SelectFamily();
        ext.Save();
        ext.First();
        ext.Next();
        ext.Previous();
        ext.Last();
        ext.GetHasPrevious();
        ext.GetHasNext();
        ext.GetTotalPages();
        ext.GetPageNumber();
        List<SelectOption> options = ext.GetFamilyOptions();
    }
    
    @isTest
    static void OrderUpdate_UnitTest (){
        Test.startTest();
        Order rec = [select id, Status from Order limit 1];
        Product2 prod = [SELECT Family,Id,Name,Quantity_Ordered__c,Quantity_Remaining__c FROM Product2 limit 1];
        system.debug('kkk '+prod.Quantity_Ordered__c);
        rec.status = constants.ACTIVATED_ORDER_STATUS;
        Update rec;
        Product2 updatedprod = [SELECT Family,Id,Name,Quantity_Ordered__c,Quantity_Remaining__c FROM Product2 limit 1];
        
        system.debug('kkk '+updatedprod.Quantity_Ordered__c);
        TestDataFactory.VerifyQuantityOrdered(prod,updatedprod,constants.DEFAULT_ROWS);
        Test.stopTest();
    }
    
    
   
    
    
   
}
 
Order Extension Class

/**
 * @name OrderExtension
 * @description This class is provided for you to facilitate the Super Badge
**/
public class OrderExtension {

    public Order orderRecord {get;set;}
    public List<OrderItem> orderItemList {get;set;}
    public String selectedFamily {get;set;}
    public List<chartHelper.chartData> pieData {get;set;}
    public Decimal total {get;set;}
  
    public Map<Id,OrderItem> orderItemMap;
    ApexPages.StandardSetController standardSetController;

    public OrderExtension(ApexPages.StandardController standardController){
        orderRecord = (Order)standardController.getRecord();
        orderItemMap = new Map<id,OrderItem>();
        if ( orderRecord.Id != null ){
            orderRecord = queryOrderRecord(orderRecord.Id);
        }
        orderItemList = new List<OrderItem>();
        OrderItemList.addAll(orderRecord.OrderItems);
        set<Id> p2ids = new set<Id>();
        for(OrderItem oitem : OrderItemList){
            p2ids.add(oitem.PriceBookEntryId);
        }
        List<PriceBookEntry> p2List = new List<PriceBookEntry>();
        if(p2Ids.size()>0){
            p2List = [select id from PriceBookEntry where id IN: p2Ids];
        }
        standardSetController= new ApexPages.StandardSetController(p2List);
        standardSetController.setPageSize(Constants.DEFAULT_ROWS);
     
    }
    

    public void resetstandardSetController() {
        String query = 'SELECT Name, Product2.Family, Product2.Name, Product2Id, UnitPrice, Product2.Quantity_Remaining__c'
                     + '  FROM PricebookEntry WHERE IsActive = TRUE';

        if (selectedFamily != null && selectedFamily != Constants.SELECT_ONE) {
            query += ' AND Product2.Family = \'' + selectedFamily + '\'';
        }
        query += ' ORDER BY Name';

        standardSetController= new ApexPages.StandardSetController(Database.getQueryLocator(query));
        standardSetController.setPageSize(Constants.DEFAULT_ROWS);
    }

    //ToDo: Implement your own method to populate orderItemList
    //  that you will call after pagination and/or family selection
   public void GetOrderItems() {
        orderItemList = new List<OrderItem>();
        for (SObject obj : standardSetController.getRecords()) {
            PricebookEntry pbe = (PricebookEntry)obj;

            if (orderItemMap.containsKey(pbe.Product2Id)) {
                orderItemList.add(orderItemMap.get(pbe.Product2Id));
            } else {
                orderItemList.add(new OrderItem(
                    PricebookEntryId=pbe.Id,
                    Product2Id=pbe.Product2Id,
                    UnitPrice=pbe.UnitPrice,
                    Quantity=0,
                    Product2=pbe.Product2
                ));
            }
        }
    }


    /**
     * @name OnFieldChange
     * @description
    **/
    public void onFieldChange(){
        //ToDo: Implement logic to store the values changed on the page
        for (OrderItem oi : orderItemList) {
            orderItemMap.put(oi.Product2Id, oi);
        }

        //      and populate pieData
        pieData = null;
        total = 0;
        for (OrderItem oi : orderItemMap.values()) {
            if (oi.Quantity > 0) {
                if (null == pieData) {
                    pieData = new List<chartHelper.ChartData>();
                }
                pieData.add(new chartHelper.ChartData(oi.Product2.Name, oi.Quantity * oi.UnitPrice));
                //      and populate total
                total += oi.UnitPrice * oi.Quantity;
            }

        }

    }

    /**
     * @name SelectFamily
     * @description
    **/
    public void selectFamily(){
        //ToDo: Implement logic to filter based on the selected product family
        resetstandardSetController();
        GetOrderItems();
    }

    /**
     * @name Save
     * @description
    **/
    public void save(){
        //ToDo: Implement logic to save the Order and populated OrderItems
        System.Savepoint sp = Database.setSavepoint();
        try {
            if (null == orderRecord.Pricebook2Id) {
                orderRecord.Pricebook2Id = Constants.STANDARD_PRICEBOOK_ID;
            }
            upsert orderRecord;

            List<OrderItem> orderItemsToUpsert = new List<OrderItem>();
            List<OrderItem> orderItemsToDelete = new List<OrderItem>();
            system.debug('@@@@@@@@@@@@@@@#######'+orderItemMap.values());
            for (OrderItem oi : orderItemMap.values()) {
                if (oi.Quantity > 0) {
                    if (null == oi.OrderId) {
                        oi.OrderId = orderRecord.Id;
                    }
                    orderItemsToUpsert.add(oi);
                } else if (oi.Id != null) {
                    orderItemsToDelete.add(oi);
                }
            }
            if(orderItemsToUpsert.size()>0)
            upsert orderItemsToUpsert;
            if(orderItemsToDelete.size()>0)
            delete orderItemsToDelete;
        } catch (Exception e) {
            Database.rollback(sp);
            apexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO,Constants.ERROR_MESSAGE));
        }
    }


    /**
     * @name First
     * @description
    **/
    public void First(){      
       standardSetController.first();
       GetOrderItems();
    }

    /**
     * @name Next
     * @description
    **/
    public void Next(){   
       standardSetController.next();
        GetOrderItems();
    }

    /**
     * @name Previous
     * @description
    **/
    public void Previous(){      
        standardSetController.previous();
        GetOrderItems();
    }

    /**
     * @name Last
     * @description
    **/
    public void Last(){
        standardSetController.last();
        GetOrderItems();
    }
  /**
     * @name GetHasPrevious
     * @description
    **/
   public Boolean GetHasPrevious(){
        return standardSetController.gethasprevious();
    }

    /**
     * @name GetHasNext
     * @description
    **/
   public Boolean GetHasNext(){
        return standardSetController.gethasnext();
    }

    /**
     * @name GetTotalPages
     * @description
    **/
   public Integer GetTotalPages(){
       System.debug('=====' + (Integer)Math.ceil(standardSetController.GetResultSize() / (Decimal)Constants.DEFAULT_ROWS));
        return (Integer)Math.ceil(standardSetController.GetResultSize() / (Decimal)Constants.DEFAULT_ROWS);
    }

    /**
    * @name GetPageNumber
     * @description
    **/
    public Integer GetPageNumber(){
        return standardSetController.getpagenumber();
    }

    /**
     * @name GetFamilyOptions
     * @description
    **/
    public List<SelectOption> GetFamilyOptions() {
        List<SelectOption> options = new List<SelectOption>{
            new SelectOption(Constants.SELECT_ONE, Constants.SELECT_ONE)
        };

        for (Schema.PicklistEntry ple : Constants.PRODUCT_FAMILY) {
            options.add(new SelectOption(ple.getValue(), ple.getLabel()));
        }
        return options;
    }
    

    /**
     * @name QueryOrderRecord
     * @description
    **/
    public static Order QueryOrderRecord(Id orderId){
     return [
        SELECT Id, AccountId, EffectiveDate, Name, Status, Pricebook2Id,
                (
                    SELECT Id, OrderId, Quantity, UnitPrice, PricebookEntryId, Product2Id,
                         Product2.Name, Product2.Family, Product2.Quantity_Remaining__c
                    FROM OrderItems where PricebookEntry.isActive = true
                )
            FROM Order WHERE Id = :orderId
            ];
    }

}

 
I'm writing my first visualforce email template and have successfully displayed everything as needed, except the recipient name. I am sending this via a workflow using an email alert with my visualforce template. The list of recipients (contact records) are pulled as individual lookup field values on the record I am using to populate my email with.
When my workflow fires, the template gets sent to the correct Contact email addresses, I am just not able to get the Contact Name to display in the email. My email just comes out as "Dear  ,"
I'm not sure what I am missing here or where I might have messed up, any help/suggestions would be greatly appreciated!

Here is my template:
<messaging:emailTemplate recipientType="Contact"
relatedToType="Project__c"
subject="Status Report {!relatedTo.name}"

replyTo="explore@primerosystems.com">
<messaging:htmlEmailBody >
<html>

<body>

<p>Dear {!recipient.name},</p>
<p>{!relatedTo.Personal_Note_to_Customer__c}</p>
<p>Below is our status report for {!relatedTo.name} for the week ending .</p>

<table border="0" >
<tr>
<th>Initiative</th>
<th>Blocking Items</th>
<th>Comments</th>
<th>On track with hours?</th>
<th>Comments</th>
<th>Other concerns?</th>
<th>Comments</th>
<th>Sprint/Schedule Status</th>
<th>Comments</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.Initiatives__r}">
<tr>
<td>{!cx.Customer_Name__c}</td>
<td>{!cx.CSBlocking_Items__c}</td>
<td>{!cx.CSComments_Blocking_Items__c}</td>
<td>{!cx.CSOn_track_with_hours__c}</td>
<td>{!cx.CSComments_On_Track__c}</td>
<td>{!cx.CSOther_Concerns__c}</td>
<td>{!cx.CSComments_Other_Concerns__c}</td>
<td>{!cx.CSSprint_Schedule__c}</td>
<td>{!cx.CSComments_Sprint_Schedule__c}</td>
</tr>

</apex:repeat>
</table>

<p/>
<center>

If you have any suggestions as to content that would be more beneficial to you or adjustment of the frequency of our status emails to you, please let us know so that we may adjust to suit your needs better.

</center>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
I'm trying to complete the "Configure a Salesforce Console" module.  I'm at the step for "Add the Service Cloud User License to Users".  I have no clue where to go to do these steps?  How do I get to my "test" platform so I can follow these instructions?
Hi all,

is there a way tos etup a validation rule on locked records (via approval proces), that would allow certain group or users to edit. thank you
  • January 04, 2018
  • Like
  • 0
Hi,

I'm trying to create a new connected app and I'm getting `Insufficient privileges`, my user's role contains `Customize Application` and `Manage Connected Apps`, so I'm not sure what else can raise this error or if someone else is having the same issue.

Thanks
I completed Reports and Dashboards superbadge. However my points were not added. Anyone know where should I go for help?
I'm running a GET request to the tooling API at https://instance-name.number.my.salesforce.com/services/data/v37.0/tooling/sobjects/ with a non administrator account. This request only returns some objects and is missing all of our standard objects from the response. 

GET request to https://instance-name.number.my.salesforce.com/services/data/v37.0/tooling/sobjects/CustomField/sfidofobject returns:
[
    {
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
]

Running the same queries with a system administrator account returns the correct responses with standard objects included. The non-admin account has View All permission to the object being requested.
Hello everyone,
I just had set up Lightning Sync (with Google Calendar) and it works pretty well with events manually created by user. But it refuse to synchronize events created from apex code.

For example if I create new event from anonimous apex, or process builder for some user – it will appear in his calendar on Salesforce org, but it would not be synchronized with users Google calendar.
But if user select this new event, click edit and then save (even without changes) – this event will be synchronized just us other manually created events.

Lightning Sync Error Report doesn't show any errors (events created by user sunc just fine).

Any ideas how to sync "syntetic" events?
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