• bhanu_prakash
  • SMARTIE
  • 910 Points
  • Member since 2015
  • Salesforce Developer
  • LTI

  • Chatter
    Feed
  • 20
    Best Answers
  • 5
    Likes Received
  • 0
    Likes Given
  • 121
    Questions
  • 288
    Replies
Hi,

Am struggling to get a test class for the following custom list view and hoping for some input here, apex;
 
public with sharing class RecentTechnicalBulletinsHomePage {
  @AuraEnabled
  public static List<Knowledge__kav> getArticles(){
	return [Select Id, Title, LastModifiedDate From Knowledge__kav Where RecordTypeId = '0121k000000CipgAAC' ORDER BY LastModifiedDate DESC LIMIT 10];
  }
}

Now my test class looks as follows;
 
@isTest
public class RecentTechnicalBulletinsHomePageTest
{
@testSetup
static void createArticle(){
    List<Knowledge__kav> testArt = new List<Knowledge__kav>();
            for(Integer i=0;i<10;i++) {
            testArt.add(new Knowledge__kav(Title = 'TestArt'+i));
        }
    insert testArt;
}
public static testMethod void getListView(){
        
	
     } 
}

I am just not sure what method to look for and what to test really.

Any direction/input is highly appreciated! 

Hi,

I have created a VF page and its controller extension to generate and save a PDF report in related Files on a button click. Now on button click, I just want a PDF should get saved in related Files to the record and the page should get redirected to its record detail page without displaying the PDF. This is to be done in Lightning and not Classic. So, I can't even pass record link and a record ID anywhere.

Please do suggest ways to do this. Any help would be highly appreciated.

The scenario is : when the user saves the account record in salesforce org1, it should be automatically get saved in the other salesforce org2, both the things to be happen simultaneously.. 
 note: should have to done with  REST API.. PLEASE PROVIDE ANY LINK OR THE SOLUTION to learn 
Hi, I am trying to build a related list , 
Units has Master relation to praperty

below is my class and page: But I am not getting values in my page.
Thanks in advance.
 
public class DeleteFlag
{
    public Property__c prop{get; set;}
    Public Unit__c unts{get;set;}
    public List<Unit__c> Records {get; set;}
    public DeleteFlag(ApexPages.StandardController controller)
        {
            prop=new Property__c();
            unts = new unit__c(); 
            
            Records = [select Name,Property_Unit__c FROM Unit__c WHERE 
            Property_Unit__c = :Prop.Name];
            system.debug(prop.Name);
            
            
        }

 
I have Table in visual force which pulls all currency value of perticular vendor in the year and few filters all performed to find total values quater values extra. i need to display comma after thousands. There are so many fileds so i cant if codition for all the fileds. Please let me know how to handel this?
 
Hi,

I wrote a batch to update the fields, i got the below errors for my code

User-added image
Code
global class updatezone implements Database.Batchable<sObject>,Database.stateful{
    
    //Start Method....   
    global Database.querylocator start(Database.BatchableContext bc){
        Query = 'SELECT id,No_of_Agents__c,No_of_Female_Agents__c,No_of_Male_Agents__c,Agents_40_years_and_above__c,Agents_below_40_years__c,X1_star_Agents__c,X2_star_Agents__c,X3_star_Agents__c,X4_star_Agents__c,X5_star_Agents__c'+
            				' FROM Zone__C ';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext bc, List<Zone__C> scope){
                 for(zone__c z : [SELECT Id,Name__C,No_of_Agents__c,No_of_Female_Agents__c,No_of_Male_Agents__c,Agents_40_years_and_above__c,Agents_below_40_years__c,X1_star_Agents__c,X2_star_Agents__c,X3_star_Agents__c,X4_star_Agents__c,X5_star_Agents__c FROM 
                         Zone__C]){
                              z.No_of_Agents__C = [SELECT count() FROM Agent__C WHERE Zones__C =: z.Name__C];
                              z.Agents_below_40_years__C = [SELECT count() FROM Agent__C WHERE Age__C <=40 AND Zones__C =: z.Name__C ];
                              z.Agents_40_years_and_above__c = [SELECT count() FROM Agent__C WHERE Age__C > 40 AND Zones__C =: z.Name__C ];
                              z.No_of_Male_Agents__C = [SELECT count() FROM Agent__C WHERE Gender__C =: 'Male' AND Zones__C =: z.Name__C ];
                              z.No_of_Female_Agents__C = [SELECT count() FROM Agent__C WHERE Gender__C =: 'Female' AND Zones__C =: z.Name__C];
                              z.X1_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =1 AND Zones__C =: z.Name__C ];
                              z.X2_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =2 AND Zones__C =: z.Name__C ];
                              z.X3_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =3 AND Zones__C =: z.Name__C ];
                              z.X4_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =4 AND Zones__C =: z.Name__C ];
                              z.X5_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =5 AND Zones__C =: z.Name__C ];
                         }
upsert z;
    }
    public void finish(Database.BatchableContext bc){
         Id job= bc.getJobId();
         }
}

 
Can I use any Lightning component to create tables with multiediting mode?
How to write in trigger when the Opportunity is Closed Won the related Child Record’s Amount field will be equal to Opportunity’s Amount field.
Once I click on Submit button on a visualforce page, a Browser message should open which should have the option of "Agree" and "Disagree" and Save Button. How do I go about doing this?
<aura:component controller="MyContactListController" implements="force:lightningQuickAction" access="global">
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="Account" type="Account" />
    <aura:attribute name="Contacts" type="Contact" />
     <aura:attribute name="Opportunities" type="Opportunity" />  
    <aura:attribute name="Columns" type="List" />
    <aura:attribute name="MyColumns" type="List"/>
    <aura:handler name="init" value="{!this}" action="{!c.myAction}" />
    <aura:handler name="AddRowEvt" event="c:AddNewRowEvt" action="{!c.addNewRow}"/>

    
    <force:recordData aura:id="accountRecord"
                      recordId="{!v.recordId}"
                      targetFields="{!v.Account}"
                      layoutType="FULL"
                      />
    <lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
        <!-- Contact list goes here -->
        <lightning:datatable data="{! v.Contacts }" columns="{! v.Columns }" keyField="Id" hideCheckboxColumn="true"/>
         <aura:iteration items="{!v.contactList}" var="item" indexVar="index">
                <c:dynamicRowItem ContactInstance="{!item}" rowIndex="{!index}" />
            </aura:iteration>

    </lightning:card>
    <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Contact</button>
          
        </div>
      </div>
    
    <lightning:card iconName="standard:opportunity" title="{! 'Opportunity List for ' + v.Account.Name}">
        <!-- Opportunity list goes here -->
        <lightning:datatable data="{! v.Opportunities }" columns="{! v.MyColumns }" keyField="Id" hideCheckboxColumn="true"/>
        <br/>
    </lightning:card>
    
    <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Opportunity</button>
          
        </div>
      </div>
</aura:component> this is my component ,any suggestions?
Hi All,

We have client who has its own website. When the user clicks in a link he is redirected to force.com site. But he is redirected to site URL which is is in HTTP. My requirement is that the URL should be changed from HTTP to HTTPS. The HTTPS setting checkbox in session settings is enabled. In the login settings of site, the secure web address is given as HTTPS. Is there any way that when user click on the link, it opens HTTPS instead of HTTP site URL. I tried to change to HTTPS in href tag of the website but its not working.

Thanks,
Anuj
I have trield almost every code and solution from forum still stuck into this challange.
Challange
Refactor Components and Communicate with Events
Refactor the input form for camping list items into its own component and communicate with component events.
Replace the HTML form in the campingList component with a new campingListForm component that calls the clickCreateItem JavaScript controller action when clicked.
The campingList component listens for a c:addItemEvent event and executes the action handleAddItem in the JavaScript controller. The handleAdditem method saves the record to the database and adds the record to the items value provider.
The addItemEvent event is of type component and has a Camping_Item__c type attribute named item.
The campingListForm registers an addItem event of type c:addItemEvent.
The campingListFormController JavaScript controller calls the helper's createItem method if the form is valid.
The campingListFormHelper JavaScript helper creates an addItem event with the item to be added and then fires the event. It then resets the newItem value provider with a blank sObjectType of type Camping_Item__c.

I am not pasting entire code as it is too lengthy.

I am trying from past 2 days, many hours ... still no luck.
Tried with every possible solution from Forum and StackExchange tried with fresh Trailhead Org, nothing worked.
with each try .. getting new errors.
Can someone please try the solution in their system and provide it in the comment ssection. That would be a great help.
Thanks in advance,
Manoj
 
Hello ,

I have a ligthning:dataTable not displaying correctly.

There is no header visible and also data is not visible.
Please explain why.
 
<aura:if isTrue="{!v.showCsResults}">          	
            <lightning:datatable data="{!v.csResults}" columns="{!v.csResultsColumns}" keyField="siret" hideCheckboxColumn="true" onrowaction="{!c.siretiser}" />
        </aura:if>
 
init: function (component, event, helper) {
        //This method is called on initialization
        //It formats the lightning:dataTable that will display the CS results with the appropriate columns and data types
        
         var actions = [
            { label: 'Sirétiser', name: 'siretiser' },
        ];
        
        component.set('v.csResultsColumns', [
             		{label: 'Siret', 							fieldName: 'siret', 	type: 'text'},
            		{label: 'Nom du Compte', 					fieldName: 'nomCompte', type: 'text'},
                    {label: 'Rue', 								fieldName: 'rue', 		type: 'text'},
            		{label: 'CP', 								fieldName: 'cp', 		type: 'text'},
            		{label: 'Ville', 							fieldName: 'ville', 	type: 'text'},
            		{ type: 'action', typeAttributes: { rowActions: actions } }
                ]);
    }


 
var csresults = new Array();
                    
					for (var item of results.companies) {
                        var csresult = new Object();
                        csresult.siret = item.regNo;
                        csresult.nomCompte = item.name;
                        csresult.rue = item.address.street;
                        csresult.cp = item.address.postalCode;
                        csresult.ville = item.address.city;
                        
                        csresults.push(csresult);
                    }
                    
                    
                    component.set('v.csResults', csresults);
                    component.set('v.showCsResults', true);


 
Hi All,
how to schedule batch class for  every 2 minuets

My Batch class :
global class InsertIterableBatch  implements database.Batchable<Slot__c> {
global Iterable<Slot__c> start (database.Batchablecontext bc){
        list<Slot__c> slotReclist = new list<Slot__c>(); 
        for(integer i=0;i<100;i++){
        Slot__c  slotRe = new Slot__c();
        slotre.RecordTypeId = '01228000000SxvX';
        slotRe.Duration__c = 1;
        slotRe.start_date_time__c = Datetime.newInstance(2018,5,1,15,0,0);
        slotRe.End_Date_Time__c =   Datetime.newInstance(2018,5,1,15,0,0);  
        slotRe.Max_No_Of_Students__c = 10;
        slotReclist.add(slotRe);
        }
        return slotReclist;
        }
global void execute (database.BatchableContext bc, list<Slot__c> slotreclist){
        insert slotReclist;
        }
global void finish (database.Batchablecontext bc){
        }
        }

how to schedule batch class for every 2 minuets

Visualforce Page and the corresponding peview.
HelloWorld VF page with HTML Headers
VF preview

Lightning Componet and its preview

Lightning Component with HTML Headers

Lightning component preview

Lightning Component preview

In lightning line break is applied automatically for each header tag where as in visualforce line break needs to applied to get content in new line.
And in visualforce and lightning the headers tags are rendered correctly all have same size even the headers are different




 

Hello,

I am looking for way for below two things
1) associate a lead with the a existing contact
2) associate a account with the existing contact

Thank you for guiding
I'm sure I might be missing something but I'm trying to enable or confirm whether the Ant Migration Tool is enabled in my Connected Apps. In the "Lightning Experience", if I go to setup, Manage Apps under Administration Setup, I see the Ant Migration Tool listed with no 'Start URL' defined, but under Setup, App Setup, Apps, I don't see it listed anywhere. The Force.com REST API Developer Guide doesn't explicitly state what to do in this situation, but I wanted to know if based on my settings whether the Ant Migration Tool is already setup for Oauth2.
I have developed a VisualForce page on one staging sandbox. I would like to make a package of it and deploy it on another staging sandbox. What would be a procedure I must follow?

Thank you
Hi team,

I have 3 custom objects Work__c, Team_Work__C, Work_Task__C and User__c

User__C object has Name
Work__c object has Name, Time
Team_Work__c has Work_Name (lookup to Work), User_Name(lookup to User),Role_of_work (picklist)
work_Tasks__c has Assigned_To__C, Status__c, Work (lookup to Work)

Now iam creating a work_Tasks__c 

I need to create a work record 

1. Work : Car have issue
   time : 2:00Pm
 
Then i will assign it with Team_Work__c  
Role_of_work : Picklist contains (Manager, Supervisor, technical)
 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test
      Role_of_work  : Manager 

 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test1
      Role_of_work  : Supervisor 
 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test2
      Role_of_work  : technical 
 2. Team_Work__c_id : auto Number
      Work_Name     : car have issue (lookup to work)
      User_Name     : Test3
      Role_of_work  : technical 

NOte:  it have 1 Manager(only) and 1 Supervisor need to be for each Team Work record.

Now iam trying to Work_Task__C task 

work_Tasks__c has Status__c, Assigned_To__C, Work (lookup) 
Status__c    : New, in hold, urgent
 
  3.  Work :  Car have issue
      Status :  New 
      Assigned : Test  (need to assign test because he is Manager)

      Status :  in hold 
      Assigned : Test1 (need to assign test1 because he is Supervisor)

      Status :  urgent 
      Assigned : Test2/test3  (need to assign test2/test3  because he is technical)

Thanks for advance
HI,

I have three fields   start__c, end__c and actual_date__c, Iam looking to write validation rule,
1. end date need to be less than start date
2. Start date can't be more than end date.
3. Actual date need to be between start date and end date.
Note: All are date fields and actual date is optional to save record
i have tried it. its not working
IF(
	ISBLANK(actual_date__c),			
			(
				And
				(
					(
					 start__c > actual_date__c
					),   
                    (
					  actual_date__c < End__c
					)
                )			
            )		
			,		
		   (
            And
            (
                (
                    start__c > End__c
                ),   
                (
                End__c < start__c
                )
            )
         )
)


 
Hi Team

Iam trying migrate javascript button into lightnig component need some help to design it stucked on 
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} 

if ({!NOT(ISNULL(Lead.Email))}) {
alert("Lead email is created");
} else if ({!Lead.phone = true}) {
alert("Lead phone number is validate");
} else if({!Lead.Status = false}) { 
alert("Lead status is false.");
} else if({!Lead.Status = true} && {!Lead.stage = true}) { 
alert("Lead has been create sucessfully");
} else { var msg = sforce.apex.execute("LeadWebClass","sendMailToLead",{LeadID:"{!Lead.Id}"}); 
alert(msg); 
window.location.reload();
}
Thanks for advance
Hi Team,

Iam creating chatbot to create a case . I have created slot name as

description   datatype as Text
Priority         datatype as Text
and iam trying to create a case using inovcable case , unable to create case
case contact need to logined in user contact name and account name need to be logined user account name.
 
public class ChatBotCreateCase {    
    @InvocableMethod(label='Create a Case' description='New case creation for the specified text')   
    public static List<Case> CreateCases(List<CreateCaseString> requests){               
        List<Case> results = new List<Case>(); 
        for(CreateCaseString request: requests){
            system.debug('Case Results:' +request.value);
            if(request.ObjCase !=null && request.ObjCase.Id != null && String.isNotBlank(request.value)){
                User us = [select id, Name,User.Contact.AccountId,User.Contact.Name from User where id =: UserInfo.getUserId()];
                Case newCase = request.ObjCase;
                newCase.Status = 'New';          
                newCase.Origin = 'Web';
                newCase.Subject = 'Reach out to user ' + us.Contact.Name + ' having email id ' + us.Contact.Email + ' for following question ';                 
                insert newCase;
                list<User> communityUser = [select id, Name,User.Contact.AccountId,User.Contact.Name from User WHERE id =: UserInfo.getUserId()];{
                    User Currentuser = Communityuser[0];
                    Currentuser.Phone = request.value;
                    update Currentuser;
                }
                return new List<Case>{newCase};            
                    }
        }
        return new list<Case>{requests[0].Objcase};     
            }     
    
    public class CreateCaseString{
        @InvocableVariable
        public string value;
        @InvocableVariable
        public Case ObjCase;
    }
    
}

Thanks for advance
Hi,

need some list of communities site which are using salesforce for their live websites
 
Hi Team,

I have a button in lead list view as Send mail to all Leads on click on button need to send mail to all users with my custom email template, How can i acheive these functionlaity .

Thanks for advance
Hi Team,

send email to user when oppournity is closed, how can we acheive that using trigger
hi Team,

send email to user whenever lead is status is changed. using trigger 
Hi Team,
Iam using javascript button on click custom button on lead object, when lead status is new need to redirect into a visualforce page with id. 
below code is working in classic 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var status = '{!Lead.Status}';
if (status != 'New') {
    alert('Please ensure this Lead is at the New Status prior generating the reservation form');
}
else{
   window.open('/apex/Downloadaspdf?retURL={!Lead.Id}&id={!Lead.Id}&noopptt={!Lead.LastName&", "&Lead.FirstName}'); 
}
I have idea that javascript buttons will not work in lightning 
how can i move it into lightning  without using lightning component

any help :) 

Thanks for advance 
Hi,

I have two visualforce pages and 1 vf page iam showing filter page and on click on show table button. Dispaly of table need to display in another vf page
Hi,

I have added dynamic table supporting nice in visual force page , now i need to modift rgem to support in lightning too 
Visual force Page 
<apex:page controller="DynamicTableController" showHeader="false" sidebar="false" lightningStylesheets="true">
    <html lang="en">

    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
<apex:pageBlock >
    <apex:form >
        <apex:actionFunction name="ObjectFileds" action="{!ObjectFields}"/>
        
        <apex:commandButton value="Show Table" action="{!ShowTable}"/>
        
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Select Object" id="obj"/>
                <apex:selectList multiselect="false" size="1" value="{!SelectedObject}" onchange="ObjectFileds();">
                    <apex:selectOption itemLabel="--None--" itemValue="--None--"/>
                    <apex:selectoptions value="{!supportedObject}" />
                </apex:selectlist>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Select Field" rendered="obj"/>
                <apex:selectList multiselect="true" size="5" value="{!SelectedFields}">
                    <apex:selectOption itemLabel="--None--" itemValue="--None--"/>
                    <apex:selectoptions value="{!fieldLableAPI}" />
                </apex:selectlist>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockTable rendered="{!IF(ObjectList.size > 0 , true , false)}" value="{!ObjectList}" var="rec">
                <apex:column value="{!rec.Id}" rendered="{!IF(SelectedFields.size == 0 , true, false)}"/>
                <apex:repeat value="{!SelectedFields}" var="FieldLable">
                    <apex:column value="{!rec[FieldLable]}" rendered="{!IF(FieldLable != '--None--' , true, false)}"/>
                </apex:repeat>
            </apex:pageBlockTable>
            
            <apex:outputPanel rendered="{!IF(ObjectList.size < 1 , true , false)}">
                <apex:pageMessage severity="ERROR" summary="No records to display"/>
            </apex:outputPanel>
            
        </apex:pageBlockSection>
        
    </apex:form>
</apex:pageBlock>
</html>
</apex:page>

Controller
 
public class DynamicTableController
{
    //List displayed on UI
    public List<selectoption> supportedObject {get; set;}
    
    //Selected Object
    public String SelectedObject {get; set;}
    
    //Global describe
    Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
    Set<String> objectKeys = gd.keySet();
    
    //Field Select List
    public List<SelectOption> fieldLableAPI {get; set;}
    
    //Selected fields to be displayed in table
    public List<String> SelectedFields {get; set;}
    
    //List to maintain dynamic query result
    public List<sObject> ObjectList {get; set;}
    
    
    //Constructor
    public DynamicTableController()
    {
        //Initialize
        supportedObject = new List<selectoption>() ;
        SelectedObject = '' ;
        fieldLableAPI = new List<SelectOption>() ;
        SelectedFields = new List<String>() ;
        ObjectList = new List<sObject>() ;
        
        //Get only reference to objects
        for(Schema.SObjectType item : ProcessInstance.TargetObjectId.getDescribe().getReferenceTo())
        {
            //Excluding custom setting objects
            if(!item.getDescribe().CustomSetting)
            {
                //Adding to list
                supportedObject.add(new SelectOption(item.getDescribe().getLocalName().toLowerCase() , item.getDescribe().getLabel() ));
            }
        }
        
    }
    
    //Get fields of selected object
    public void ObjectFields()
    {
        if(SelectedObject != '--None--')
        {
            //Creating sObject for dynamic selected object
            Schema.SObjectType systemObjectType = gd.get(SelectedObject);
            //Fetching field results
            Schema.DescribeSObjectResult r = systemObjectType.getDescribe();
                
            Map<String, Schema.SObjectField> M = r.fields.getMap();
            //Creating picklist of fields
            for(Schema.SObjectField fieldAPI : M.values())
            {
                fieldLableAPI.add(new SelectOption(fieldAPI.getDescribe().getName() , fieldAPI.getDescribe().getLabel())) ;
            }
        }
    }
    
    public void ShowTable()
    {
        //Creating dynamic query with selected field
        String myQuery = 'Select Id ' ;
        
        for(String field : SelectedFields)
        {
            if(field.toLowerCase() != 'id' && field.toLowerCase() != '--none--')
            myQuery += ','+ field + ' ' ;
        }
        
        //Limit is 100 for now you can change it according to need
        myQuery += ' from ' + SelectedObject + ' LIMIT 100' ;
        
        //Executing the query and fetching results
        ObjectList = Database.query(myQuery) ;
    }
}

I have tried to move into lightning functions are not working fine  stuck with script
 
<apex:page controller="DynamicTableController" showHeader="false" sidebar="false" lightningStylesheets="true">
    <body>
        <apex:form >
        <div class="slds-form-element" style="text-align;" id="myBtn">
            <apex:commandButton styleClass="slds-button slds-button_neutral" value="Back"/>
        </div>
        <div class="container">
            <div class="panel panel-default">
                <div class="panel-heading">Choose an Object</div>
                <div class="panel-body">
                    <div class="row">
                        <div class="form-group">
                            <div class="col-sm-6">
                                <select class="form-control" id="meal">
                              <option value="" selected="true">--Select--</option>
                           </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
        </div>
        <!-- Second Section -->
        <div class="container">
            <div class="panel panel-default" id="panel_2">
                <div class="panel-heading">
                    Choose Set of Fields (hold shift to select more than one):
                </div>
                <div class="panel-body">
                    <div id="pickList_2">
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Third Section -->
        <div class="container">
            <div class="panel panel-default" id="panel">
                <div class="panel-heading">
                    Choose Unique Identifier1 (hold shift to select more than one):
                </div>
                <div class="panel-body">
                    <div id="pickList">
                    </div>
                </div>
            </div>
        </div>        
        </apex:form>
    </body>
    </html>
</apex:page>

 
Hi,

Iam looking to fetch all list of custom settings and need to display in Vfpage 
i have verifed and found that we can call one custom settings and refer in vf page 
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_custommetadatatype__mdt.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm#apex_methods_system_custom_settings

But I need to fetch list of custom setttings .. How can i acheive it ?

 
Hi Team,

Need to display popup with contains account and contact button ..  If i click on contact need to display list of contacts with pagination .
if i click on accounts need to display list of accounts with pagination
need to support both lightning and classic.

Thanks for advance
Hi team,
I have tried to create a trigger to find dupilcate insertation and it is working fine. But it need to modify as per best practice 
trigger LeadDuplicateFinder on Lead (before insert, before update) {  
  	list <lead> lead = new list <lead>();
    for (lead a: trigger.new) {
        lead = [select id, name, email, phone from lead where email =: a.email AND Phone =: a.Phone];
        if (lead.size() > 0) {
            a.email.adderror('Email contains already exist');
            a.Phone.adderror('Phone Number contains already exist');
        }   
	}
}
Thanks for advance
 
Hi,

I need to design approval process we need to send approval for 5 users, 
If 1st user accepts then it need to more 2nd approval then 3rd then 4th then 5th
if any one reject that need to move back 
ex: if 3th rejects need to go to 2nd to approval.

How can we acheive these ?
Hi Team,

I have created lightning communty in my org. user has custom field type__c is gold, platinum, silver. If user is gold need to show on template, if user is platinum need to show another template.
1. How can i created same template with different UI 
2. How can i send user that particluar template based on type__c ?

Thanks
Hi Team,

Need to update Jira ticket fields when salesforce case field got update . How can we acheive it ?
we are using Custom Jira connector . Need help how to acheive via apex code ?

Thanks for advance
Hi Team,

How to design Jira integration with salesforce (without any connector or third party tools). Help me to design it.

 
I have designed trigger of Asset__c object , I was stucked it need to be use with trigger handler and with test class need help on that
 
trigger AssetTrigger on Asset__c (after insert, after update, after delete) {
    
    Set<Id> acctIds = new Set<Id>();
    if(trigger.isAfter){
        if(Trigger.isInsert || Trigger.isUpdate)
        for(Asset__c assetItem : Trigger.new){
            if(assetItem.Name != Trigger.oldMap.get(assetItem.Id).Name && assetItem.BillToAcc__c != null)
                acctIds.add(assetItem.BillToAcc__c);
        }

        if(Trigger.isDelete)
        for(Asset__c assetItem : Trigger.old){
            if(assetItem.BillToAcc__c != null)
            acctIds.add(assetItem.BillToAcc__c);
        }

        if(!acctIds.isEmpty()){
            
            List<Account> acctList = [Select Id, Count__c, (Select Id from BillToItem__c) from Account where Id in: acctIds];
            for(Account acc : acctList ){
                acc.Count__c= acc.BillToItem__c.size();                
            }
            system.debug('acctList'+acctList);
            update acctList;
        
        }

    }else if(trigger.isBefore){

    }       
    
}

 
Hi Team,

when ever I created new report and click on close need to new report and it need to dynamic for all new report created. so i need to bypass close button . ?
If yes- how can i achieve that and it need to support lightning too 
 
Hi,

I need to design approval process we need to send approval for 5 users, 
If 1st user accepts then it need to more 2nd approval then 3rd then 4th then 5th
if any one reject that need to move back 
ex: if 3th rejects need to go to 2nd to approval.

How can we acheive these ?
 I have 3 objects   expense report, Region and Resource and all have lookup fields need to update using trigger.
 
 1. Expesene report has fields
 
    Expense Report Name :
    Region                :
    Company                 :
 
 2. Region object has fields
    Region Name:
    Resource   :
 
 3. Resource object has fields
    Resource Name :
    Company       :
    
    
 I need to write trigger that when expense report has created need to update company name automatically from (Expesene_report__r.Region__r.Resource__r.Company__c
 
  1. Expesene report has fields
 
    Expense Report Name :  Travel to company
    Region                :  England
    Company                :
 
 2. Region object has fields
    Region Name:  England
    Resource   :    Rajeev
 
 3. Resource object has fields
    Resource Name :    Rajeev
    Company       : Sunny Industries
    
    
    If Expense report (Travel to comapny ) is saved i need to update company as (Sunny Industries ) automatically..
How to store 700 picklist fileds ?
How can i get only text from words
EX:  Sultan Road
output : Road
How to convert text output into picklist
HI,

I have three fields   start__c, end__c and actual_date__c, Iam looking to write validation rule,
1. end date need to be less than start date
2. Start date can't be more than end date.
3. Actual date need to be between start date and end date.
Note: All are date fields and actual date is optional to save record
i have tried it. its not working
IF(
	ISBLANK(actual_date__c),			
			(
				And
				(
					(
					 start__c > actual_date__c
					),   
                    (
					  actual_date__c < End__c
					)
                )			
            )		
			,		
		   (
            And
            (
                (
                    start__c > End__c
                ),   
                (
                End__c < start__c
                )
            )
         )
)


 
Hi All,

I am invoking a @InvocableMethod from my Einstein Bot and unfortunately, it seems to have some error and the chat get transferred to a Live agent and stops. I need to debug my @InvocableMethod in order to understand the error. I have tried with logs in developer console and Debug Logs but nothing gets recorded when Invoking the method. Please share your insights on this issue.

Thanks and Regards
Ajay Krishna R
Hi Expert,

I am using below code in my lightning componant but facing error "Jquery_File/jquery-3.3.1.min.js 404 (Not Found)" in browser console.

here "Jquery_File" is static resources name and 
 <ltng:require scripts="{!$Resource.Jquery_File + '/jquery-3.3.1.min'}" />

https://testnewdomian-dev-ed.livepreview.salesforce-communities.com/sfsites/c/resource/1535093740000/Jquery_File/jquery-3.3.1.min.js 404 (Not Found)

Thanks
Mukesh

 
Can someone help here.I am automation engineer.Want to move to slesforce.What will you do if saleforce shuts down someday?
Hi All,

Can someone please tell me. is it possible to load data from Oracle or ther DB directly to Eisntein Analytics platform.

Thanks,
Ram

First time using a salesforce web-to-lead form in a vue app. Trying to add axios (requirement for the current project) and am getting back a COR issue:
Failed to load https://ap4.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access.
 
import axios from 'axios';

export default ({
  name: 'app',
  data() {
    return {
      country: '',
      first_name: '',
      last_name: '',
      email: '',
      company: '',
      URL: '',
      phone: '',
      revenue: '',
      emailOptOut: ''
    }
  },
  methods: {
    submitForm() {
      axios.post('https://ap4.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', {
        crossdomain: true,

        country: this.country,
        first_name: this.first_name,
        last_name: this.last_name,
        email: this.email,
        company: this.company,
        URL: this.URL,
        phone: this.phone,
        revenue: this.revenue,
        emailOptOut: this.emailOptOut
      }).then(response => {
        this.response = JSON.stringify(response, null, 2)
      })
    }
  }
})
<template>
<div id="app">
 <div class="main">
      <div class="container"> 
        <img src="/images/image.png" alt="">
          <h1>Test Account<br>Sign Up</h1>  
          <form @submit.prevent="submitForm">

        <input type=hidden name="oid" value="webtoformnumber">
        <input type=hidden name="retURL" value="https://www.project.com/thankyou">

<div class="field">
    <label for="country">
      Country
    </label>
  <div class="control">
      <input class="input" id="country" name="country" type="text" v-model= "country" required autocomplete="off">
  </div>
</div>

<div class="field">
  <label for="first_name">First Name</label>
  <div class="control">
    <input class="input" id="first_name" name="first_name" type="text" v-model= "first_name" required autocomplete="off">
  </div>
</div>

<div class="field">
  <label for="last_name">Last Name</label>
  <div class="control">
    <input class="input" id="last_name" name="last_name" type="text" v-model= "last_name" required autocomplete="off">
  </div>
</div>

Pretty new at this so apologise in advance is theres already an answer out there (checked but can't seem to find one for vue/sfdc/axios)
Any help would be greatly appreciated! Thanks!
i am getting this error while logging through username and password through login.salesforce.com.But iam able to login into the application through SSO .
Hi,

Am struggling to get a test class for the following custom list view and hoping for some input here, apex;
 
public with sharing class RecentTechnicalBulletinsHomePage {
  @AuraEnabled
  public static List<Knowledge__kav> getArticles(){
	return [Select Id, Title, LastModifiedDate From Knowledge__kav Where RecordTypeId = '0121k000000CipgAAC' ORDER BY LastModifiedDate DESC LIMIT 10];
  }
}

Now my test class looks as follows;
 
@isTest
public class RecentTechnicalBulletinsHomePageTest
{
@testSetup
static void createArticle(){
    List<Knowledge__kav> testArt = new List<Knowledge__kav>();
            for(Integer i=0;i<10;i++) {
            testArt.add(new Knowledge__kav(Title = 'TestArt'+i));
        }
    insert testArt;
}
public static testMethod void getListView(){
        
	
     } 
}

I am just not sure what method to look for and what to test really.

Any direction/input is highly appreciated! 
Hello All, 

I built a Asset Tracking object in our salesforce instance to track our assets internally. I added a button called "Request Item" that kicks off an approval process to admin when submitted. Everything is working on that end, however, when the user (any user) clicks "Request Item" the error message. If they go through the form and fill out info, it's works perfectly fine, however i think the error message will throw people off. How do I remove it?

Error: Invalid Data. 
Review all error messages below to correct your data.

Pops up. It's due to the fact that the contact name has duplicates, so i'd like to remove the error message so it runs smoothly. This is the button code. User-added image

/a5V/e? 
CF00NC0000007IvpQ={!Contact.Name} 
&CF00NC0000007IvpQ__lkid={!Contact.Id} 
&CF00NC0000007J19p={!Account.Name} 
&CF00NC0000007J19p__lkid={!Account.Id} 
&CF00NC0000007J1DX={!TODAY()} 
&retURL=%2F{!Contact.Id}

Help Please!
I have account and contact standard object . I want to insert data in account and contact object together using apex. contact details should be inserted into account . Please help me out
We have a custom object, Purchase Request, that we'd like to clone along with its line items. Currently, we have the native "clone" button that only clones the Purchase Request itself but does not clone with the Purchase Request Line Items. Any help would be appreciated!
Hi,

Is salesforce ligthtning is ruling now ? Is it necessary to learn lightning as developer? what will be used in lightning development and what are prerequisites to learn it.?

Thank you
Hi All,
I would like to display the contact details using <lightning:recordForm/>. But When I am trying to that, It is not working. Could Please help me out regarding this.

Here with I wull put my code. If anyof you having working code with <lightning:recordForm/> Please let me know as well.
<lightning:recordForm
                              recordId="0036F00002XkajhQAB"
                              objectApiName="Contact"
                              fields="Id"
                              columns="2"
                              layoutType ="Full"
                              mode="View"
                              onsuccess="{!c.myAction}"/>
passing parameter method in(firstname,lastname,email)and query with in contact object email is there means it will show its generate or not create any email it create automatically new contact will create .lead exit covert to contact/account,does not exit means convert contact .successfully...using apex class
I am using few custom labels in in my class i have to cover code coverage for that

            /* fetch required properties from custom labels*/\

            Storefront=System.Label.RLWS_CL_EmbTrack_Storefront;
            LOGO=System.Label.RLWS_CF_Logo;
            UniversalLogo=System.Label.RLWS_CF_Universal_Logo;
            UniversalLogoPrice=System.Label.RLWS_CF_Universal_Logo_Price;
            
            currencies = [Select label from RLWS_Obj_Currency__mdt Limit 100];

Can you please tel how to cover this area
 

Hi,

I have created a VF page and its controller extension to generate and save a PDF report in related Files on a button click. Now on button click, I just want a PDF should get saved in related Files to the record and the page should get redirected to its record detail page without displaying the PDF. This is to be done in Lightning and not Classic. So, I can't even pass record link and a record ID anywhere.

Please do suggest ways to do this. Any help would be highly appreciated.

Hi,

I am on the "Build Better With UX > UX Prototyping Basics > Iterate On Your Prototype" module, and the Challenge for doing:

Add icons to the rest of card titles for the Contacts and Leads to make it clearer for the user which card is which, using the iconName attribute of the lightning:card base Lightning component.
In the Apex Controller, limit the account, contact and lead SOQL queries to return 5 records.

will not find the code I have *definitely* inputted (the icons and listings are showing up in my playground AOK).

The error I get is:

Challenge Not yet complete... here's what's wrong: 
Could not find the iconName code for contacts in the ResultsSection component.


But from my console:
<h2 class="slds-text-heading--medium slds-p-vertical--medium">Contacts</h2>
      <div class="slds-grid">
        <ul class="slds-col slds-size--1-of-1">
          <aura:iteration items="{!v.contacts}" var="contact" indexVar="index">
            <li class="slds-size--1-of-3 slds-show--inline-block">
              <lightning:card variant="narrow" iconName="standard:user" class="slds-m-around--small">
                <aura:set attribute="title">

It is definitely there.

What's going on here?

Thanks.