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

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 53
    Questions
  • 41
    Replies
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,
 
I have a question here about best practices for deployments.
I work in parallel with a development team and they don't work accurately sometimes. When it comes to deployments they forget to tell me the whole group of components they changed and which are relevant to deploy. I am used to prepare change sets and ask them, which components they changed so I can add them to a change set in order to deploy them to the Production environment. Last time they gave me a wrong list and after deployment customers were giving complaints to me.
 
So, I would appreciate tips, best practices from your experience, how you deal as deployers, did you have such experience working with developers waiting for them to tell you "these are the components I changed, put them in the change set". What happens if they give you the wrong list?. how to deal with this?
Hi all,

how can we build a flow, which does the following:

1. There are Contacts or Leads with the checkbox set to "Do Not Email". So, we want an automatic process to run everytime a Contact or Lead is created.
2. The process should verify if the email address of the new Contact or Lead coincides with the email address in existing Contacts or Leads
3. The process should also verify if the found record has "Do Not Email" set. If that is the case it should set automatically the checkbox "Do Not Email" on the new Contact or Lead record which is being created

I think this is possible with a flow but I am not sure.
Can somebody guide me here? if with a flow, how can this be built?
Hi all,

Does anybody know how to export data from Salesforce to a SQL Server via SSIS automatically and scheduled?.
Is there any possibility to export with filter so not whole tables but only extracts of them are exported?.

I would appreciate answers.
Hi everybody,

I am going crazy with so many articles, answers of the Salesforce Community to a similar question, but every answer has no more details and there is no much information or no information on the Salesforce Documentation. I raised a case for the Salesforce Support with the question in this thread and an agent closed the case automatically with the reason "this is a Development issue, report it to the Developers forum".

I only want to know in details how to renew an existing CA-Signed Certificate, which is used by the domain, say, mycompany.com. The CA Certificate will expire in one week and I don't have any idea not even reading many tips :(.

Someone wrote:
 
The steps for getting a certificate signed by a Certificate Authority are these:



1. From Setup, click Security Controls | Certificate and Key Management, click the name of the certificate, then click Download Certificate Signing Request.
2. Send the certificate request to the certificate authority of your choice.
3. After the certificate authority sends back the signed certificate, from Setup, click Security Controls | Certificate and Key Management, click the name of the certificate, then click Upload Signed Certificate.
4. Click Browse to locate the CA-signed certificate. The CA-signed certificate must match the certificate created in Salesforce. If you try to upload a different CA-signed certificate, the upload fails.
5. Click Save to finish the upload process. Click Cancel at any time to not upload the certificate.

Essentially, you take the CSR file you've downloaded from Salesforce and have it signed by the company of your choosing and then return to Salesforce and upload the certificate generated by your provider.

I am very confused. I don't want to create a new CA-Signed Certificate. I want to renew an existing certificate so it gets a new expiration date, because this certificate will expire next week and this is used by the domain mycompany.com.

So:

1. What please are the steps in detail to RENEW an existing CA-Signed Certificate
2. Would it be enough if I only download the CSR file from the existing CA Certificate --> Then I create a new CA Certificate with the same label --> For this new one I am creating then I upload the CSR file I downloaded before --> Make inactive the old CA Certificate and MAke active the new one?

I think, I don't need to send the downloaded CSR to a CA Authority of my choice again, what do you think?.
I have read that CA Authorities charge companies for signing such CSRs, so it has no sense, I think, to send the downloaded CSR to a CA if you have not updated anything in the file or encryption, does it also make sense for you?.

What is your experience Salesforce Admin experts? Please help me here :(.
Hi all,

Saying you are on an Opportunity record. The account is "Acme". You want to create a task on the Opportunity. On the Task there is the Name field (type lookup) which shows all Contacts no matter if they belong or don't to the Opportunity account.

I know there is no possibility to add a lookup filter to the Name field in order to show only the Contacts to the Opportunity account.

Is there any workaround this can be made in Salesforce? Lightning component? Visualforce?

I would appreciate your responses.
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 hope someone can give us here tips as I could not find in any Salesforce documentation how to deal consistently with this Salesforce issue.
Currently, following a sandbox refresh, the email address is changed and appended with @example.com for all users except the user that initiates the Sandbox refresh.  It would be helpful to have it change for all users EXCEPT System Administrators.  It becomes challenging to manage sandboxes when not all System Administrators remember their password from the time it was refreshed.  This would allow them to easily reset their password when needed and log into any Sandbox for their org.
How do you deal with this? which are best practices? is there a workaround?. Comments will be appreciated.
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,

we are experiencing an issue not only when attaching daily emails to opportunities but also when creating reports. In both cases the date of yesterday always appears.

For instance, I created a report yesterday (14th November), but Salesforce is showing me the Created Date  as "13th November" (13.11.2018). 

I already checked my user settings. My time zone is pointing to the correct one "Central European Time (Europe/Berlin) --> GMT+01:00.

Did anybody face this issue before? how did you solve this issue?.
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?.



 
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 :)
 
Hi all,

I have the following Scheduler apex class:
 
public class Example_Scheduler implements Schedulable {
    
  public void execute(SchedulableContext sc){
        Example_Batch batch1 = new Example_Batch();
    Database.executebatch(batch1,batch1.lim);
    }
}
and the following corresponding test class:
 
@isTest
public class Example_Scheduler_Test {
    
   static testMethod void testMethod1() {
        insert new CS_Example__c(Batch_limit__c = 100, Name = 'Test');
        Test.StartTest();
            Example_Scheduler sh1 = new Example_Scheduler();      
            String sch = '0 0 20 * * ?';
            system.schedule('Test check', sch, sh1);
        Test.stopTest();
    }
}

Where CS_Example__c is a custom setting with the following custom field:

Batch_Limit__c --> Number (18,0)

When testing the test calls I get the following error:
 
System.InvalidParameterValueException: batchSize must not be null.
StackTrace: Class.Example_Scheduler.execute: line 5, column 1

I could not correct this so far. Can someone advise me what exactly is not letting run the test successfully so I can correct it?.

 
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?.



 
Hi all,

I am not a programmer. I just wanted to know if this critical update applies to us. Under Developer Console --> Search in Files I could not find "@auraEnabled", I guess this critical update doesn't apply to us and even if we don't activate it, Salesforce will activate it automatically.

Was my search correct or where else does it need to be analysed?
Hi all,

we are using only classic, no lightning components. We are worried about ignoring the critical update "Disable Access to Non-global Apex Controller Methods in Managed Packages (Critical Update)".

Does this apply to us as only Classic users? or where do we have to check?
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