• Santosh Reddy Maddhuri
  • NEWBIE
  • 394 Points
  • Member since 2016


  • Chatter
    Feed
  • 14
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 77
    Replies
I am trying to create a detail page button that marks a checkbox as true. Here is the URL I am currently using for my button: /{!Case.Id}/e?retURL=/{!Case.Id}&00N11000004Dwmh=1&save=1

This opens the edit page but does not mark the checkbox as true. Is there a way to do this without opening the edit page? 

Example

Folks,


In the Salesforce Lightning Design System portal, show an example of a toast usage as per link below:

https://www.lightningdesignsystem.com/components/toast/


I used this example as the basis for setting it up in an environment.
The environment is configured as described below:

I have an object, called Alert, where the user can include as many alerts as he wants.
Each record of the object is an alert.

Fields of the Alert__c object:

- Name (Alert ID)
- Alert_Type__c (Example: Success, Info, Error, Warning) - User selects the type of alert you want to display
- Alert1__c (Alert message to be displayed)

 

-------------------------------------------------------------------------------

 

I created a component to display the alert on a certain page as per the code below:

 

Alert.cmp
-----------------


<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride,lightning:backgroundUtilityItem" access="GLOBAL" controller="AlertController">   

    
<aura:attribute name="html" type="List" />
    
    
<aura:attribute name="showToast" type="boolean" default="false"/>
    
<aura:attribute name="Alert" type="Alert__c" default="{'sobjectType': 'Alert__c',
                         'Tipo_de_Alerta__c': '',
                         'Name': '',
                         'Alerta1__c': ''
                          }"/>
    
    
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    
<aura:if isTrue="{!v.showToast}">
    
           <aura:iteration items="{!v.html}" var="lista">        
					<div class="demo-only" style="height: 4rem;">
		
   							 <div class="slds-notify_container slds-is-relative">    
				
        							<div aura:id="alerta" role="status"> 
                                 
                                 <!--  <div id="{!Lista.Name}" role="status">   -->
													<div  class="slds-notify__content">
                            
                                                                <h2 class="slds-text-heading_small ">                
                                                                     <aura:unescapedHtml value="{!lista.Alerta1__c}" />  
                                                                </h2>
                            
                                                    <lightning:buttonIcon iconName="utility:close" variant="bare" alternativeText="Close"
                                                     iconClass="{!v.type == 'warning' ? 'light' : 'dark'}" size="small"
                                                     class="slds-button slds-button_icon slds-notify__close slds-button_icon-inverse"
                                                     onclick="{!c.close}"/>      
    
													</div>
									</div>
							</div>
					</div>
			</aura:iteration>
    
    
    
    
   

</aura:if>
    
    
    
</aura:component>

AlertController.js
-----------------------





({


   doInit : function(component, event, helper)
    {

  var action = component.get( "c.getMsgs" );

         action.setCallback(this, function(response) 
                           {                               
                             
                               var state = response.getState();

                               if(state == 'SUCCESS')
                               {                                   
                                   var alertMsgList = response.getReturnValue();
                                   var lista = [ ];                                  
                                   
                                   
                                   if(alertMsgList.length > 0)
                                   {                                       
                                       component.set("v.showToast", true);                             
                                   }
                                 
                                   
                                   
                                   for(var i = 0; i < alertMsgList.length; i ++) 
                                   {                                       
                                     
                                       /*
                                       var alerta = alertMsgList[ i ].Alerta1__c;
                                       var tipo = alertMsgList[ i ].Tipo_de_Alerta__c;
                                       var titulo = alertMsgList[ i ].Name;                                       
                                       */
                                       
                                      lista.push(alertMsgList[i]);

      						       }
                                   
                                   
                                   component.set("v.html",lista);
                                 
                                   var tipoAlerta = component.find( "alerta" );
                                   
                                   
                              //     var tipoAlerta = document.getElementById("!v.Alert.Name");
                              
                                                                      
                                              $A.util.addClass( tipoAlerta, "slds-notify" );
                                              $A.util.addClass( tipoAlerta, "slds-notify_toast" );  
                                              $A.util.addClass( tipoAlerta, "slds-theme_success" );  
   
                                   
     }
                               
               
                          else {
                                   console.log("Failed with state: " + state);
                               }
                           }); 
        
        
        $A.enqueueAction(action);
        
  
        
    },

   
    
   close: function(cmp, event, helper) 
    {
   $A.util.addClass(cmp.find('alerta'), "slds-hide");
    //  $A.util.addClass(document.getElementById('{!v.lista.Name}'), "slds-hide");
    },
   
   
       
    
})

AlertController.apxc
-------------------------------------




public class AlertController {
    
    
       
    
 @AuraEnabled
    public static List<Alert__c> getMsgs() {
        
        List<Alert__c> lst = new List<Alert__c>();
        lst = [select Tipo_de_Alerta__c, Name, Alert_Style__c,  Alerta1__c from Alert__c where Data_inicial__c <= :system.now() and Data_final__c >= :system.now()];
        return lst;
    }
    

    
}

What happens is that for every alert found, it needs to display it according to its characteristics:
- Type of alert
- Identification of each alert (For each alert, your type configuration and the close button will be checked)
- Alert message: This setting is the only one that is working, need to interact for each alert by formatting your type to receive the appropriate CSS and the close button for it.

In the Controller.js I put the part that configures the CSS and the separate close button just to test its operation, so it works only for one record, I need to put it to work in each interaction and to each of the records that are found .
That's what I can not do, if anyone can help me, I'll be very grateful.
Thank you
Hi All,
Hi All,
        i have a batch in which i am creating a parent child account hierarchy. i created new Accounts for each opportunity  And Opportunity has parent Account as the new Account which is just created and the newAccount has the Old Account as a parent.now at this time when i am executing the batch for opportunity with exact same name its creating two Accounts for each opportunity but i want that opportunity with same name should go to the account which is first created . and Opportunity should not create two Accounts .it should not created duplicate records of Account for opportunity with same name.
and if opportunity name does not contains ':'(Coloun) and '-'(Hyphen) than a checkbox Called not Processed should be true
My batch is given below:-
public class BatchResellerPartnerToResellerCustomer implements Database.Batchable<sObject>{
    //Run method to check the Batch on one record
    public static void run( Set<Id> OppIds ) {
         List<Opportunity> OppRecords =  [SELECT Name, AccountId, 
                                         Account.Name, Account.OwnerId,
                                         Account.RecordTypeId, Account.RecordType.Name  
                                         FROM Opportunity 
                                         WHERE AccountId != null 
                                         AND Account.RecordType.Name = 'Time Rack'
                                         AND Account.Customer_Type__c = 'Reseller'
                                         AND Id IN:  OppIds ];
        
        executeHelper( OppRecords );                  
    }
    public Database.querylocator start(Database.BatchableContext BC){
        String query = 'SELECT Name, Account.Name, Account.OwnerId, AccountId, '+
            'Account.RecordTypeId, Account.RecordType.Name '+
            'FROM Opportunity '+
            'WHERE AccountId != null '+
            'AND Account.RecordType.Name = \'Time Rack\''+
            'AND Account.Customer_Type__c = \'Reseller\'';
        return Database.getQueryLocator(query);            
    }
    public void execute(Database.BatchableContext BC, List<Opportunity> opportunities ){
         executeHelper( opportunities );
    }
    //Helper method to create  respective Accounts of opportunities
    public static void executeHelper( List<Opportunity> opportunities ) {
        List<Account> accList = new List<Account>();
        List<Opportunity> opptyListToBeUpdated = new List<Opportunity>();
        //Create Accounts with Opportunity's EndUser Name and ParentId with Opp's accountId
       /* Map<String,Opportunity> mapOppNameToOpportunity = new Map<String,Opportunity>();
        for( Opportunity opp : opportunities ){
            mapOppNameToOpportunity.put(opp.Name, opp);
         }*/
         for(Opportunity Oppty :opportunities  ) {
             String oppName = '';
             //Condition to get the end user name from opp name and give it to the new Account
            if(Oppty.Name.startsWith(Oppty.Account.Name)){
                oppName = Oppty.Name.removeStart(Oppty.Account.Name);
                oppName = oppName.trim();
                 if(oppName.startsWith(':') ){
                    oppName = oppName.substringAfter(':');
                    oppName = oppName.trim();
                }
                else if( oppName.startsWith('-') ){
                    oppName = oppName.substringAfter('-');
                    oppName = oppName.trim();
                }
                else{
                    oppName = Oppty.Name;
                }
                if (Oppty.Name.containsNone(':')||oppName.containsNone('-')){
                   Oppty.Not_Processed__c = True;
                }
            }
            //Condition to check opportunity has account with record type
            if(oppName != '' 
               && Oppty.AccountId != Null
               && Oppty.Account.RecordTypeId != Null){
                   //create new Account for each opportunity with customerType -'End user'
                 Account acc = new Account(Parentid = Oppty.AccountId,
                                            Customer_Type__c = 'End User',
                                            RecordTypeId = Oppty.Account.RecordTypeId,
                                            OwnerId = Oppty.Account.OwnerId,
                                            Name = oppName );
                accList.add(acc);
            }
            
         }
        if(accList.size() >0) {
            insert accList;
        }
       /* Map<String,Account> mapAccountNameToAccount = new Map<String,Account>();
        for(Account acc :accList){
            mapAccountNameToAccount.put(acc.Name, acc);
        }*/
         // Update Oppty List with newAccountId
        for(Account acc : accList) {
            for(Opportunity oppty : opportunities ) {
                /*if(mapAccountNameToAccount.containsKey(acc.Name)){
                    oppty.AccountId = mapAccountNameToAccount.get(acc.Name).id;
                }*/
               if(oppty.AccountId == acc.ParentId) {
                    oppty.AccountId = acc.Id;
                    opptyListToBeUpdated.add(oppty);
                 }
            }
        }
        if(opptyListToBeUpdated.size()>0) {
            update opptyListToBeUpdated;
        }
    }
    public void finish(Database.BatchableContext BC){
    }
}
how to prevent duplicate accounts.
Any suggestions?

We are developing a React Native App with Expo using Auth2 User Agent Flow (https://help.salesforce.com/articleView?id=remoteaccess_oauth_user_agent_flow.htm&type=0)

I have checked all different post about this topic but I still cannot receive it.

  1. Managed App > Scope > Perform requests on your behalf at any time (refresh_token, offline_access) enabled
  2. Managed App > Scope > Full Access (full) enabled

This is what we send 

https://login.salesforce.com/services/oauth2/authorize
?response_type=token
&client_id=OurCustomerKeyFromTheOrg
&redirect_uri=https%3A%2F%2Fauth.expo.io%2F%40robertovg_pve%2FprecursiveMobile

We receive all data (access_token, instance_url,..) but no refresh_token.

Reading official doc, we have added scope=refresh_token / scope=full%20refresh_token  but the response we have is that "refresh_token" is not a valid scope.

Also, we changed redirectUrl as https://login.salesforce.com/services/oauth2/success but then, how can we redirect back to the app? Putting this url, it gets stuck on the browser after putting credentials

What we missed? What else we can try? Thanks in advance.

Hi All,

I am trying to insert a new document into the Salesforce system referring https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm.

Getting the below error 
[
    {
        "message": "Premature end of input.",
        "errorCode": "JSON_PARSER_ERROR"
    }
]

Input

 
curl -X POST \
  https://company.cs15.my.salesforce.com/services/data/v41.0/sobjects/Document/ \
  -H 'Authorization: OAuth 00De000000........' \
  -H 'Content-Type: multipart/form-data; boundary=boundary_string' \
  -H 'Postman-Token: 0ce6bc42-75a3-45b2-b4d1-03cae18be8b4' \
  -H 'cache-control: no-cache' \
  -d '--boundary_string
Content-Disposition: form-data; name="entity_document";
Content-Type: application/json
{  
    "Description" : "Marketing brochure for Q1 2011",
    "Keywords" : "marketing,sales,update",
    "FolderId" : "00l39000001uYvs",
    "Name" : "Marketing Brochure Q1",
    "Type" : "pdf"
}

--boundary_string
Content-Type: application/pdf
Content-Disposition: form-data; name="Body"; filename="2011Q1MktgBrochure.pdf"

JVBERi0xLjcKCjQgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbmd0aCA1
NjgKPj4Kc3RyZWFtCnicdVU7jt0wDOx9CtcBRIikfjzGVjnAAkmKvADJ/YsMLUuyn5Ot
tEOLGg4.........iAwIFIKL1Jvb3QgMSAwIFIKL1NpemUgNwo+PgpzdGFy
dHhyZWYKMTEyNgolJUVPRgo=
 
--boundary_string--'

Postman service Image
 
component code:
<aura:component >    
    <aura:attribute name="options" type="List" default="[
                                                        {'label': 'Mobile', 'value': 'Mobile'},
                                                        {'label': 'Laptop', 'value': 'Laptop'},
                                                        {'label': 'Hardware', 'value': 'Hardware'},
                                                        {'label': 'Software', 'value': 'Software'},
                                                        {'label': 'TV', 'value': 'TV'},
                                                        {'label': 'Cars', 'value': 'Cars'}
                                                        ]"/>
    <aura:attribute name="select" type="List" default="option1"/>
    
    <aura:attribute name="addItems" type="List"/>
    <aura:attribute name="selectedAddItems" type="List"/>
    <div class="flex-container">
        <div class="border">
            <lightning:checkboxGroup name="unSelected"
                                     label="Unselected Items"
                                     options="{! v.options }"
                                     value="{! v.select }"
                                     onchange="{! c.handleChange1 }"/>
        </div>
        
        <lightning:button label="Add" onclick="{!c.addValue}"/>
        
        <lightning:button label="Remove" onclick="{!c.removeValue}"/>
        
        <div>
            <lightning:checkboxGroup name="selected"
                                     label="Selected Items"
                                     options="{!v.addItems}"
                                     value="{!v.selectedAddItems}"
                                     onchange="{!c.handleChange2}"/>
        </div>
    </div>
</aura:component>

controller code:
({
    // var itemarray:[];
    handleChange1: function (cmp, event)
    {
     // This will contain the string of the "value" attribute of the selected option
     var selectedOptionValue = event.getParam("value");
     //var shw = 
     //alert('selected value list'+selectedOptionValue.indexOf());
     
    },
    
    addValue : function(component, event, helper) 
    {
     // get all value from the list
     
     var clearitems = component.get("v.options");
     
     // get all selected value from the list
     var gtckboxValue = component.get("v.select");
     //alert('selected value list'+gtckboxValue.length);
     var itemsArray=[];
    
     var j=0;
     for(var i=0 ; i< gtckboxValue.length; i++){
         j++;
         itemsArray.push({
             label: gtckboxValue[i],
             value: gtckboxValue[i]
         });
         clearitems.splice(i,1);
         
         // component.set("v.options",clearitems);
         // component.set("v.addItems",itemsArray);
         /*var index = gtckboxValue.indexOf(i);
            alert('index of selected items'+index);
            if(index > -1){
                gtckboxValue.splice(index, 1);
            }*/
         
     }    
     component.set("v.addItems",itemsArray);
     //clearitems.splice(j,1);
     component.set("v.options",clearitems);
    },
    handleChange2: function (cmp, event) {
        // This will contain the string of the "value" attribute of the selected option
        var selectedOptionValue = event.getParam("value");
        alert('adffdji'+selectedOptionValue);
        
    },
    
    removeValue : function(component, event, helper) {
        var gtckboxValue = component.get("v.select");
        
    }
})
Lightning Application code:
<aura:application extends="force:slds">
    <c:MyCustom_List/>
</aura:application>

Thanks in advanced .
  • February 26, 2019
  • Like
  • 0
Hi guys,

I am building a new Lightining Component and need help, please. I have two columns in my main page. I have an Object called: Produtos__c. The left column needs show all Produtos__c.Category__c from the database (DONE). When the user to click in some category, I need show all records with the category clicked by user in right column (NEED HELP).

Something like this:
User-added image
As saw, all products are being shown.

Project details:

InfoSalesMain.cmp
<aura:component controller="InfoSalesController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,lightning:isUrlAddressable" access="global" > 
    
    <aura:handler name="init" value="this" action="{!c.doInit}" />
    
    <aura:attribute name="idProduto" type="String" />
    <aura:attribute name="DetalheProduto" type="Boolean" default="false" />
    <aura:attribute name="Name" type="String"/>
    <aura:attribute name="listaProduto" type="List" default="[]"/>
    <aura:attribute name="listaProdutoCategoria" type="List" default="[]"/>
    <aura:attribute name="listaProdutoByCategory" type="List" default="[]"/>
    <aura:attribute name="produto" type="Object" />
    
    <div class="slds-grid slds-wrap">
        <div class="slds-size_1-of-6">
            <div class="slds-box slds-theme_default">
                Bem-vindo, {!v.Name}
                <br /><br />
                <b>CATEGORIAS EXISTENTES</b>
                <br /><br />
                <aura:iteration items="{! v.listaProdutoCategoria }" var="produto">
                    <ul class="slds-list_horizontal">
                        <li> <a onclick="{!c.categoriaSelecionada}" href="#">{! produto.Category__c }</a> </li>
                    </ul>
                </aura:iteration>
            </div>
        </div>
        <div class="slds-size_5-of-6">
            <div class="slds-box slds-theme_default">
                <lightning:card>
                    <div class="slds-p-left_medium slds-p-right_medium">
                        <ul class="slds-list_vertical slds-has-dividers_top-space">
                            <aura:iteration items="{! v.listaProduto }" var="produto" >
                                <!-- Activate the next line when discovered how get ProdutoByCategory -->
                                <!-- <aura:iteration items="{! v.listaProdutoByCategory }" var="produto" > -->
                                <li class="slds-list__item">
                                    <!-- Here will be the produto image -->
                                    <lightning:avatar size="large" src="/docs/component-library/app/images/examples/avatar2.jpg" initials="CR" fallbackIconName="standard:person_account" alternativeText="Cindy Rice" class="slds-m-right_small"/>
                                    <b>Descrição: </b> {! produto.Description__c }<br/>
                                    <b>Preço:</b> R$ {! produto.Price__c }
                                </li>
                            </aura:iteration>
                        </ul>
                    </div>
                </lightning:card>
            </div>
        </div>
    </div>
    <!-- NEXT SCREEN IS NOT COMPLETE -->
    <aura:if isTrue="{! v.DetalheProduto }">
        <c:DetalheProduto idProduto="{! v.idProduto }"/> 
    </aura:if>
</aura:component>
InfoSalesController.apxc
public class InfoSalesController {
    
    @AuraEnabled
    public static String saveProduto_CTRL(String jsonProduto){
        Produto__c produto = (Produto__c) Json.deserialize(jsonProduto, Produto__c.class);        
        UPSERT produto;
        return 'Produto inserido com sucesso';   
    }
    
    @AuraEnabled
    public static Produto__c getProdutoSObj(){
        Produto__c prod = [SELECT Id, Capacidade__c, Category__c, Description__c, Foto__c, Frequencia__c, Inches__c, Price__c, Socket__c, Storage__c FROM Produto__c];
        return prod;
    }
    
    @AuraEnabled
    public static String deleteProduto_CTRL(String jsonProduto){
        
        Produto__c produto = (Produto__c) Json.deserialize(jsonProduto, Produto__c.class);
        delete produto;
        return 'Produto excluído com sucesso';
    }
    
    @AuraEnabled
    public static List<Produto__c> getListProduto_CTRL(){
        List<Produto__c> listReturnProd = [SELECT Id, Description__c, Foto__c, Price__c, Category__c FROM Produto__c];
        listReturnProd.sort();
        System.debug('listReturnProd: '+listReturnProd);
        return listReturnProd;       
    }
    
    @AuraEnabled
    public static List<AggregateResult> getProdutoCategory_CTRL(){
        List<AggregateResult> listReturnCategoryProd =[SELECT Category__c FROM Produto__c GROUP BY Category__c ORDER BY Category__c ASC];
        return listReturnCategoryProd;
    }
    
    @AuraEnabled
    public static List<Produto__c> getProdutoByCategory_CTRL(String paramCtgSelecionada){
        List<Produto__c> listReturnProdutoByCategory = [SELECT Id, Description__c, Foto__c, Price__c, Category__c FROM Produto__c WHERE Category__c =: paramCtgSelecionada];
        return listReturnProdutoByCategory;
    }
    
    @AuraEnabled
    public static String getUserName() {
        return userinfo.getName();
    }
    
}
InfoSalesMainController.js
({
 	doInit: function(component, event, helper) {
        helper.getUser(component);
        helper.getProdutos(component);
        helper.getCategoriaProduto(component);
    },
    categoriaSelecionada : function(component, event, helper) {
    	//helper.getCategoriaSelecionada(component);
    	var src = event.getSource();
        var name = src.get("v.value");
        component.set("listaProdutoByCategory",name);
    }
})
InfoSalesMainHelper.js
({
    getUser : function(component){
        var action = component.get("c.getUserName");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.Name", response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    getProdutos : function(component) {
        var action = component.get("c.getListProduto_CTRL");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set('v.listaProduto', response.getReturnValue());
            } else if (state === "ERROR") {
                alert('Erro: Lista vazia');
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
            }
        });
        $A.enqueueAction(action);
    },
    getCategoriaProduto : function(component) {
        var action = component.get("c.getProdutoCategory_CTRL");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set('v.listaProdutoCategoria', response.getReturnValue());
            } else if (state === "ERROR") {
                alert('Erro: Lista vazia');
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
            }
        });
        $A.enqueueAction(action);
    },
    
	getCategoriaSelecionada : function(component) {
        var action = component.get("c.getProdutoByCategory_CTRL");
        action.setParams({ 
            paramCtgSelecionada : component.get("v.categoriaClicada")//How to pass this variable to apex?
        });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set('v.listaProdutoByCategory', response.getReturnValue());
            } else if (state === "ERROR") {
                alert('Erro: Lista vazia');
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
            }
        });
        $A.enqueueAction(action);
    }
    
})
What I need to do? What I am forgetting?
Hi all,

I need help figuring out why my visual flow is failing.  Here is the email error information:

Flow Interview Details
Interview Label: Sharing Contact with Breakthrough Role Associated BT Site 2/28/2018 11:37 AM
Current User: Holly Havelka (00533000004LpP0)
Start time: 2/28/2018 11:37 AM
Duration: 0 seconds

How the Interview Started
Holly Havelka (00533000004LpP0) started the flow interview.
Some of this flow's variables were set when the interview started.
varAssociatedBTSiteName = Atlanta
varAssociatedContact = 0031D000003HipNQAS

RECORD QUERY: Lookup_Associated_BT_Site_Role_ID
Find one UserRole record where:
DeveloperName Equals {!varAssociatedBTSiteName} (Atlanta)
Result
Successfully found record.
{!varAssociatedAffiliateSite} = 00E40000000kkg8EAA

RECORD CREATE: Share_Contact_Record_with_Associated_Affiliate_Site
Create one ContactShare record where:
ContactAccessLevel = Read
ContactId = {!varAssociatedContact} (0031D000003HipNQAS)
RowCause = Manual
UserOrGroupId = {!varAssociatedAffiliateSite} (00E40000000kkg8EAA)
Result
Failed to create record.

Error Occurred: This error occurred when the flow tried to create records: FIELD_INTEGRITY_EXCEPTION: User/Group ID: id value of incorrect type: 00E40000000kkg8EAA.
Hi

on my last stage of opportunity, i have 2 checkboxes  
one closed won 
one closed loss
how can i manage to update the probability field in accordance to the checkboxes ? 
if the sales person check closed loss , i want the probabilty to switch to 0% 

 
I had my actual Gmail on Webassessor.com. I am doing Trailhead using Myname@companyname.com(not Actual email just a login name). But I verified Myname@companyname.com account using actual Gmail id(Which  I use on Webassessor).  So, I have question

1. Whatever I will complete on  Myname@companyname.com trailhead then It must show on my webassessor account then What I have to do.
2. Before using Myname@companyname account, I had done many badges using an old Email address which is not exist so can I merge that account on here.
Challenge Not yet complete... here's what's wrong: 
The BoatSearchResults JavaScript controller doesn't call the correct method. The controller must call helper.onSearch(), passing the component.


Anyone Completed this step Please help me with the Answer.
Hello, 

I have a formula that produces an outcome of either YES or NO. 

This formula will produce a NO if any of the selections are made. 

A YES would be produced if additional picklist items are selected (not shown). 

What i'm trying to do, is somehow make this formula shorter if possible? 

Would anyone know how to condense it? 

thanks!

 
IF(
OR(
AND(
NOT(ISPICKVAL([Account].productA, "")),
NOT(ISPICKVAL([Account].productA, "No Location"))
),
AND(
NOT(ISPICKVAL([Account].productAB, "")),
NOT(ISPICKVAL([Account].productAB, "No Location"))
),
AND(
NOT(ISPICKVAL([Account].productXY , "")),
NOT(ISPICKVAL([Account].productXY , "No Location"))
),
AND(
NOT(ISPICKVAL([Account].productEE, "")),
NOT(ISPICKVAL([Account].productEE, "No Location"))
)
), "Yes", "No")

 
  • January 10, 2018
  • Like
  • 0
This might be simple but I am unable to figure out what I am missing. I need to get Project Managers from the VF page and pass them in to my Query. Here is my Apex class and my VF page.
Class :
public class ProjectsFilterByDates{
public ProjectsFilterByDates(ApexPages.StandardController stdController) {
  }
  Date StartDate;
  Date EndDate;
  public String DateStringProperty{get;set;}  
  List<AcctSeed__Project__c> results;
  String[] ProjectManagers = new String[]{};
  public Date getstartDate(){
  return StartDate;
  }
  public Date getEndDate(){
  return EndDate;
  }
  Public List<AcctSeed__Project__c> getresults(){
  return results;
  }
  public void setStartDate(Date input){
  StartDate = input;
  }
  public void setEndDate(Date input1){
  EndDate = input1;
  }
  
     public List<SelectOption> getListOfUser(){
     List<User> Users = [select Name from user Where Project_Manager__c = true Order By Name ASC] ;
     List<SelectOption> options = new List<SelectOption>();
        for(User u : Users)
               {
                options.add(new SelectOption(u.Id , u.Name));
               }
                  return options;
                  }
  public String[] getProjectManagers (){
  return ProjectManagers;
  }
  public void setProjectManagers (string[] ProjectManagers){
  this.ProjectManagers = ProjectManagers;
  }   

  public PageReference Search(){
  results = [SELECT Name,UserID__c,AcctSeed__Account__r.Name,Date_Created__c,Construction_Manager__r.Name,AcctSeedERP__Manufactured_Product__r.Name,Project_Manager__c FROM AcctSeed__Project__c WHERE Date_Created__c >= :StartDate AND Date_Created__c <= :EndDate AND Project_Manager__c =:ProjectManagers order by Date_Created__c desc ];
  return null;
  }
}
VF Page:
<apex:page Standardcontroller="AcctSeed__Project__c" extensions="ProjectsFilterByDates" showHeader="false" sidebar="false" docType="html-5.0" language="en_Us" >
<apex:form >
<apex:pageBlock >
 Start Date: <apex:input type="date" value="{!StartDate}"/>
 End Date: <apex:input type="date" value="{!EndDate}"/>
<apex:selectList value="{!ProjectManagers}" size="5" multiselect="true">
<apex:selectOptions value="{!ListOfUser}"/>
</apex:selectList><p/>

<apex:commandButton value="Search For Projects" action="{!search}"/>
<apex:pageBlockTable value="{!results}" var="p">
<apex:column value="{!p.Name}"/>
<apex:column value="{!p.AcctSeed__Account__r.Name}"/>
<apex:column value="{!p.Project_Manager__c}"/>
<apex:column value="{!p.Date_Created__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
In My Existing VF code I’ve related list "Notes&Attachments" tied to Account
  <apex:relatedList subject="{!account}" list="NotesAndAttachments"   />  

Now i want to replace with Files and Notes.
     <apex:relatedList subject="{!account}" list="AttachedContentDocuments"  />   
      <apex:relatedList subject="{!account}" list="AttachedContentNotes"  />

Issues is with Notes - I’ve to set the API version above 35 in order to identify AttachedContentNotes object. If i do that, I’ll lose access to existing Notes&Attachment on VF Page, since above 36 version are not supported to notes and attachment.

How can i display both Notes&Attachment and AttachedContentNotes ? or what will be an ideal solution, the reason i want Note&Attachments is it has all historical data and other integration ties

Please Suggest,
Thanks In Advance
  • October 27, 2016
  • Like
  • 1
Hi All,

Am facing this issue on step 5 , can any one help me complete this challenge.

User-added image
Hello, 

I've created a modal using showCustomModal, and I want chage the size of close button. 
Can anyone help me ?

User-added image
I am trying to create a detail page button that marks a checkbox as true. Here is the URL I am currently using for my button: /{!Case.Id}/e?retURL=/{!Case.Id}&00N11000004Dwmh=1&save=1

This opens the edit page but does not mark the checkbox as true. Is there a way to do this without opening the edit page? 

Example

Folks,


In the Salesforce Lightning Design System portal, show an example of a toast usage as per link below:

https://www.lightningdesignsystem.com/components/toast/


I used this example as the basis for setting it up in an environment.
The environment is configured as described below:

I have an object, called Alert, where the user can include as many alerts as he wants.
Each record of the object is an alert.

Fields of the Alert__c object:

- Name (Alert ID)
- Alert_Type__c (Example: Success, Info, Error, Warning) - User selects the type of alert you want to display
- Alert1__c (Alert message to be displayed)

 

-------------------------------------------------------------------------------

 

I created a component to display the alert on a certain page as per the code below:

 

Alert.cmp
-----------------


<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride,lightning:backgroundUtilityItem" access="GLOBAL" controller="AlertController">   

    
<aura:attribute name="html" type="List" />
    
    
<aura:attribute name="showToast" type="boolean" default="false"/>
    
<aura:attribute name="Alert" type="Alert__c" default="{'sobjectType': 'Alert__c',
                         'Tipo_de_Alerta__c': '',
                         'Name': '',
                         'Alerta1__c': ''
                          }"/>
    
    
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    
<aura:if isTrue="{!v.showToast}">
    
           <aura:iteration items="{!v.html}" var="lista">        
					<div class="demo-only" style="height: 4rem;">
		
   							 <div class="slds-notify_container slds-is-relative">    
				
        							<div aura:id="alerta" role="status"> 
                                 
                                 <!--  <div id="{!Lista.Name}" role="status">   -->
													<div  class="slds-notify__content">
                            
                                                                <h2 class="slds-text-heading_small ">                
                                                                     <aura:unescapedHtml value="{!lista.Alerta1__c}" />  
                                                                </h2>
                            
                                                    <lightning:buttonIcon iconName="utility:close" variant="bare" alternativeText="Close"
                                                     iconClass="{!v.type == 'warning' ? 'light' : 'dark'}" size="small"
                                                     class="slds-button slds-button_icon slds-notify__close slds-button_icon-inverse"
                                                     onclick="{!c.close}"/>      
    
													</div>
									</div>
							</div>
					</div>
			</aura:iteration>
    
    
    
    
   

</aura:if>
    
    
    
</aura:component>

AlertController.js
-----------------------





({


   doInit : function(component, event, helper)
    {

  var action = component.get( "c.getMsgs" );

         action.setCallback(this, function(response) 
                           {                               
                             
                               var state = response.getState();

                               if(state == 'SUCCESS')
                               {                                   
                                   var alertMsgList = response.getReturnValue();
                                   var lista = [ ];                                  
                                   
                                   
                                   if(alertMsgList.length > 0)
                                   {                                       
                                       component.set("v.showToast", true);                             
                                   }
                                 
                                   
                                   
                                   for(var i = 0; i < alertMsgList.length; i ++) 
                                   {                                       
                                     
                                       /*
                                       var alerta = alertMsgList[ i ].Alerta1__c;
                                       var tipo = alertMsgList[ i ].Tipo_de_Alerta__c;
                                       var titulo = alertMsgList[ i ].Name;                                       
                                       */
                                       
                                      lista.push(alertMsgList[i]);

      						       }
                                   
                                   
                                   component.set("v.html",lista);
                                 
                                   var tipoAlerta = component.find( "alerta" );
                                   
                                   
                              //     var tipoAlerta = document.getElementById("!v.Alert.Name");
                              
                                                                      
                                              $A.util.addClass( tipoAlerta, "slds-notify" );
                                              $A.util.addClass( tipoAlerta, "slds-notify_toast" );  
                                              $A.util.addClass( tipoAlerta, "slds-theme_success" );  
   
                                   
     }
                               
               
                          else {
                                   console.log("Failed with state: " + state);
                               }
                           }); 
        
        
        $A.enqueueAction(action);
        
  
        
    },

   
    
   close: function(cmp, event, helper) 
    {
   $A.util.addClass(cmp.find('alerta'), "slds-hide");
    //  $A.util.addClass(document.getElementById('{!v.lista.Name}'), "slds-hide");
    },
   
   
       
    
})

AlertController.apxc
-------------------------------------




public class AlertController {
    
    
       
    
 @AuraEnabled
    public static List<Alert__c> getMsgs() {
        
        List<Alert__c> lst = new List<Alert__c>();
        lst = [select Tipo_de_Alerta__c, Name, Alert_Style__c,  Alerta1__c from Alert__c where Data_inicial__c <= :system.now() and Data_final__c >= :system.now()];
        return lst;
    }
    

    
}

What happens is that for every alert found, it needs to display it according to its characteristics:
- Type of alert
- Identification of each alert (For each alert, your type configuration and the close button will be checked)
- Alert message: This setting is the only one that is working, need to interact for each alert by formatting your type to receive the appropriate CSS and the close button for it.

In the Controller.js I put the part that configures the CSS and the separate close button just to test its operation, so it works only for one record, I need to put it to work in each interaction and to each of the records that are found .
That's what I can not do, if anyone can help me, I'll be very grateful.
Thank you
Hello there!

We are having login issues with Boomi to Salesforce Rest API where our Oauth token is expiring daily.  Any ideas on how best to setup our connected app or any other thoughts?  Thank you!

User-added image
Hi All,

I have implemented the Custom Breadcrumb in VF Page with Styles but I am getting the ERROR.

ERROR:
Error: Custom_Breadscrumb line 38, column 20: The reference to entity ":after" must end with the ';' delimiter	
Error	Error: The reference to entity ":after" must end with the ';' delimiter.

VF Page:
<apex:page >

<style type="text/css">
       $crumbs-back:#F3F5FA;
$text-color:#8093A7;


body {
    margin: 100px auto;
    font-family: Helvetica;
    background: #FFF;
}

#crumbs {
    text-align: center;
   
ul {
        list-style: none;
        display: inline-table;
        li {
            display: inline;
            
            a {
            display: block;
            float: left;
            height: 50px;
            background: #F3F5FA;
        
            text-align: center;
            padding: 30px 20px 0 60px;
            position: relative;
            margin: 0 10px 0 0; 
            
            font-size: 20px;
            text-decoration: none;
            color: $text-color;
        
            &:after {
                content: "";  
                border-top: 40px solid transparent;
                border-bottom: 40px solid transparent;
                border-left: 40px solid #F3F5FA;
                position: absolute; 
                right: -40px;
                top: 0;
                z-index: 1;
            }
            &:before {
                content: "";  
                border-top: 40px solid transparent;
                border-bottom: 40px solid transparent;
                border-left: 40px solid #fff;
                position: absolute; 
                left: 0; 
                top: 0;
            } 
            
        }
        }
    }
}




        
    
                #crumbs ul li:first-child a {
                    border-top-left-radius: 10px; border-bottom-left-radius: 10px;
                }
                #crumbs ul li:first-child a:before {
                    display: none; 
                }
                
                #crumbs ul li:last-child a {
                    padding-right: 40px;
                    border-top-right-radius: 10px; border-bottom-right-radius: 10px;
                }
                #crumbs ul li:last-child a:after {
                    display: none; 
                }
            
            #crumbs ul li a:hover {
                background: #357DFD;
        color:#fff;
            }
                #crumbs ul li a:hover:after {
                    border-left-color: #357DFD;
           color:#fff;
                }
        
    </style>
 <div id="crumbs">
  <h1>Breadcrumbs</h1>
    <ul>
        <li><a href="#1" ><i class="fa fa-home" aria-hidden="true"></i></a></li>
        <li><a href="#2" ><i class="fa fa-shopping-bag" aria-hidden="true"></i> Shop</a></li>
        <li><a href="#3" ><i class="fa fa-cart-plus" aria-hidden="true"></i> Cart</a></li>
        <li><a href="#4" ><i class="fa fa-credit-card-alt" aria-hidden="true"></i> Checkout</a></li>
        
    </ul>
</div>
</apex:page>

Adv Thanks,
VSK98
  • March 07, 2019
  • Like
  • 0
Hi All,

i have  to display the day with the date formate in vf page. below is the formate which i am using.

timeStrDt = evStartDateTime.format('MMMMM dd, yyyy',userTimeZone);

but is displaying like March 06, 2019 at 11:33:00 PM IST .
but i want the Wed March 06, 2019 at 11:33:00 PM IST

how we can do this.

Thanks in advance
Hello All,
I am querying 'ContentDocumentLink'  in javascript visualforce and I am getting above error any way to fix this. Thanks

Here I am getting proper id value(MyId) as well.
var Content ="Select Id,ContentDocumentId From ContentDocumentLink where LinkedEntityId="  + "'MyId'" ;
			var ContentQuery = sforce.connection.query(Content);
			var records = ContentQuery.getArray('ContentQuery');

 
  • March 06, 2019
  • Like
  • 0
I am firing a SOAP request to Marketing Cloud to update a subscriber, and get back a "400 Bad request" error.
The call is modeled against the example from , except that is used an OAuth token - but the username/password version doesn't work either.
Any idea what is wrong?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
   <soapenv:Header>
   <fueloauth>authtoken</fueloauth>
   </soapenv:Header>soapenv:Header>
   <soapenv:Body>
      <par:UpdateRequest>
         <par:Options/>
         <par:Objects xsi:type="Subscriber">
           <PartnerKey xsi:nil="true"/>
           <ObjectID xsi:nil="true"/>
            <par:Attributes>
                <par:Name>First Name</par:Name>
                <par:Value>Updated</par:Value>
            </par:Attributes>
            <par:SubscriberKey>0036E00000V1YtyQAF</par:SubscriberKey>
         </par:Objects>
      </par:UpdateRequest>
   </soapenv:Body>
</soapenv:Envelope>
I am trying to select multiple users in Assigned to field on Goals(custom object) . i could reproduce all the steps in the link except Testapp.app and got an below error.
http://sfdcmonkey.com/2018/02/20/multi-select-lookup-salesforce-lightning/

Failed to save reUsableMultiSelectLookupRenderer.js: c.reUsableMultiSelectLookup: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Invalid literal value [3, 7]: 'application': Source

my code:

({
    // Your renderer method overrides go here
<aura:application extends="force:slds">
  <!-- Create attribute to store lookup value as a sObject--> 
  <aura:attribute name="selectedLookUpRecords" type="sObject[]" default="[]"/>
 
  <c:reUsableMultiSelectLookup objectAPIName="Goals"
                               IconName="standard:Goals"
                               lstSelectedRecords="{!v.selectedLookUpRecords}"
                               label="Assigned_To__c"/>
   <!-- here c: is org. namespace prefix-->
</aura:application>
}
})
 
Using curl, we're able to connect to a sandbox and salesforce returns an access_token.

However, when we update curl to use the endpoint and credentials (client_id, client_secret, username, and password) for production, the system returns -- 

{"error":"invalid_grant","error_description":"authentication failure"}

The curl stament is as you'd expect...
curl https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=ididididid" -d "client_secret=secretsecretsecretsecretsecretsecret" -d "username=usernameusername" -d "password=passwordtokenpasswordtoken"

The login accessing both environments is configured as an admin with api access.

The connected apps in the sandbox and prod are configured identically.

Stumped!

Thanks for your advice on this...

Steve 
Have a Detail Page Button on an object that open a Visualforce page in a new window.  How do I set the size and position of that new window?
Hi,

Has any one worked on Workday and Salesforce Integration?
In My Existing VF code I’ve related list "Notes&Attachments" tied to Account
  <apex:relatedList subject="{!account}" list="NotesAndAttachments"   />  

Now i want to replace with Files and Notes.
     <apex:relatedList subject="{!account}" list="AttachedContentDocuments"  />   
      <apex:relatedList subject="{!account}" list="AttachedContentNotes"  />

Issues is with Notes - I’ve to set the API version above 35 in order to identify AttachedContentNotes object. If i do that, I’ll lose access to existing Notes&Attachment on VF Page, since above 36 version are not supported to notes and attachment.

How can i display both Notes&Attachment and AttachedContentNotes ? or what will be an ideal solution, the reason i want Note&Attachments is it has all historical data and other integration ties

Please Suggest,
Thanks In Advance
  • October 27, 2016
  • Like
  • 1