• ALL STAR
  • 5915 Points
  • Member since 

  • Chatter
    Feed
  • 180
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 0
    Questions
  • 804
    Replies
Hi all i am working with future method functionality call the future class in after update trigger i control the recursive update too. future method is inside method i get one list and modify it then load one mater list finally update but i can't update   i am getting error like this,
Error:first exception cannot_insert_update_activate_entity execution of afterupdate
Any Suggestion
i have gone through the different types of sanboxes and their time intervals all  from the documentations .. now my doudt is why we will go for refresh time  the sanbox, can any body explain with the simple example,, i have gone through the document of developer guide.
 I need a  real time example , when and why it is done , with a small scenario.. general example ,,??? 

 
Can we input the arabic language from right to left for any record in objects in lightning experience (In salesforce classic its working but in lightning Experience is there any option ?)
I have successfully installed Data Loader on my system. When am trying to open, it is asking me to install Java Run time environment (32 bit). I have tried hard to get the link from internet. But no luck it shows that I have installed the app but the Java is still not getting opened. Unless and until I fix this issue, I won't be able to open the Data Loader. Please help me in resolving this issue.
I'm trying to create a JSON content type of insert job using Bulk API and I'm getting "UnsupportedContentType" even with api v44.0.
Not sure if I'm missing something or doing something wrong but below it the detail:

Url
https://[my-instance].my.salesforce.com/services/data/v44.0/jobs/ingest

body
{
    "apiVersion" : 44.0,
    "contentType" : "JSON",
    "object" : "Title__c",
    "operation" : "insert"
}

response
[
    {
        "errorCode": "UNSUPPORTEDCONTENTTYPE",
        "message": "UnsupportedContentType : JSON is not a valid Content-Type. Only 'CSV' is allowed"
    }
]

 
String s1 = 'Hello Max';
String s2 = s1.right(3);
System.assertEquals( 'Max', s2);

for this scenario i have created the apex calss ;

public class  testing {

 public string result{get;set;}

  public void  m1(string name){

     string trname =name.right(3);

 result = trname;
}

}


 visualforce page:

<apex:page>
 <apex:form>
  <apex:commandbutton value="editedname" action="{!m1}" />

  <apex:inputtext label="Enter your name"  value="{!name}"
  {!result}
</apex:form>  
 
 
</apex:page>

 


the scenario is , need an inputfield , if you enter in the filed the last value should have to trim and have to display in the visualforce page.. 

 iam in confusion how it can be acheived.

 
hello,
i have two standard object Account(parent) and Contact(child) .so i wanna create a custom field  'sequence number' on Contact .
suppose my Account(parent) Object have 5 Contact(child) the 'sequence number' record is 1,2,3,4,5      Than i will delete the One 'sequence number' record 3  so my 4 number come to 3  and 5 number is come to 4.    the new 'sequence number' is 1,2,3,4  
if i will delete any record than the sequence of record number is maintan.
this is done help by 'Apex Trigger'.
help my and example with code  
 
Is there any way to mass delete ApexLog objects that is not from the developer console? When you have around 800 of them the developer console takes forever to delete them and it looks like ApexLog objects can't be deleted via SOQL calls in APEX, so what's the alternative to sitting for 5 minutes waiting for my logs to clear off of a half frozen developer console?
  • December 03, 2018
  • Like
  • 0

Good Morning folks,

I have a component to inset case, but is experiencing an error of  log:
 

"first error: INVALID_FIELD, Cannot specify both an external ID reference Account and a salesforce id, AccountId: []"


Basically this code :
 

Component.cmp

 <aura:attribute name="caseObj" type="case" default="{'sobjectType': 'Case',
                         'AccountId': '',
                         'MSISDN__c': '',
                         'Status': ''
                    }"/>



<label>Montadora</label>
       <force:inputField aura:id="AccountId"  value="{!v.caseObj.AccountId}"/>
           
</div>
<div class="form-group">
            <label>MSISDN</label>
            <ui:inputText class="form-control" value="{!v.caseObj.MSISDN__c}"/>
</div>  
    
    
    <div class="form-group">
            <label>Status</label>
            <force:inputField aura:id="Status"  value="{!v.caseObj.Status}"/>
</div>   


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

controller.js

  create: function(component, event, helper)    {
        
        console.log('Create record');
    
        var caseObj = component.get("v.caseObj");
        
        
        var action = component.get("c.createRecord");
      
        
        action.setParams({
            caseObj : caseObj
        });



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

Class.apxc

 @AuraEnabled
    public static void createRecord (Case caseObj){
        
        try{
            System.debug('NovoCasoComponentController::createRecord::caseObj'+ caseObj);
            
            if(caseObj != null){
                insert caseObj;
            }
            
        } catch (Exception ex){
            
        }
        
    }    




Thanks

Hello,

I have below use case
When standard picklist is changed a popup opens.
Pop up will be a lightning component with some input values.
There will be a button to send save.
Once the button is clicked, a function in class will be called (ideally a webservice)

an someone guide me on the technical logic to implement ?
 <apex:commandLink value="{!stu.Student_Name__c}" action="{!StudentDetailsPage}">
                                                            <apex:param name="Id" value="{!stu.Id}" assignTo="{!StuDetailId}"/>
                                                        </apex:commandLink>


Please provide code for assign this parameters value to controller page variable.
$A.get('e.force:refreshView').fire();
I am getting error - 'Cannot read property 'fire' of undefined'. This is weired. Plz help me if you have any suitable answer.

There can only be one active record of the Opportunity associated to the Account, 
please write on trigger.
Hi,

when we trying to open the opportunity we are getting below error . can you please suggest here 
Too many SOQL queries: 101 
An unexpected error has occurred. Your development organization has been notified.

Thanks
KMK
  • November 29, 2018
  • Like
  • 0
Hi.  I actually have two quesitons.  First, is the following a list or array?

var gs = []

Second, how do I determine the size of that variable?  console.log(gs.size()); renders an error

Finally, how do I determine the size of an attribute for a custom oject.  For example, I have the following attribute on my component:

<aura:attribute name="newGroupStructures" type="Group_Structure__c[]"/>

How can I write a console.log to see the size of that?

thanks!!!!

Fred
  • November 28, 2018
  • Like
  • 0
I am not being able to configure the trigger whose fetching childs records . This is the Screen shot , Please help me in it as your earliest possible 

User-added image

This is the Code 

trigger insert12Records on University__c (after insert) {
List<Class__c> classList = new List<Class__c>();
Set<Id> idSet = new Set<Id>();
Map<id,Integer> mapIDcount = new Map<id,Integer>();
for(University__c uni:Trigger.new)
{
idSet.add(uni.Name);
for(University__c u:[Select Id,(Select id from Class__c ) from University__c where Id =:idSet ])
{


for(Integer i = 0; i< 12; i++){
Class__c cls = new Class__c();
cls.Name= 'Test Class'+i;
cls.University__c = uni.Id;
classList.add(cls); 


}
}
insert classList;

}

}
 
Hi, i'm trying to do component that makes a search on Account object.
But my filters are variable.
EX:
I can make a adress search input only the street, or inpunt street and the city. 

is there anyway to my select know how filter is using?
i've added sort() to my code, but values from the custom setting are still listed in random order, what am i missing?
 
public List<SelectOption> getAvailableDocumentTypes() {
        List<SelectOption> options = new List<SelectOption>();
        options.sort();
        for (Available_Document_Types__c doc_type : Available_Document_Types__c.getall().values()) {
            options.add(new SelectOption(doc_type.Value__c, doc_type.Name));
        }
        return options;
    }

 
  • November 27, 2018
  • Like
  • 0
Hi ,


Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: TZTDWCAD
Close errors

Please help on this error.

Thanks,
karthik.
Hi all i am working with future method functionality call the future class in after update trigger i control the recursive update too. future method is inside method i get one list and modify it then load one mater list finally update but i can't update   i am getting error like this,
Error:first exception cannot_insert_update_activate_entity execution of afterupdate
Any Suggestion
Hello All,

I want override Opportunity detail page without writing each and every field in lightning component is their any way to do this
Hi All,
In the code scanning, I am facing the Potential URL Redirection Attack issue.
Scan Result:
User-added image
Can anyone please provide me any solution on this?

Thanks,
Pratik
//Use case
Trigger has  to fire on Opportunity Object and Highest price has to store in Lead_CompetitorPrice__c field and Highest Price Postion to store in Leading_Competitor_del_del__c field.
trigger LeadingCompetitor on Opportunity (before insert,before update) {
for(Opportunity opp:Trigger.new){
    //Add all our prices in a list in order of competitor
     List<Decimal> competitorPrices =new List<Decimal>();
       competitorPrices.add(opp.Competitor_1_Price__c);
        competitorPrices.add(opp.Competitor_2_Price__c);
        competitorPrices.add(opp.Competitor_3_Price__c);
     //Add all our comptitors in a list in order
    List<String> competitors =new List<String>();
         competitors.add(opp.ven__Competitor_1__c);
         competitors.add(opp.ven__Competitor_2__c);
         competitors.add(opp.ven__Competitor_3__c);
   //Loop through alll competitors to find the position of the lowest price
   Decimal Highprice;
   Integer HighPricePosition;
    for(Integer i=0;i<competitorPrices.size();i++){
        Decimal currentPrice =competitorPrices.get(i);
        if(Highprice==null || Highprice>currentPrice){
           HighPrice=currentPrice;
           HighPricePosition=i;
           }
           }
         //Populate the leading competitor field with the competitor matching the lowest price position
         opp.Leading_Competitor_del_del__c=competitors.get(HighPricePosition);
        opp.Lead_CompetitorPrice__c=competitorPrices.get(Highprice)
                                   } 
I’m getting error message when I saving the record on opportunity object?

User-added image
Hello,

I'm trying to replicate the functionality of the standard "Items to Approve" home page component. How do I create a lookup field on the Visualforce page which references approvers? I want it to work like the lookup on the Mass Reassign Approval Requests page. Any ideas?
 
 User-added image 
I work at a non-profit (therefore, we don't have IT or technology people onboard), and we utilize a ".force.com" website/app for our coaches to use to track attendance at sessions. However, starting on Monday, Dec. 3, I noticed that I was unable to enter the page to log attendance. I thought it was a maintenance thing going on. However, it continued to today, Wednesday, Dec. 5. I did not create this site and also have not had too much experience in the back-end of Salesforce, so this is new to me. I checked our site on Salesforce (through set-up), and it is still active. I don't know how to fix this though.
i have gone through the different types of sanboxes and their time intervals all  from the documentations .. now my doudt is why we will go for refresh time  the sanbox, can any body explain with the simple example,, i have gone through the document of developer guide.
 I need a  real time example , when and why it is done , with a small scenario.. general example ,,??? 

 
Hi,

I have a VF page which is used to render a pdf doc. 
This pdf is generated on the Opp object, in japaneese(UNICODE).
When the pdf is generated without Products to be added on the Opp object it looks ok, but when products are added (number of items is not fixed) there is a page break on the first page, pushing basically almost everything on the second page.(starting with the <!-- TY Contact --> )
I have the same VF page for not unicode and it works perfectly, so I am thinking, are the japaneese characters causing this break?

Any thought on where to look is highly appreciated!

Thanks,
Ana


User-added image
<apex:page id="PDF_ProposalOrderForm_V2_2"
           controller="PDF_ProposalOrderForm_Controller"
           standardStylesheets="False"
           sideBar="False"
           language="{!pdfLanguage}">

    <apex:stylesheet value="{!URLFOR($Resource.PDF_TYOfferTemplate)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.PDF_TYOfferTemplate_UNICODE)}"/>

    <!--/*DISPLAY TEMPLATE RELATED PROPERTIES*/
    <div class="xx-small">
        <apex:outputText value="Template Id: {!pdfTemplateId}"/><br/>
        <apex:outputText value="Language: {!pdfLanguage}"/><br/>
        <apex:outputText value="Date Format: {!pdfDateFormat}"/><br/>
        <apex:outputText value="Number Format: {!pdfNumberFormat}"/><br/>
        <apex:outputText value="Local Language: {!pdfLocalLanguage}"/><br/>
    </div>-->

    <apex:pageMessages escape="false"/>

    <apex:form id="ProposalForm">

        <!--*********************************************************************************************************-->
        <!-- Header -->
        <!--*********************************************************************************************************-->
        <div id="header" class="header al-right">
            <apex:image url="{!$Resource.PDF_ProposalOrderFormLogo}" width="200" height="55"/>
        </div>

        <!--*********************************************************************************************************-->
        <!-- Footer -->
        <!--*********************************************************************************************************-->
        <div id="footer" class="footer al-left">
            <div class="al-right x-small">Page <span class="pagenumber"/> of <span class="pagecount"/></div>
            <div>
                <div class="line bg-blue" style="width:70%;"></div>
                <div class="line bg-red" style="width:10%;"></div>
                <div class="line bg-yellow" style="width:10%;"></div>
                <div class="line bg-green" style="width:10%;"></div>
            </div>
            <br/>
            <apex:outputText value="{!pdfFooter}" escape="false" />
        </div>

        <!--<div class="spacer"></div>-->
        <!--*********************************************************************************************************-->
        <!-- Customer -->
        <!--*********************************************************************************************************-->
        <div id="customer" class="content">
            <h1>{!opportunity.PDFProposalEntityName__c}</h1>
            <apex:outputText value="{!proposalEntityAddress}" escape="false" />
        </div>
        <!--<div class="spacer"></div>-->

        <!--*********************************************************************************************************-->
        <!-- Proposal intro-->
        <!--*********************************************************************************************************--> 
        <div id="proposal-intro" class="content">
            <p class="spaced al-left">
                    <apex:outputField value="{!primaryContactRole.Contact.Salutation}" />
                    {!primaryContactRole.Contact.FirstName}
                    {!primaryContactRole.Contact.LastName}
                     <apex:outputText value="{!$Label.PDF_ProposalOrderForm_IntroSalutation}" escape="false"/>,
            </p>
            <p class="al-justify">
                <apex:outputText value="{!$Label.PDF_ProposalOrderForm_IntroContent}" escape="false"/>
            </p>
        </div>

        <!--*********************************************************************************************************-->
        <!-- TY Contact -->
        <!--*********************************************************************************************************-->
        <div id="ty-contact" class="content">
            <div id="contact-left" class="content-left">
                <h3 class="al-left">
                    <apex:outputText value="{!$Label.PDF_ProposalOrderForm_PersonalContact}" escape="false"/>
                </h3>
                <div style="display: inline-block;">
                    <apex:image styleClass="talk-bubble tri-right btm-left" style="float:left;" url="{!owner.FullPhotoUrl}" rendered="{!pdfShowOwnerPhoto}"/>

                    <div style="float:left;">
                        <p class="al-left">
                            <span class="contact__firstname">{!owner.FirstName}</span>
                            <span class="contact__lastname">{!owner.LastName}</span>
                        </p>
                        <p class="al-left">
                            <span class="contact__title">{!owner.Title}</span>
                        </p>
                        <p class="al-left">
                            <span class="contact__phone">{!owner.Phone}</span>
                        </p>
                        <p class="al-left">
                            <span class="contact__email"><a href="mailto:[OwnerEmail]">{!owner.Email}</a></span>
                        </p>
                    </div>
                </div>
            </div>
            <div id="contact-right" class="content-right">
                <apex:outputText value="{!$Label.PDF_ProposalOrderForm_ServiceContact}" escape="false" />
            </div>
        </div>

        <!--*********************************************************************************************************-->
        <!-- Key Benefits -->
        <!--*********************************************************************************************************-->
        <div id="key-benefits" class="content">
            <div class="shade">
                <apex:outputText value="{!$Label.PDF_ProposalOrderForm_KeyBenefits}" escape="false"/>
            </div>
        </div>

        <!--*********************************************************************************************************-->
        <!-- Offer Details -->
        <!--*********************************************************************************************************-->
        <div id="offer" class="content">
            <table>
                <thead>
                    <tr>
                        <th width="60%" class="al-left">
                            <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_OfferDetails}" escape="false" />
                        </th>
                        <th width="10%" class="al-center">
                            <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_Quantity}" escape="false" />
                        </th>
                        <th width="15%" class="al-right">
                            <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_UnitPrice}" escape="false" />
                        </th>
                        <th width="15%" class="al-right">
                            <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_Subtotal}" escape="false" />
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <apex:repeat var="lineitem" value="{!opportunityProducts}">
                    <tr>
                        <td class="al-left al-top">
                            <p class="bold small">{!lineitem.ProductName}</p>
                            <div>
                                <ul class="x-small">
                                    <apex:outputText value="{!lineitem.ProductStandardDescription}" escape="false" />
                                    <li>{!lineitem.ProductDescription}</li>
                                </ul>
                            </div>
                        </td>
                        <td class="al-center al-top">
                            <p class="bold small al-center">{!lineitem.Quantity}</p>
                        </td>
                        <td class="al-right al-top">
                            <p class="bold small al-right">{!lineitem.UnitPrice} {!opportunity.CurrencyIsoCode}</p>
                        </td>
                        <td class="al-right al-top">
                            <p class="bold small al-right">{!lineitem.TotalPrice} {!opportunity.CurrencyIsoCode}</p>
                            <apex:outputText rendered="{!lineitem.Discount != ''}" value="{!$Label.PDF_ProposalOrderForm_Offer_Discount} " styleClass="x-small al-right"/>
                            <apex:outputText rendered="{!lineitem.Discount != ''}" value="{!lineitem.Discount}%" styleClass="x-small al-right"/>
                            <!--/*DISPLAY SELLER DISCOUNT VS. TOTAL DISCOUNT ON PROPSOAL*/
                            <apex:outputText rendered="{!lineitem.TotalDiscount != ''}" value="{!$Label.PDF_ProposalOrderForm_Offer_Discount} " styleClass="x-small al-right"/>
                            <apex:outputText rendered="{!lineitem.TotalDiscount != ''}" value="{!lineitem.TotalDiscount}%" styleClass="x-small al-right"/>
                            -->
                        </td>
                    </tr>
                    </apex:repeat>
                </tbody>
                <tfoot>
                    <tr>
                        <th colspan="2" class="al-left">
                            <p class="bold">
                                <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_TotalCost}" escape="false" />
                            </p>
                        </th>
                        <th colspan="2" class="al-right">
                            <p class="al-right bold">
                                {!strAmount} {!opportunity.CurrencyIsoCode}
                            </p>
                        </th>
                    </tr>
                </tfoot>
            </table>
        </div>
        <!-- TAX SECTION-->
        <apex:outputPanel rendered="{!pdfShowTax}" layout="block">
            <table>
                <tbody>
                    <tr>
                        <td colspan="2" class="al-left">
                            <p class="bold small">
                                <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_Tax} {!opportunity.Tax__c}%" escape="false" />
                            </p>
                        </td>
                        <td colspan="2" class="al-right">
                            <p class="al-right bold small">
                                {!strAmountTax} {!opportunity.CurrencyIsoCode}
                            </p>
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th colspan="2" class="al-left">
                            <p class="bold">
                                <apex:outputText value="{!$Label.PDF_ProposalOrderForm_Offer_TotalCostWithTax}" escape="false" />
                            </p>
                        </th>
                        <th colspan="2" class="al-right">
                            <p class="al-right bold">
                                {!strAmountWithTax} {!opportunity.CurrencyIsoCode}
                            </p>
                        </th>
                    </tr>
                </tfoot>
            </table>
        </apex:outputPanel>
        <!--*********************************************************************************************************-->
        <!-- Terms and conditions -->
        <!--*********************************************************************************************************-->
        <div id="terms-and-conditions" class="content">
            <h3><apex:outputText value="{!$Label.PDF_ProposalOrderForm_CommercialTC}" escape="false" /></h3>
            <ul class="small al-left">
                <apex:outputText value="{!strTermAndConditions}" escape="false"/>
                <li>{!opportunity.Special_Term_in_Contract__c}</li>
            </ul>
        </div>
        <!--*********************************************************************************************************-->
        <!-- Billing Information -->
        <!--*********************************************************************************************************-->
        <apex:outputPanel id="billing-information" styleClass="content" layout="block" rendered="{!pdfShowBillingDetail}">
            <h3><apex:outputText value="{!$Label.PDF_ProposalOrderForm_BillingInformation}" escape="false" /></h3>
            <div class="spaced">
                <div style="min-width: 460px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingEntity}</div>
                    <div class="field-content small-box">\BillingEntity1\</div>
                </div>
                <div style="min-width: 210px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingEntityVATNumber}</div>
                    <div class="field-content small-box">\BillingEntityVATNumber1\</div>
                </div>
                <div style="min-width: 680px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingStreet}</div>
                    <div class="field-content small-box">\BillingStreet1\</div>
                </div>
                <div style="min-width: 260px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingCity}</div>
                    <div class="field-content small-box">\BillingCity1\</div>
                </div>
                <div style="min-width: 160px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingZIPPostalCode}</div>
                    <div class="field-content small-box">\BillingZIPPostalCode1\</div>
                </div>
                <div style="min-width: 230px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingCountry}</div>
                    <div class="field-content small-box">\BillingCountry1\</div>
                </div>
                <div style="min-width: 350px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingContactFirstName}</div>
                    <div class="field-content small-box">\BillingFirstName1\</div>
                </div>
                <div style="min-width: 320px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingContactLastName}</div>
                    <div class="field-content small-box">\BillingLastName1\</div>
                </div>
                <div style="min-width: 190px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingContactTitle}</div>
                    <div class="field-content small-box">\BillingTitle1\</div>
                </div>
                <div style="min-width: 150px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingContactPhone}</div>
                    <div class="field-content small-box">\BillingPhone1\</div>
                </div>
                <div style="min-width: 320px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_BillingContactEmail}</div>
                    <div class="field-content small-box">\BillingEmail1\</div>
                </div>
            </div>
        </apex:outputPanel>

        <!--*********************************************************************************************************-->
        <!-- Signature -->
        <!--*********************************************************************************************************-->
        <div id="signature" class="content">
            <h3><apex:outputText value="{!$Label.PDF_ProposalOrderForm_Signature}" escape="false" /></h3>
            <div class="spaced">
                <div style="min-width: 150px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_Date}</div>
                    <div class="field-content large-box">\PartnerDate1\</div>
                </div>
                <div style="min-width: 290px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_Name}</div>
                    <div class="field-content large-box">\PartnerName1\</div>
                </div>
                <div style="min-width: 220px;" class="field-label">
                    <div class="small">{!$Label.PDF_ProposalOrderForm_SignatureStamp}</div>
                    <div class="field-content large-box">
                        <div style="position:absolute; margin-top:30px; margin-left:600px">\PartnerSignature1\</div>
                    </div>
                </div>
                <div style="min-width: 680px;" class="field-label al-center">
                    <div class="docusign checkbox" style="width: 70px;">
                        <span class="xx-small">PartnerAcceptTerms1</span>
                    </div>
                    <a class="small" href="{!pdfTermsAndConditionsURL}">{!$Label.PDF_ProposalOrderForm_TermsAndConditions}</a><br/>
                    <div class="docusign" style="margin-left: 35px;">{!pdfDocusignTCTag}</div>
                </div>
            </div>
        </div>
    </apex:form>

</apex:page>

 
create a custom object and it should have a field which is a lookup relation to Opportunity.  Create one more picklist field is Type__c(Category_A, Category_B, Category_C). three fields should created on Opportunity(Count of CategoryA,Count of CategoryB, Count of CategoryC). display the count of eachtype in the parent details record.

Good Morning folks,

I have a component to inset case, but is experiencing an error of  log:
 

"first error: INVALID_FIELD, Cannot specify both an external ID reference Account and a salesforce id, AccountId: []"


Basically this code :
 

Component.cmp

 <aura:attribute name="caseObj" type="case" default="{'sobjectType': 'Case',
                         'AccountId': '',
                         'MSISDN__c': '',
                         'Status': ''
                    }"/>



<label>Montadora</label>
       <force:inputField aura:id="AccountId"  value="{!v.caseObj.AccountId}"/>
           
</div>
<div class="form-group">
            <label>MSISDN</label>
            <ui:inputText class="form-control" value="{!v.caseObj.MSISDN__c}"/>
</div>  
    
    
    <div class="form-group">
            <label>Status</label>
            <force:inputField aura:id="Status"  value="{!v.caseObj.Status}"/>
</div>   


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

controller.js

  create: function(component, event, helper)    {
        
        console.log('Create record');
    
        var caseObj = component.get("v.caseObj");
        
        
        var action = component.get("c.createRecord");
      
        
        action.setParams({
            caseObj : caseObj
        });



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

Class.apxc

 @AuraEnabled
    public static void createRecord (Case caseObj){
        
        try{
            System.debug('NovoCasoComponentController::createRecord::caseObj'+ caseObj);
            
            if(caseObj != null){
                insert caseObj;
            }
            
        } catch (Exception ex){
            
        }
        
    }    




Thanks

I'd like to get the Sites domain that configured for an org via Apex in order to automate some setup work.  I haven't found a way to do that.  It's probably not there but just in case I missed it in the documentation I figured I'd ask if anyone knows if there's any kind of metadata call to get it.

This is not specific to any one site and VF is not in place so anything that only exists in the context of an executing Site will not work.
I'm trying to create a button that will toggle a checkbox (i.e. if checked then uncheck, if unchecked then check). This checkbox will trigger a workflow rule that will send an email to the contact 24 hours later.

I realize that these buttons may become obsolete in Lightning, but my org does not wish to switch in the forseeable future (not my decision).

Any help is much appreaciated!
I am using google crome browser and performing inline editing on lightning datatable.

I am able to display the field values but when I edit Opportunity Name and click save its not saving.

Please let me know the issue.
 
public class DataTableController {

    @AuraEnabled
    public static List<Opportunity> getOpportunities()
    {
        List<Opportunity> oppList=new List<Opportunity>();
        
        oppList=[select Name,Account.Name,StageName,CloseDate,Amount from Opportunity
                 where Amount != NULL];
        
        return oppList;
    }
    
    @AuraEnabled
    public static void updateOpportunities(List<Opportunity> oppsList){
        try
        {
            Database.update(oppsList);
            
          }
        catch(Exception ex)
        {
            system.debug(ex.getMessage());
        }
    }
}

<aura:component implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes" 
                controller="DataTableController"
                access="global">
	
        <!-- Three important parts of datatable is Key , data and columns
         so we need attribute for data and columns(metatadata)-->
    <!-- attributes -->
    <aura:attribute name="data" 
                    type="Object"/>
    
    <aura:attribute name="columns" 
                    type="List"/>
    
<aura:attribute name="updatedRecord" type="Object[]" />

    <!-- handlers-->
    <aura:handler name="init" 
                  value="{!this}" 
                  action="{!c.doInit}"/>
    
    <lightning:card title="OpportunityDatatable">
        
        <lightning:datatable aura:id="opportunitydatatable"
                             keyField="id"
                             data="{!v.data}"
                             columns="{!v.columns}"
                             onsave="{!c.handleSaveOpps}"
                             hideCheckboxColumn="true"/>
        
</lightning:card>
    
    {!updatedRecord}

</aura:component>

({
	doInit : function(component, event, helper) {
        
        helper.queryColumns(component,event,helper);
        
        helper.queryContacts(component,event,helper);
  	},
    
    handleSaveOpps: function (component, event, helper) {
        debugger;    
        var draftValues = event.getParam('draftValues');
console.log(draftValues);
        var action = component.get('c.updateOpportunities');
        action.setParams({ 
            "oppsList": draftValues
        });
        action.setCallback(this, $A.getCallback(function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                helper.fireSuccessToast(component);  
                helper.fireRefreshEvt(component);
            } else if (state === "ERROR") {
                var errors = response.getError();
                console.error(errors);
                helper.fireFailureToast(component);  
            }
        }));
        $A.enqueueAction(action);
    }
     
})


({
	queryColumns : function(component,event,helper) {
        
		  component.set('v.columns', [
            {label: 'Opp Name', fieldName: 'Name', editable : 'true', type: 'text'},
            {label: 'Acc Name', fieldName: 'AccountName', type: 'text'},
            {label: 'StageName', fieldName: 'StageName', type: 'text'},
            {label: 'CloseDate', fieldName: 'CloseDate', type: 'date'},
            {label: 'Amount', fieldName: 'Amount', type: 'currency', cellAttributes: { alignment: 'left' }} 
        ]);
	},
    
    queryContacts : function(component,event,helper) {
        
        var action=component.get('c.getOpportunities');
        
        action.setParams({
        });
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                
                  //the following code will display the parent account name
                 var rows = response.getReturnValue();
                 for (var i = 0; i < rows.length; i++) {
                    var row = rows[i];
                    if (row.Account) row.AccountName = row.Account.Name;
                }
                //component.set("v.data", response.getReturnValue());
                 component.set("v.data", rows);
            }
        });
        $A.enqueueAction(action);
    },
    
     fireSuccessToast : function(component) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({ 
            'title' : 'Success', 
            'message' : 'Opportunities updated sucessfully.' ,
            'type':'success'
        }); 
        toastEvent.fire(); 
    },
    
    fireFailureToast : function(component) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({ 
            'title' : 'Failed', 
            'message' : 'An error occurred. Please contact your administrator.',
            'type':'error'
        }); 
        toastEvent.fire(); 
    },
    
    fireRefreshEvt : function(component) {
        var refreshEvent = $A.get("e.force:refreshView");
        if(refreshEvent){
            refreshEvent.fire();
        }
    }
       
})