• Internal Partner
  • NEWBIE
  • 60 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 63
    Questions
  • 46
    Replies
Hi all,

is it possible not to hard code if you want to add a link to a report in a rich-text component in a Lightning Record Page?.
We want to add a link to a report as a rich-text component under another components on the right side. Can we use custom labels in the URL for a richt-text component?.
I have read every possible thread where some have or had the problem that some fields are not being displayed for reports even if the System Admin has Edit permissions on the field or the field is on the layout of the object.

I have built a report with Account as the primary object and following relationships:
User-added image

Account and Object B have a Master-Detail relationship. Object B and C as well. B and C are custom objects.
I would like to add a custom field which is in the object C, say, Name. Name__c is a text field, a custom field.
When building the report type I don't have any chance to add Name__c to the report type. It appears on the right side under C fields as greyed out. No chance to add it. I don't know why.

The field is visible to the Admin, also added on the page layout of the C object. The field is also not blocked via permission set.

But when I build a report type having B and C, the Name__c field appears for selection.

Can someone explain to me what is going on here?
Hi all,

We are using Queues in order to assign Cases first to Queues and when someone is a queue member he/she can own the case.
You have the possibility to send emails on Cases.

So, now we have the requirement to set the From field of an Email to the Queue email address of the Case Owner per default:

User-added image

For example, let's say we have a Case and the Case Owner is Test User X. This user belongs to the Queue USA. So, when the case owner wants to send an email the From field should be set to the Queue Email Address of the Queue he/she belongs, e.g. TestEmail2Case@queue-email.com.

The same way if the Case Owner is a Queue, the From field on an Email should be set to the Queue email address per default.

I was trying to implement this on the Email Action on the Case object creating predefined values there.

In order to set the Queue email address for the From field I built this formula:
 
IF(OR(NOT(ISBLANK(Case.Owner:User.Id)),NOT(ISBLANK(Case.Owner:Queue.Id))) , Case.Owner:Queue.QueueEmail, 'None')
This is unfortunately not working, maybe something in the logic is wrong.

If I hard code using this formula for example, it works but only using Queue as a condition:
 
CASE(Case.Owner:Queue.QueueName, 
"USA","TestEmail2Case@queue-email.com",  
"Canada","TestEmail2Case2@queue-email.com",
"None")

I am using the email addresses verified in the Email-To-Case settings for the Queues.
Does anybody have an idea how to adjust the formula according to the described requirement? (hopefully understandable)
 
Hi all,

I am using a reference to an image in an URL which is in a Sandbox. This looks like this for example in a HTML email template:
 
<img align="center" alt="Image" border="0" class="center autowidth" src="https://c.cs87.content.force.com/servlet/servlet.ImageServer?id=0156E000000dQ0F&oid=00D6E0000004yxD&lastMod=1573484239001" style="outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; clear: both; border: 0; height: auto; float: none; width: 100%; max-width: 300px; display: block;" title="Image" width="300"/>
Which are the risks to use the same URL in the same email template in another Sandbox or even in the Production environment?. which are best practices?
 
Hi all,

I built a report with report type Opportunities and would like to add a filter saying Close Date <= 31.12.CURRENT YEAR. For this year it would be <= 31.12.2019.

I found in the Salesforce Documentation the following statement:

For example, instead of filtering on Close Date greater than Jan 1, 2017, filter using a relative date: Close Date equals this year.

Attached the link to the documentation:

https://help.salesforce.com/articleView?id=filter_dates_relative.htm&type=5

If I use Close Date <= THIS YEAR I am wondering if this is the correct solution, as THIS YEAR means "Starts at 12:00:00 AM on January 1 of the current year and continues through the end of December 31 of the current year". I just want to tell Salesforce, I want all records with Closed Date <= LAST DAY OF THE CURRENT YEAR without using any formulas.

If using formulas what would be a practical approach here?.
Hi all,

my colleagues have been trying to deploy report subfolders from GIT to another Sandbox environment. After deployment these subfolders appear as folders but not contained in the report folder.
For example, you have this structure:

Service Reports --> Folder
In the Service Reports folder you have two subfolders 'Service Reports 1' and 'Service Reports 2' subfolders.

On GIT these are being correctly shown as subfolders:
 
<members>Service_Reports</members>     <members>Service_Reports/ServiceReports1</members>     <members>Service_Reports/ServiceReports1/Service_Report_within_the_ServiceReports1_subfolder</members>
But once deployed, the subfolders appear as folders and not as subfolders within the Service Reports folder, why?.
Are my colleagues missing something so that report subfolders are not being correctly deployed as such from GIT?
 
To all developers who have knowledge using the GIT Lab:
 
is it possible to deploy Kanban Settings at all?. My team isn't using change sets for deployments but GIT. Deployments run from the source development environment to GITand from GIT to the target environment, another Sandbox environment.
 
The target environment is a clone of the Production environment and say, there weren't Kanban Settings configured there.
I configured the Kanban Settings in the source, Sandbox environment and these were overwritten by a refresh made by one of our developers,
I would like to understand how this works as well. Why?:
 
One of our developers says it is not possible to deploy Kanban settings, this should be a post-deployment step. Now, if this is not possible, how is it possible that the Kanban Settings in the list views I configured before in the source, development environment were overwritten by a refresh from the target ennvironment (clone of the Prod with no Kanban Settings configured)?.
 
I don't know if my description is clear. If not I would write more details in next comments.
If this is clear I would appreciate explanations, because I don't understand and I am not sure if the developer who said a deployment of the Kanban Settings is not possible, is true.
Hi all,

I am trying to build a report where you can see the number of records with Name and the number of records without Name or a default Name for a custom object.

The custom object is Exhibition__c (Exhibition). Some exhibitions don't have an Exhibition Name or a default one, say 'Default Exhibition'.
So, I would like to have in the same report the count of Exhibition records with an Exhibition Name different from 'Default Name' or empty, and the count of Exhibition records with 'Default Name' or empty.

I am grouping the report by Exhibition Name. I am thinking about using a formula field as Filter or can I use a Summary Formula field here?, I don't see any possibility with summary formulas.

Any suggestion would be appreciated.
Hi all,

after creating an opportunity I proceeded adding products to the opportunity. The popup windows are standard in Salesforce and look like this:

User-added image
User-added image

In the window "Edit selected products", is there a way to manage the fields/columns to be displayed in this layout and the order of them in the layout?
Hi all,

when a picklist field has been deployed to Production and you have some picklist values where you have to change, what is best practice, apart from changing the picklist value, do I have to change the API of the picklist value as well?. What about if I change the API of the picklist value as well?.

Could someone give me here some hints?
Hi all,
 
we have external objects and a record as test record. When I try to search for any of the values on the used fields, there are no results.
I don't have any experience with global search on external objects. I only have read that for having results you will need a third party tool.
I have configured the Search layout --> Search results on the external objects, enabled search for the objects but no results.
What is your experience? is it possible to find records on external objects using the standard global search?. If yes, how, what should we do in order to get the results in Salesforce the way you can do for internal ones.
Hi everybody,

we have the requirement to send a notification post to the case owner when a new incoming email is attached to the case.

I am trying to implement this or at least to test a solution with Process Builder, but this is not working. From your experience is it possible at all to meet this requirement?. Here my process:

User-added image
User-added image
User-added image
User-added image
User-added image
Hi all,

I was wondering if there is a possibility not to hard code the location of images in email templates. We are linking images with a Sandbox location, what happens if the image is deleted or moved to another environment?.
For example, we have the following code in the email template and the email template is in the Salesforce instance CS109:
 
<img align="center" alt="Image" border="0" class="center autowidth" src="https://c.cs110.content.force.com/servlet/servlet.ImageServer?id=0150Q000000C8yp&oid=00D0Q0000009cAu&lastMod=1557822678000" style="outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; clear: both; border: 0; height: auto; float: none; width: 100%; max-width: 300px; display: block;" title="Image" width="300"/>
I would appreciate any advice about best practices in such a case.
 
Hi all,

I am still stuck in this part of the module Aura Components Basics. I can not pass the challenge yet.
I have changed the code in campingList.cmp many times. This is the current version:
 
<aura:component controller="CampingListController">
    
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    <aura:handler name="addItem" event="c:addItemEvent" action="{!c.handleAddItem}"/>
    
    <div class="slds-page-header" role="banner">

      <div class="slds-grid">

        <div class="slds-col">

          <p class="slds-text-heading--label">Camping Items</p>

          <h1 class="slds-text-heading--medium">My Camping Items</h1>

        </div>

      </div>

    </div>

      
  <div aria-labelledby="newitemform">

      <fieldset class="slds-box slds-theme--default slds-container--small">
    
        <c:campingListForm />
    
      </fieldset>

    </div>
    
    
     <aura:attribute name="items" type="Camping_Item__c[]"/>

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Camping List Items</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="campItem">
                    <c:campingListItem item="{!campItem}"/>
                </aura:iteration>
            </div>
        </section>
    </div>

</aura:component>

But I am getting the error:
 
The campingList component doesn't appear to have a Quantity input field in the form using a Lightning Base component

Did somebody pass currently this challenge?
Hi all,

I am trying to pass the Aura Components Basics trail --> Connect Components with Events.
Following code has been implemented but at the end I can not pass this trail step because I am getting the message
 
"Challenge not yet complete in My Trailhead Playground 6
The campingList component appears to be using UI Components instead of Base Lightning Components in the form. You should be using only Base Lightning Component

Following is the code:

campingList.cmp
 
<aura:component controller="CampingListController">
	
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <aura:handler name="addItem" event="c:addItemEvent"
   	action="{!c.handleAddItem }"/>
    

    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    
    <ol>
    <li>Bug Spray</li>
    <li>Bear Repellant</li>
    <li>Goat Food</li>
    </ol>
    
       <!-- NEW ITEM FORM -->
    <div class="slds-col slds-col--padded slds-p-top--large">

        <c:campingListForm />

    </div>
    <!-- / NEW ITEM FORM -->    
   

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Items</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="items">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>

</aura:component>

campingListController
({
    // Load items from Salesforce
	doInit: function(component, event, helper) {

    // Create the action
    var action = component.get("c.getItems");

    // Add callback behavior for when response is received
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            component.set("v.items", response.getReturnValue());
        }
        else {
            console.log("Failed with state: " + state);
        }
    });

    // Send action off to be executed
    $A.enqueueAction(action);
},

    
    handleAddItem: function(component, event, helper) {
    //   var newItem = event.getParam("item");
    //helper.addItem(component, newItem);
    var action = component.get("c.saveItem");
    		action.setParams({"item": newItem});
    		action.setCallback(this, function(response){
        		var state = response.getState();
        		if (component.isValid() && state === "SUCCESS") {
            		// all good, nothing to do.
            var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);
        		}
    		});
    		$A.enqueueAction(action);
        		}
    
              
})

campingList Helper
({
   addItem: function(component, item) {
    this.saveItem(component, item, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            // all good, nothing to do.
         /*   var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);*/
        }
    });
},
})

campingListForm component
<aura:component >
	
        <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false }"/>
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
        <!-- CREATE NEW ITEM FORM -->
    <form class="slds-form--stacked">

      <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputText aura:id="itemname" label="Name"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Name}"
                  required="true"/>

          </div>
     </div>

     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputNumber aura:id="quantity" label="Quantity"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Quantity__c}"
                  required="true"/>

          </div>
      </div>

      <div class="slds-form-element">
          <div class="slds-form-element__control">
              <ui:inputCurrency aura:id="price" label="Price"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Price__c}"
                  />
          </div>
      </div>

      <div class="slds-form-element">
          <ui:inputCheckbox aura:id="packed" label="Packed?"
              class="slds-checkbox"
              labelClass="slds-form-element__label"
              value="{!v.newItem.Packed__c}"/>
      </div>

      <div class="slds-form-element">
          <ui:button label="Create Camping Item"
              class="slds-button slds-button--brand"
              press="{!c.submitForm}"/>
      </div>

    </form>
    <!-- / CREATE NEW ITEM FORM -->
</aura:component>

campingListForm Controller​​​​​​​
({
    
    submitForm: function(component, event, helper) {    
    if(helper.validateItemForm(component)){
        // Create the new item
        var newItem = component.get("v.newItem");
        helper.createItem(component, newItem);
    }
        
        }

})
campingListForm Helper​​​​​​​
({
 addItem: function(component, newItem) {
    var addItem = component.getItem("addItem");
    addItem.setParams({ "item": item });
    addItem.fire();
            component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false } />);
},
    

		validateItemForm: function(component) {
		
              // Simplistic error checking
        var validItem = true;

        // Name must not be blank
        var nameField = component.find("itemname");
        var itemname = nameField.get("v.value");
        if ($A.util.isEmpty(itemname)){
            validItem = false;
            nameField.set("v.errors", [{message:"Item name can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
        
        // Quantity must not be blank
        var quantityField = component.find("quantity");
        var quantity = nameField.get("v.value");
        if ($A.util.isEmpty(quantity)){
            validItem = false;
            quantityField.set("v.errors", [{message:"Quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
		// Price must not be blank
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price)){
            validItem = false;
            priceField.set("v.errors", [{message:"Price can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
            return (validItem);

	}
})

addItemEvent.evt​​​​​​​
<aura:event type="COMPONENT">
    <aura:attribute name="item" type="Camping_Item__c"/>
</aura:event>

What I am doing wrong? I would appreciate any advice.​​​​​​​



​​​​​​​
Hi all,

I would like first to retrieve all possible metadata from a Developer Edition org and then deploy this content to another Developer Edition org. Unfortunately you can not build change sets in a Developer Edition environment, so I am trying to retrieve the metadata with ANT.
 
As there is no possibility for using change sets I have been trying to use the "ant retrieveUnpackaged" after I added the "retrieveUnpackaged" part to the build.xml file according to this link: https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_retrieve_unpackaged.htm
 
When trying to run the command line "ant retrieveUnpackaged" under the correct location, I am getting the error " Should provide a valid retrieve manifest 'unpackaged'." pointing to the line "unpackaged="unpackaged/package.xml"/>". Even when trying many things I could not find out what is wrong or how can I amend this, so the command creates a package.
 
Any help or guidance will be appreciated.
Hi all,

I am trying to create some code in order to invoke the obfuscateUser method, which anonymize user data, when users for example leave a company (GDPR compliance).

There is the following code:
 
public class UserManagementController{
    public List <User> users {get; set;}
    
    public UserManagementController()
    {
        Profile p = [select id from profile where name = 'Customer Community User'];
        
        users = [select username, id from User where profileId=:p.id AND isactive=true];
    }
    
    static public void obfuscate(User users)
    {
        
        //User u = [select contactId from user where id=:uid];
        
        System.UserManagement.obfuscateUser(users.id);
        
        
    }
}
Perhaps I want to use the username as well in order to anonymize or obfuscate the user and I don't want to use hard coding such as mentioning a specific profile in the code like in the example above. Ca somebody guide me how can I improve this code, so I can invoke it from the Developer Console?.

Any help will be appreciated.
 
Hi all,

I am going crazy trying to deploy a package from a Sandbox in a Production Org (one signed up Developer Org).

When the process begins to run it then ends with repetitive error:info lines:

User-added imageIt ends with:

[sf:deploy] Failed to check the status for request ID=0Af1i000000B87XCAS. Error: InfoNot a valid enumeration for type: class com.sforce.soap.metadata.DeployProblemType. Retrying...

Can please somebody help me here? I downloaded the version 45 of the ant jar file and put it in the ANT directory, but anyway the deployment is not working, why?
Hi all,

I scheduled a batch job last year to run every 1. January at 12:05 am in every year. The batch job sends an email to a Support CRM team.
On the 1. January this year the job didn't run.

I checked the Apex code and everything is ok. Today I scheduled the batch at certain times by testing it and it worked, it sent an email to the Supoort CRM team. Now I am wondering if the following lines to invoke the batch job are correct:
 
MY_BATCH_JOB sendEmailJob = new MY_BATCH_JOB();
        String sch = '00 05 00 1 1 ? *';
        system.schedule('BATCH Yearly Email Reminder', sch, sendEmailJob);
Is especially the line '00 05 00 1 1 ? *' correct or incorrect?
 
Hi all,

I am learning little by little with all experiences in projects in the last week.
One of them: Our Development team built a trigger that lets an external system synchronize the account address to their contact addresses and validates with an error message if any user tries to update the contact addresses. After deploying it to the Production environment, users could not create contacts anymore.

We spent time analyzing what was going on and found out there were workflows overlapping the trigger in the way that any user can update the contact addresses through the respective account. Workflows were given everytime a Contact record is created or updated.

And here my question, is this problem with the workflows something we could have avoided? could we have foreseen this conflict between the workflows and the trigger?. We didn't know that these workflows existed as these were built by another admin who then left the project.
Hi all,

there is the critical update "Add a Namespace Prefix to Query Parameters and pageReference.state Properties", where we don't know how to test. What does Salesforce mean with it? an example?.



 
I have read every possible thread where some have or had the problem that some fields are not being displayed for reports even if the System Admin has Edit permissions on the field or the field is on the layout of the object.

I have built a report with Account as the primary object and following relationships:
User-added image

Account and Object B have a Master-Detail relationship. Object B and C as well. B and C are custom objects.
I would like to add a custom field which is in the object C, say, Name. Name__c is a text field, a custom field.
When building the report type I don't have any chance to add Name__c to the report type. It appears on the right side under C fields as greyed out. No chance to add it. I don't know why.

The field is visible to the Admin, also added on the page layout of the C object. The field is also not blocked via permission set.

But when I build a report type having B and C, the Name__c field appears for selection.

Can someone explain to me what is going on here?
Hi all,

I built a report with report type Opportunities and would like to add a filter saying Close Date <= 31.12.CURRENT YEAR. For this year it would be <= 31.12.2019.

I found in the Salesforce Documentation the following statement:

For example, instead of filtering on Close Date greater than Jan 1, 2017, filter using a relative date: Close Date equals this year.

Attached the link to the documentation:

https://help.salesforce.com/articleView?id=filter_dates_relative.htm&type=5

If I use Close Date <= THIS YEAR I am wondering if this is the correct solution, as THIS YEAR means "Starts at 12:00:00 AM on January 1 of the current year and continues through the end of December 31 of the current year". I just want to tell Salesforce, I want all records with Closed Date <= LAST DAY OF THE CURRENT YEAR without using any formulas.

If using formulas what would be a practical approach here?.
Hi all,

after creating an opportunity I proceeded adding products to the opportunity. The popup windows are standard in Salesforce and look like this:

User-added image
User-added image

In the window "Edit selected products", is there a way to manage the fields/columns to be displayed in this layout and the order of them in the layout?
Hi all,
 
we have external objects and a record as test record. When I try to search for any of the values on the used fields, there are no results.
I don't have any experience with global search on external objects. I only have read that for having results you will need a third party tool.
I have configured the Search layout --> Search results on the external objects, enabled search for the objects but no results.
What is your experience? is it possible to find records on external objects using the standard global search?. If yes, how, what should we do in order to get the results in Salesforce the way you can do for internal ones.
Hi all,

I was wondering if there is a possibility not to hard code the location of images in email templates. We are linking images with a Sandbox location, what happens if the image is deleted or moved to another environment?.
For example, we have the following code in the email template and the email template is in the Salesforce instance CS109:
 
<img align="center" alt="Image" border="0" class="center autowidth" src="https://c.cs110.content.force.com/servlet/servlet.ImageServer?id=0150Q000000C8yp&oid=00D0Q0000009cAu&lastMod=1557822678000" style="outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; clear: both; border: 0; height: auto; float: none; width: 100%; max-width: 300px; display: block;" title="Image" width="300"/>
I would appreciate any advice about best practices in such a case.
 
Hi all,

I am trying to pass the Aura Components Basics trail --> Connect Components with Events.
Following code has been implemented but at the end I can not pass this trail step because I am getting the message
 
"Challenge not yet complete in My Trailhead Playground 6
The campingList component appears to be using UI Components instead of Base Lightning Components in the form. You should be using only Base Lightning Component

Following is the code:

campingList.cmp
 
<aura:component controller="CampingListController">
	
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <aura:handler name="addItem" event="c:addItemEvent"
   	action="{!c.handleAddItem }"/>
    

    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    
    <ol>
    <li>Bug Spray</li>
    <li>Bear Repellant</li>
    <li>Goat Food</li>
    </ol>
    
       <!-- NEW ITEM FORM -->
    <div class="slds-col slds-col--padded slds-p-top--large">

        <c:campingListForm />

    </div>
    <!-- / NEW ITEM FORM -->    
   

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Items</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="items">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>

</aura:component>

campingListController
({
    // Load items from Salesforce
	doInit: function(component, event, helper) {

    // Create the action
    var action = component.get("c.getItems");

    // Add callback behavior for when response is received
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            component.set("v.items", response.getReturnValue());
        }
        else {
            console.log("Failed with state: " + state);
        }
    });

    // Send action off to be executed
    $A.enqueueAction(action);
},

    
    handleAddItem: function(component, event, helper) {
    //   var newItem = event.getParam("item");
    //helper.addItem(component, newItem);
    var action = component.get("c.saveItem");
    		action.setParams({"item": newItem});
    		action.setCallback(this, function(response){
        		var state = response.getState();
        		if (component.isValid() && state === "SUCCESS") {
            		// all good, nothing to do.
            var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);
        		}
    		});
    		$A.enqueueAction(action);
        		}
    
              
})

campingList Helper
({
   addItem: function(component, item) {
    this.saveItem(component, item, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            // all good, nothing to do.
         /*   var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);*/
        }
    });
},
})

campingListForm component
<aura:component >
	
        <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false }"/>
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
        <!-- CREATE NEW ITEM FORM -->
    <form class="slds-form--stacked">

      <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputText aura:id="itemname" label="Name"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Name}"
                  required="true"/>

          </div>
     </div>

     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputNumber aura:id="quantity" label="Quantity"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Quantity__c}"
                  required="true"/>

          </div>
      </div>

      <div class="slds-form-element">
          <div class="slds-form-element__control">
              <ui:inputCurrency aura:id="price" label="Price"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Price__c}"
                  />
          </div>
      </div>

      <div class="slds-form-element">
          <ui:inputCheckbox aura:id="packed" label="Packed?"
              class="slds-checkbox"
              labelClass="slds-form-element__label"
              value="{!v.newItem.Packed__c}"/>
      </div>

      <div class="slds-form-element">
          <ui:button label="Create Camping Item"
              class="slds-button slds-button--brand"
              press="{!c.submitForm}"/>
      </div>

    </form>
    <!-- / CREATE NEW ITEM FORM -->
</aura:component>

campingListForm Controller​​​​​​​
({
    
    submitForm: function(component, event, helper) {    
    if(helper.validateItemForm(component)){
        // Create the new item
        var newItem = component.get("v.newItem");
        helper.createItem(component, newItem);
    }
        
        }

})
campingListForm Helper​​​​​​​
({
 addItem: function(component, newItem) {
    var addItem = component.getItem("addItem");
    addItem.setParams({ "item": item });
    addItem.fire();
            component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false } />);
},
    

		validateItemForm: function(component) {
		
              // Simplistic error checking
        var validItem = true;

        // Name must not be blank
        var nameField = component.find("itemname");
        var itemname = nameField.get("v.value");
        if ($A.util.isEmpty(itemname)){
            validItem = false;
            nameField.set("v.errors", [{message:"Item name can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
        
        // Quantity must not be blank
        var quantityField = component.find("quantity");
        var quantity = nameField.get("v.value");
        if ($A.util.isEmpty(quantity)){
            validItem = false;
            quantityField.set("v.errors", [{message:"Quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
		// Price must not be blank
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price)){
            validItem = false;
            priceField.set("v.errors", [{message:"Price can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
            return (validItem);

	}
})

addItemEvent.evt​​​​​​​
<aura:event type="COMPONENT">
    <aura:attribute name="item" type="Camping_Item__c"/>
</aura:event>

What I am doing wrong? I would appreciate any advice.​​​​​​​



​​​​​​​
Hi all,

I would like first to retrieve all possible metadata from a Developer Edition org and then deploy this content to another Developer Edition org. Unfortunately you can not build change sets in a Developer Edition environment, so I am trying to retrieve the metadata with ANT.
 
As there is no possibility for using change sets I have been trying to use the "ant retrieveUnpackaged" after I added the "retrieveUnpackaged" part to the build.xml file according to this link: https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_retrieve_unpackaged.htm
 
When trying to run the command line "ant retrieveUnpackaged" under the correct location, I am getting the error " Should provide a valid retrieve manifest 'unpackaged'." pointing to the line "unpackaged="unpackaged/package.xml"/>". Even when trying many things I could not find out what is wrong or how can I amend this, so the command creates a package.
 
Any help or guidance will be appreciated.
Hi all,

I scheduled a batch job last year to run every 1. January at 12:05 am in every year. The batch job sends an email to a Support CRM team.
On the 1. January this year the job didn't run.

I checked the Apex code and everything is ok. Today I scheduled the batch at certain times by testing it and it worked, it sent an email to the Supoort CRM team. Now I am wondering if the following lines to invoke the batch job are correct:
 
MY_BATCH_JOB sendEmailJob = new MY_BATCH_JOB();
        String sch = '00 05 00 1 1 ? *';
        system.schedule('BATCH Yearly Email Reminder', sch, sendEmailJob);
Is especially the line '00 05 00 1 1 ? *' correct or incorrect?
 
Hi all,
we would like to be able to also search for a certain picklist value in a lookup and get results of the object records in Lightning.
According to Lightning you can configure the search results with usable fields as documented here:

https://help.salesforce.com/articleView?id=search_fields_lex.htm&type=5

I could configure the search results for Account using Phone as the secondary field and when I make my search on the Account using a phone number I get the corresponding result. But when I take a picklist field as secondary and then try my search using a picklist value, this doesn't work.

So, does anybody know if there is a workaround for this? how can a lookup be searchable using a picklist value?
Hi dear developers,

I am pretty confused about the use of custom settings in APEX test classes.

One of our developers, who unfortunately is not there anymore, wrote the following test data in a test method:
 
static testMethod void testMethodExample() {
        insert new CS_Example__c(Batch_Limit__c = 1, EmailAddress__c='test@example.com', Name = 'Test_CS');
the test class works, but we don't understand why he created in addition to the test data within the test class, a new Custom Setting record with the name 'Test_CS". That means, he created two records on the Custom Setting CS_Example__c:

1. Name: CS_Config
    Batch_Limit__c = 200,
   Email_Address__c = test2@example.com
 
2.  Name: Test_CS
    Batch_Limit__c = 200,
   Email_Address__c = test@example.com

And he had been using the name of the second Custom Setting record only for the test class. He had been using the first Custom Setting record for the APEX (non-test) batch job class.

Or, the second record is not needed and can be deleted?.


 
Hi all,

I am spending hours trying to find out which is the field or the issue cause behind the error I am getting when trying to update a custom field in the object Opportunity Product:
 
Error saving record: FIELD_FILTER_VALIDATION_EXCEPTION: Value does not exist or does not match filter criteria
We don't have any lookup with filter criteria on the object. On the Objects Opportunity and Product2 there are not lookup fields with filter criteria.
When trying to debug this with the debug logs, I don't get any details leading me to this error.

Does anybody know if there is a possibility to debug this with code or any possibility to find out what is going on here?
 
Hi all,

I am struggling with coding a test class for a class accessing custom metadata class.
The class tries to insert a record for a custom metadata type, but no idea if my code is going to somewhere. I could not find any concrete solution for my problem. Some say you need a wrapper class, some say JSON.

I would appreciate any guidance, help as I am not a developer myself, but unfortunately all developers are busy at the moment.

This is my class:
 
global class EmailReminder implements Schedulable {  
    
   global void execute(SchedulableContext SC) {
      sendEmail();
   }
    
    
    global void sendEmail(){

        Messaging.reserveSingleEmailCapacity(2);
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        // Strings to hold the email addresses to which you are sending the email.
        
        Email_Reminder_Setting__mdt query = [SELECT Subject__c, OWA_Label__c, Body__c ,ToEmailAddress__c FROM Email_Reminder_Setting__mdt LIMIT 1];
        
        String[] toEmailAddress = new String[] {query.ToEmailAddress__c};
        String Subject = query.Subject__c;
        String Body= query.Body__c;
        String Owa_Label= query.OWA_Label__c;
       
        
        // Assign the addresses for the To and CC lists to the mail object.
        
        mail.setToAddresses(toEmailAddress);
        
        // Use Organization Wide Address  
        for(OrgWideEmailAddress owa : [select id, Address, Displayname from OrgWideEmailAddress]) {
            if(owa.DisplayName.contains(Owa_Label)) {
                 mail.setOrgWideEmailAddressId(owa.id); 
            }
              
        } 
           
        // Specify the subject line for your email address.
        mail.setSubject(Subject);
        
        // Set to True if you want to BCC yourself on the email.
        mail.setBccSender(false);
        
        // Optionally append the salesforce.com email signature to the email.
        // The email address of the user executing the Apex Code will be used.
        mail.setUseSignature(false);
        
        // Specify the text content of the email.
        //mail.setPlainTextBody('Please configure this');
        
        mail.setHtmlBody(Body);
        
        // Send the email you have created.
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}

This is my test class so far:
 
@isTest
public class EmailReminder_Test {
   
  
      @testVisible static List<Email_Reminder__mdt> customMetadata { 
      get {
        if ( customMetadata == null )
            customMetadata = [ SELECT ToEmailAddress__c, OWA_Label__c, Subject__c, Body__c FROM Email_Reminder__mdt ]; 
            return customMetadata;
      } 
      set; }
      
      Test.startTest();
      EmailReminder sendEmailJob = new EmailReminder();
      String sch = '00 30 20 5 2 ? *';
      system.schedule('sendEmailJob', sch, sendEmailJob);
      Test.stopTest();
    
    
    
}

I am getting the error:

Error: Compile Error: Expecting ')' but was: 'sendEmailJob' at line 16 column 23​​​​​​​

What am I doing wrong?. 

 
Hi all,

as some of you might know, custom fields for custom settings, with type Textarea, are limited to only 255 characters. I had read there is a workaround and this you can create a second field with the same length and create a record concatenating both, ok.
Our problem is, how can we change our code so the second field is taken in account and when sending the email, the value in the second field also will be displayed:

This is the code:
global class implements Schedulable {  
    
   global void execute(SchedulableContext SC) {
      sendEmail();
   }
    
    
    global void sendEmail(){

        Messaging.reserveSingleEmailCapacity(2);
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        // Strings to hold the email addresses to which you are sending the email.
        Email_Reminder__c er = Email_Reminder__c.getInstance('Reminder');
        String [] toEmailAddress = new String [] {er.ToEmailAddress__c};
        String Subject= er.Subject__c;
        String Body= er.Body__c ;
        String Body2= er.Body2__c; // I added the custom field Body2 in the Custom Setting
        String Owa_Label= er.OWA_Label__c;
       
        
     
        
        mail.setToAddresses(toEmailAddress);
        
        // Use Organization Wide Address  
        for(OrgWideEmailAddress owa : [select id, Address, Displayname from OrgWideEmailAddress]) {
            if(owa.DisplayName.contains(Owa_Label)) {
                 mail.setOrgWideEmailAddressId(owa.id); 
            }
              
        } 
           
        // Specify the subject line for your email address.
        mail.setSubject(Subject);
        
        // Set to True if you want to BCC yourself on the email.
        mail.setBccSender(false);
        
        // Optionally append the salesforce.com email signature to the email.
        // The email address of the user executing the Apex Code will be used.
        mail.setUseSignature(false);
        
        // Specify the text content of the email.
        //mail.setPlainTextBody('Please configure this');
        
        mail.setHtmlBody(Body);
        
        // Send the email you have created.
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}

Custom Setting with fields:

Body__c --> Textarea (255)
Body2__c --> Textarea(255)
OWA Label --> Text(100)
Subject__c --> Text(250)
ToEmailAddress__c --> Email

Value in Body__c:
 
This is a first test. This should work with two fields. The idea is first to display the value in Body__c and Body2__c as the content were the content in only one field.
Value in Body2__c:
 
This is an example of content in Body2__c. Questions is how can I concatenate Body__c and Body2__c?

If I get an Email, I would like to get the following content in this form:

This is a first test. This should work with two fields. The idea is first to display the value in Body__c and Body2__c as the content were the content in only one field.
This is an example of content in Body2__c. Questions is how can I concatenate Body__c and Body2__c?


How can I change my code so I get this result in the email. We are not yet using an email template.

Second question is, if we use an email template instead, how can we change the code above?



 
Hi all,

I am struggling trying to fix a test class for an APEX class (WSDL) which has the following form:
 
global class Example {
   webService static String getUserName(String name) {
       return UserInfo.getUserEmail();
   }
}

My test class is this:
 
@isTest
private class Example_Test {
    @isTest static void Example() {              
        // This causes a fake response to be generated
        Test.setMock(WebServiceMock.class, new getUserName());  
    }
}

I am getting this error:
 
System.TypeException: Mock object doesn't implement the supplied interface
Class.System.Test.setMock: line 57, column 1
Class.Example_Test.Example: line 5, column 1
Any advice would be appreciated :)
 
We have a CA-signed certificate expiring in the next 30 days. I have seen numerous articles related to self-signed certificates but nothing clear related to CA-signed. Can anyone kindly provide clear step by step instructions on how to renew a CA-signed certificate that is due to expire. Note that our IT team have already renewed the wildcard certificate at their end but how is the renewal done in Salesforce after clicking on the expiring certificate label link?
Thank you
Hi
I'm trying to add CA certificates into my organization, but always have the same result: " Error: The certificate that you are uploading doesn't match the generated certificate signing request. "

I get the certificate from outside webserver, and download it from Mozilla browser. When I view that certificate, I can see CN, O, L, ST, C, but can't see Organizational Unit (OU)
I follow this steps:
  - Setup - Security Controls - Certificate and Key Management - Create CA Signed certificate
  - put into the fields the info that I can see in downloaded certificate

After that, I try to upload downloaded signed certificate into salesforce, but y get error with signin request.

Can anyone help me?

Thanks