• satish pal
  • 15 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
  • 8
Create a field on Account called “is_gold”, checkbox, default off Assignment: When an Opportunity is greater than $20k, mark is_gold to TRUE
Visualforce Error
Help for this Page
System.DmlException: Insert failed. First exception on row 0 with id 0012v00002kVoWWAA0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
Error is in expression '{!InsertSelectedRecords}' in component <apex:commandButton> in page selectedpage: Class.Acc_Dynamic.InsertSelectedRecords: line 30, column 1
Class.Acc_Dynamic.InsertSelectedRecords: line 30, column 1
Hey guys,

I have object A.

I have let's say a PDF or a Word file I want to attach automatically. to each record of object A upon creation.

I don't see how process builder could do this, so is there a way to do this? Maybe in apex? Thanks
Here goes my Lightning component - 

<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="cboard_seeContacts">
    <aura:attribute name="accId" type="String" />
    <aura:attribute name="Con" type="Contact" 
                    default="{sObjectname: 'Contact',
    <div class="slds-p-around_medium">
        <lightning:input name="First Name" type="text" label = "First Name" value="{!v.con.FirstName}"/>
        <lightning:input name="Last Name" type="text" label = "Last Name" value="{!v.con.LastName}"/>
        <lightning:input name="Phone" type="phone" label = "Phone" value="{!v.con.Phone}"/>
        <lightning:input name="Email" type="email" label = "Email" value="{!v.con.Email}"/><br/><br/>
        <lightning:button label="Quick Create Contact" variant="Brand" onclick="{!c.doSave}"/>

Controller - 

public class cboard_seeContacts {
    public static List<Contact> ContactList(string accId){
        return [Select Id, FirstName,LastName from Contact where AccountId =:accId];
    public static Contact createContact(Contact c, Id AccountId){
        insert c;
        return c;

    doSave : function(component, event, helper) {
        var action = component.get('c.createContact');
            c : component.get('v.Con'),
            AccountId : component.get('v.accId')
        action.setCallBack(this, function(response){
            var state= response.getState();
            if(state === 'SUCCESS' || state ==='DRAFT'){
                var reposneValue = response.getReturnvalue();

I am unable to figure out why the inputs and button is not working. Any help will be appreciated. 
<apex:page standardcontroller="Entity__c" extensions="wrapperclassTwo">
  <apex:form >
  <apex:pageBlock >
      Trust Name
      <apex:inputfield label="name of trust" value="{!Entity__c.name}"/>
      <apex:inputfield label="name of trust" value="{!lnput}"/>
  <apex:pageBlockSection columns="1" title="Transactions1">

i want to use either {!Entity__c.name} or the {!lnput}
in the controller class.

public with sharing class wrapperclassTwo {
    public wrapperclassTwo(apexpages.StandardController controller){}
 ///  public string input = entity__c.name;
    Public string input{get;set;}
    Public string lnput{get;set;}
    list<Tnetoutputtransaction__c> obl1= new list<Tnetoutputtransaction__c>();
    List<Account_Holdings_Tax_Lots__c> obl2 = new list<Account_Holdings_Tax_Lots__c>();

    public list<wrapperClass> wrapperClassList = new list<wrapperclass>();
    public list<wrapperClass>getListWrapperObjectMethod(){
        obl1 =[select name,id From Tnetoutputtransaction__c limit 15 where name={!input];/or {!Entity__c.name}
         obl2 =[select name,id From Account_Holdings_Tax_Lots__c limit 15];
i want to use the that to 
I am new to salesforce and I would like to know how to create custom button to update record's field value on click.
Should I use lightning component + apex code or is it possible achieve it without code?
Example - what I am trying to achieve:
FieldName:  Times clicked
FieldValue = 0 + 1 time clicked // sObject_c.TimesClicked++
Hi folks,
    Can anyone tell me how to redirect one visualforce page to another visualforce page automatically ?
below is my visualforce page :
<apex:page standardController="Account" extensions="AccountDownload" 
   recordSetVar="accounts" sidebar="false"  cache="true"> 
    <html xmlns:w="urn:schemas-microsoft-com:office:word">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <apex:form >
                <apex:pageBlock title="Archiver For Account">
                     <div style="text-align:left" >          
                         <apex:pageBlockTable value="{!accounts}" var="ac" >
                             <apex:column headerValue="AccountName">
                                 <apex:outputText >{!ac.Name}</apex:outputText>
                             <apex:column headerValue="Account Number">
                                 <apex:outputText >{!ac.AccountNumber}</apex:outputText>
                             <apex:column headerValue="AccountType">
                                 <apex:outputText >{!ac.Type}</apex:outputText>
                             <apex:column headerValue="Phone Number">
                                 <apex:outputText >{!ac.Phone}</apex:outputText>
               <apex:outputText value="hi dude,"/>
            function redirect(){
            window.onload = window.setTimeout(redirect(),5000);

My question is once the document is downloaded then it will automatically redirect to another page as mentioned above.
I have tried using action attribute,calling redirect method from constructor. but nothing happen.
Finally I got the idea is using javascript we can redirect automatically.
but it dosent work for me.

Someone please tell me what I have to modify.

Thanks in advance
Hello Everyone,

I got a email- You have one or more certificates in your Salesforce org that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

I have resolve it using the steps:
There are few places where a sefl-signed certificate could be used, I identified those

1. Identify Provider - If you are using SFDC as IDP for Single Sign On. 
2. Single Sign-On Settings - If you are using SFDC as Consumer for Single Sign On.

Certificate is used in above 2 places, i edit this screen and replace the old certificate, with my newly created Certificate.

When i am doing this changes i have seen the warning msg  "If you change this certificate, users can't connect to service providers until you reconfigure each service provider to work with the new certificate", ANY OTHER PLACES WHERE I HAVE TO UPDATE MY THIS NEW CERTIFICATE?


Thanks in advance.
Arpit Bajpai