• NewBie09
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 6
    Likes Given
  • 5
    Questions
  • 13
    Replies
Hi is there any way to integrate trailhead data into Salesforce using API. Need to monitor employees trailhead progress and store it in Salesforce custom object.  
I want to redirect the record to its detail page when onclick from the component. 
<a href="{!'/'+resultWrap.resultId}" class="slds-card__header-link slds-truncate"  >
        <span class="slds-text-heading_small" style="{!'color:'+v.textColor}">
                           {!resultWrap.resultHeader} 
        </span>
</a>

 so I specified the ID in href.
It works fine in lightning component, but in the Community builder when I click the record am getting an error message (invalid page)
Hello,
I want to create a lightning component to drag and drop fields from one div to another, can anyone help me with this :) 
I need to build a soql condtion dynamically, 
E.g. if datatype is EMAIL then all same datatypes should be in OR condtion and other datatypes in AND condtion
 WHERE (email='test@gmail.com' OR email='test_1@gmail.com') AND (name='test' OR name='test_1')
and return it to a string 
I want to redirect the record to its detail page when onclick from the component. 
<a href="{!'/'+resultWrap.resultId}" class="slds-card__header-link slds-truncate"  >
        <span class="slds-text-heading_small" style="{!'color:'+v.textColor}">
                           {!resultWrap.resultHeader} 
        </span>
</a>

 so I specified the ID in href.
It works fine in lightning component, but in the Community builder when I click the record am getting an error message (invalid page)
I'm playing around with creating an App Exchange app that has a chrome extension component.  The idea is to use User-Agent flow and a connected app to allow the extension to authenticate and then use rest endpoints to send data from the extension to the org.  Is that the best way to do this?  If I went that direction, would I have a single connected app hosted on my personal Org (for the client_id)? or include that as part of the salesforce app?  If I included the app in the package, would I have to make the extension user type in the unique client_id for each org's connected app.?  That seems like an extra step for the user opposed to a hard-coded client_id in the extension.
  • April 19, 2019
  • Like
  • 0
Error : 
User-added image

I have overridden the add and new standard buttons as well.
User-added image
Product2Extension.cls :
public class Product2Extension {

  public List<ProductWrapper> productsToInsert {get; set;}

  public Product2Extension(ApexPages.StandardController controller){
    productsToInsert = new List<ProductWrapper>();
    AddRows();
  }

  public void AddRows(){
    for (Integer i=0; i<Constants.DEFAULT_ROWS; i++ ) {
      productsToInsert.add( new ProductWrapper() );
    }
  }

  public List<ChartHelper.ChartData> GetInventory(){
    return ChartHelper.GetInventory();
  }

  public List<SelectOption> GetFamilyOptions() {
    List<SelectOption> options = new List<SelectOption>();
    options.add(new SelectOption(Constants.SELECT_ONE, Constants.SELECT_ONE));
    for(PickListEntry eachPicklistValue : Constants.PRODUCT_FAMILY) {
      options.add(new SelectOption(eachPicklistValue.getValue(), eachPicklistValue.getLabel()));
    }
    return options;
  }

  public PageReference Save(){
    Savepoint sp = Database.setSavepoint();
    try {
      List<Product2> products = new List<Product2>();
      List<PricebookEntry> pbes = new List<PricebookEntry>();

      for (ProductWrapper prodwrapper : productsToInsert) {
        if(prodwrapper.productRecord != null && prodwrapper.pricebookEntryRecord != null) {
          if(prodwrapper.productRecord.Name != null && prodwrapper.productRecord.Family != null && constants.SELECT_ONE != prodwrapper.productRecord.Family && prodwrapper.productRecord.Initial_Inventory__c != null && prodwrapper.pricebookEntryRecord.UnitPrice != null) {
            products.add(prodwrapper.productRecord);
            PricebookEntry pbe = prodwrapper.pricebookEntryRecord;
            pbe.IsActive = true;
            pbe.Pricebook2Id = Constants.STANDARD_PRICEBOOK_ID;
            pbes.add(pbe);
          }
        }
      }

      insert products;

      for (integer i = 0; i < pbes.size(); i++) {
        pbes[i].Product2Id = products[i].Id;
      }
      insert pbes;

      //If successful clear the list and display an informational message
      apexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO,productsToInsert.size()+' Inserted'));
      productsToInsert.clear();         //Do not remove
      AddRows();        //Do not remove
    } catch (Exception e){
      Database.rollback(sp);
      apexPages.addMessage(new ApexPages.message(ApexPages.Severity.ERROR, Constants.ERROR_MESSAGE));
    }
    return null;
  }

  public class ProductWrapper {
    public Product2 productRecord {get; set;}
    public PriceBookEntry pricebookEntryRecord {get; set;}

    public ProductWrapper() {
      productRecord = new product2(Initial_Inventory__c =0);
      pricebookEntryRecord = new pricebookEntry(Unitprice=0.0);
    }
  }
}
Product2New​.page :
<apex:page standardcontroller="Product2" extensions="Product2Extension">
  <apex:sectionHeader title="New Product" subtitle="Add Inventory"/>
  <apex:pageMessages id="pageMessages"/>
  <apex:form id="form">
    <apex:actionRegion>
      <apex:pageBlock title="Existing Inventory" id="existingInv">
        <apex:chart data="{!Inventory}" width="600" height="400">
          <apex:axis type="Category" fields="name" position="left" title="Product Family"/>
          <apex:axis type="Numeric" fields="val" position="bottom" title="Quantity Remaining"/>
          <apex:barSeries axis="bottom" orientation="horizontal" xField="val" yField="name"/>
        </apex:chart>
      </apex:pageBlock>
      <apex:pageBlock title="New Products">
        <apex:pageBlockButtons location="top">
          <apex:commandButton action="{!save}" value="Save" reRender="existingInv, orderItemTable, pageMessages"/>
        </apex:pageBlockButtons>
        <apex:pageBlockButtons location="bottom">
          <apex:commandButton action="{!addRows}" value="Add" reRender="orderItemTable, pageMessages"/>
        </apex:pageBlockButtons>

        <apex:pageBlockTable value="{!productsToInsert}" var="p" id="orderItemTable">
          <apex:column headerValue="{!$ObjectType.Product2.Fields.Name.Label}">
            <apex:inputText value="{!p.productRecord.Name}"/>
          </apex:column>
          <apex:column headerValue="{!$ObjectType.Product2.Fields.Family.Label}">
            <apex:selectList value="{!p.productRecord.Family}" size="1" multiselect="false">
              <apex:selectOptions value="{!FamilyOptions}"></apex:selectOptions>
            </apex:selectList>
          </apex:column>
          <apex:column headerValue="{!$ObjectType.Product2.Fields.IsActive.Label}">
            <apex:inputField value="{!p.productRecord.isActive}"/>
          </apex:column>
          <apex:column headerValue="{!$ObjectType.PricebookEntry.Fields.UnitPrice.Label}">
            <apex:inputText value="{!p.pricebookEntryRecord.UnitPrice}"/>
          </apex:column>
          <apex:column headerValue="{!$ObjectType.Product2.Fields.Initial_Inventory__c.Label}">
            <apex:inputField value="{!p.productRecord.Initial_Inventory__c}"/>
          </apex:column>
        </apex:pageBlockTable>
      </apex:pageBlock>
    </apex:actionRegion>
  </apex:form>
</apex:page>
product2Trigger : 
trigger product2Trigger on Product2 (after update) {
  Product2Helper.AfterUpdate((List<Product2>)Trigger.new);
}
Constants.cls : 
public class Constants {
  public static final Integer DEFAULT_ROWS = 5;
  public static final String SELECT_ONE = Label.Select_One;
  public static final String INVENTORY_LEVEL_LOW = Label.Inventory_Level_Low;
  public static final List<Schema.PicklistEntry> PRODUCT_FAMILY = Product2.Family.getDescribe().getPicklistValues();
  public static final String DRAFT_ORDER_STATUS = 'Draft';
  public static final String ACTIVATED_ORDER_STATUS = 'Activated';
  public static final String INVENTORY_ANNOUNCEMENTS = 'Inventory Announcements';
  public static final String ERROR_MESSAGE = 'An error has occurred, please take a screenshot with the URL and send it to IT.';
  public static final Id STANDARD_PRICEBOOK_ID = '01s6A0000031LaYQAU'; //Test.isRunningTest() ? Test.getStandardPricebookId() : [SELECT Id FROM PriceBook2 WHERE isStandard = true LIMIT 1].Id;
}
Can somebody try and paste the working code here. It would be a great help.
Thanks in advance.




 
Hello,
I want to create a lightning component to drag and drop fields from one div to another, can anyone help me with this :) 
Anybody has implmented lightning component for drag and drop or browse files with progress bar ?
 
Hi All,

Please look into this, I am not able to call the jQuery datatable function. Below are the details - 

DatatableApp.app - 
<aura:application >
        <c:DatatableComponent />
</aura:application>

DatatableComponent.cmp -
<aura:component controller="DatatableController">
<!-- Static Resource details - jQuery js file --> (jQUerySource), jQuery Datatable file --> (jqueryDatatableJS) -->
	<ltng:require scripts="/resource/1466061468000/jQuerySource,/resource/1466061531000/jqueryDatatableJS" afterScriptsLoaded="{!c.jsLoaded}"/>
<!-- doInit method will call JS controller and then will get the details from Apex Controller and put in into the HTML using aura:iteration -->
  <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 
              <table class="display" id="#sampleTable">
			<thead>
				<tr>
					<th>ID</th>
				</tr>
			</thead>
			<tbody>
				  <aura:iteration items="{!v.cases}" var="case">
         <tr><td>1</td><td>{!case.Id}</td></tr>
       </aura:iteration>
			</tbody>
		</table>
        </div>
        <div class="col-md-2"></div>
    </div>
 </aura:component>
DatatableComponentController.js - 
 
({
    jsLoaded: function(component, event, helper) {
        debugger;
        $('#sampleTable').DataTable();
    },
   doInit: function(component, event, helper) {    
      helper.getCaseList(component);   
   }
})
DatatableComponentHelper.js - 
({
    getCaseList: function(component) {
    var action = component.get("c.getCases");
    var self = this;
    action.setCallback(this, function(actionResult) {
        component.set("v.cases", actionResult.getReturnValue());            
    });
    $A.enqueueAction(action);
  }   
})
DatatableController.apxc - 
public class DatatableController {
   @AuraEnabled
   public static List<Case> getCases() {
       system.debug([SELECT Id FROM Case limit 10]);
       return [SELECT Id FROM Case limit 10];
   }   
}
On click of preview button. I am getting this error -

User-added image

I am using jquery data table (https://datatables.net/) here.

Need urgent help.

Thank you in advance.
 
Hi,

Is there anyway to remove the setup tab, so that standard users can not access this?
I have set up permissions to limit there access to folders, but they can still click on manage users and see other peoples profiles, which i don't want them to have access to.

User-added image
Any one can suggest any PDF or Example on Web Services and Salesforce Integration?
i am going through few PDF's and links but not able to get hands on practise  properly how to use SOAP, REST,WSDL step by step?
Is any Practical example step by step?
I have implemented a lightning app in which I have 2 components
- A modal window component to create an opportunity record
- A summary window component which displays the total number of opportunities along with Total Amount and Expected Amount(based on probability)

Below are the two components 

**************Modal Component***************
<aura:component controller="OpportunityController">

    <!-- UpdateOpptyEvent Sender -->
    <aura:registerEvent name="UpdateOpptyEvent" type="c:UpdateOpptyEvent" />


    <!-- Component Attributes -->
    <aura:attribute name="modalSectionClass" type="String" description="This attribute is used to set class for the modal section" default="slds-modal" />
    <aura:attribute name="backgroundClass" type="String" description="This attribute is used to set class for the background section" default="slds-backdrop" />

    <aura:attribute name="newOpportunity" type="Opportunity" default="{ 'sobjectType': 'Opportunity',
                'Name': '',
                'CloseDate': '',
                'StageName': ''
                }" />

    <!-- slds-fade-in-open-->
    <div aura:id="modalSection" class="{!v.modalSectionClass}" aria-hidden="false" role="dialog">
        <div class="slds-modal__container">
            <div class="slds-modal__header">
                <c:FGButton class="slds-button slds-button--icon-inverse slds-modal__close" svgXlinkHref="/resource/SLDS102/assets/icons/action-sprite/svg/symbols.svg#close" svgClass="slds-button__icon slds-button__icon--large" onclick="{!c.closeModalBox}" />
                <h2 class="slds-text-heading--medium">Create Opportunity</h2>
            </div>
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-form--stacked">
                    <div class="slds-form-element">
                        <span class="slds-form-element__label">Opportunity Owner</span>
                        <div class="slds-form-element__control slds-has-divider--bottom">
                            <span class="slds-form-element__static">Anand Gupta</span>
                        </div>
                    </div>
                    <div class="slds-form-element is-required">
                        <label class="slds-form-element__label" for="text-input-01">
                                              <abbr class="slds-required" title="required">*</abbr> Opportunity Name
                                            </label>
                        <div class="slds-form-element__control">
                            <input id="text-input-01" class="slds-input" type="text" required="true" value="{!v.newOpportunity.Name}" />
                        </div>
                    </div>
                    <div class="slds-form-element is-required">
                        <label class="slds-form-element__label" for="text-input-01">Close Date</label>
                        <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon--right">
                            <c:FGSvg class="slds-input__icon slds-icon-text-default" xlinkHref="/resource/SLDS102/assets/icons/utility-sprite/svg/symbols.svg#event" ariaHidden="true" />
                            <input id="text-input-02" class="slds-input" type="text" value="{!v.newOpportunity.CloseDate}" />
                        </div>
                    </div>
                    <div class="slds-form-element is-required">
                        <label class="slds-form-element__label" for="select-01">
                                                  <abbr class="slds-required" title="required">*</abbr> Stage
                                            </label>
                        <div class="slds-form-element__control">
                            <div class="slds-select_container">
                                <select id="select-01" class="slds-select">
                                        <option>Prospecting</option>
                                        <option>Qualification</option>
                                        <option>Needs Analysis</option>
                                        <option>Value Proposition</option>
                                        <option>Id. Decision Maker</option>
                                        <option>Closed Won</option>
                                        <option>Closed Lost</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="slds-modal__footer">
                <button class="slds-button slds-button--neutral" onclick="{!c.closeModalBox}">Cancel</button>
                <button class="slds-button slds-button--neutral slds-button--brand" onclick="{!c.Save}">Save</button>
            </div>
        </div>
    </div>
    <!--  slds-backdropopen-->
    <div aura:id="backgroundSection" class="{!v.backgroundClass}"></div>

</aura:component>

*******************Summary Window Component*******************
<aura:component controller="OpportunityController">
    <!-- Handle the c:OpportunityTableSummaryEvent fired by the table component-->

    <!--<aura:handler name="optSummaryEvent" event="c:OpportunityTableSummaryEvent" action="{!c.updateTheOpportunitySummaryBox}"/> -->

    <aura:handler event="c:UpdateOpptyEvent" action="{!c.UpdateOppty}" />

    <aura:attribute name="opportunitySummary" type="OpportunitySummary" />
    <aura:attribute name="numOfOpportunities" type="String" default="0" />
    <aura:attribute name="totalValue" type="String" default="0" />
    <aura:attribute name="expectedValue" type="String" default="0" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />



    <div class="slds-box slds-theme--info slds-page-header slds-grid" role="banner">

        <div class="slds-container--left slds-col--padded slds-size--1-of-1 slds-medium-size--1-of-2 slds-large-size--1-of-3">

            <div class="slds-media">

                <div class="slds-media__figure">
                    <c:FGSvg class="slds-icon slds-icon--large slds-icon-standard-opportunity" xlinkHref="/resource/SLDS102/assets/icons/standard-sprite/svg/symbols.svg#opportunity" />
                </div>

                <div class="slds-media__body">
                    <p class="slds-page-header__title slds-truncate slds-align-middle" title="Opportunities">Opportunities</p>
                    <p class="slds-text-heading--large slds-page-header__info slds-p-left--large">{!v.numOfOpportunities}</p>
                </div>

            </div>



        </div>

        <div class="slds-col--padded slds-size--1-of-1 slds-medium-size--1-of-2 slds-large-size--1-of-3">
            <p class="slds-text-heading--small slds-truncate slds-align-middle" title="TotalValue">Total Value</p>
            <p class="slds-text-heading--large slds-page-header__info">{!v.totalValue}</p>
        </div>

        <div class="slds-col--padded slds-size--1-of-1 slds-medium-size--1-of-2 slds-large-size--1-of-3">
            <p class="slds-text-heading--small slds-truncate slds-align-middle" title="ExpectedValue">Expected Value</p>
            <p class="slds-text-heading--large slds-page-header__info">{!v.expectedValue}</p>
        </div>

    </div>

</aura:component>
I have a requirement where I want to refresh/reload/update just the summary window component as soon as the user creates an opportunity record (and it is successful) using the modal component(which is implemented for record creation).

PLEASE NOTE : This is a standalone app and it is not in one.app container. So I can't use the force:refreshView thing.  Also I don't want to refresh the whole page. Just the summary component.

As you can see I am already trying to send an application event on the click of "Save" button in Modal component and then handling it on the Summary component. But after handling it I don't know how to refresh that individual component.

Please help!!
 
I am trying to use date picker in ligtning design system and and using the idea explained in below link to do it.
http://salesforce.stackexchange.com/questions/102599/lightning-slds-styling-for-calendar

This works fine in the browser on the desktop but when I open it Salesforce1 it doesnot work properly and comes out in a weird way.
User-added image
Any idea on how to solve this
 
Can anyone recommend a javascript library that allows drag and drop functionality (desktop and mobile) to a lightning component?

I'm attempting to implement the Sortable js library (https://github.com/RubaXa/Sortable) but I continue to get js errors in the console when trying to run a simple sample that work outside of the lightning component. Thanks!
  • August 20, 2015
  • Like
  • 1
Hi,
i having some problem in salesforce checkmarx report. this generated one waring : Bulkify_Apex_Methods_Using_Collections_In_Methods in particular code


interested_prop = String.escapeSingleQuotes(interested_prop);
String qry = 'select ' + sObjectUtility.sObjectFields('srex__Matches__c') +' Id from Matches__c';
string whereString = ' where Interested_in_Dealing__c = false';
whereString += ' AND ('+ sObjName + ' =: propid ';
whereString += ' OR '+ lookup2 +' =: propid )';
whereString += ' AND ('+ sObjName + ' =: interested_prop ';
whereString += ' OR '+ lookup2 +' =: interested_prop )';

list<Matches__c> matches = Database.query(String.escapeSingleQuotes(qry)+String.escapeSingleQuotes(whereString));
if(matches.size() > 0){
      matches[0].Interested_in_Dealing__c = true;
     try{
            update matches;
         }catch(Exception ex){
                   system.debug('Error occurred while perfoming DML Operation :::::'+ ex.getMessage());
           }
}else{
                Matches__c new_match = new Matches__c();
                new_match.put(sObjName, prop_id);
                new_match.put(lookup2 , interested_prop);
                new_match.Interested_in_Dealing__c = true;
try{
        List<Matches__c> matchlst =
        new List<Matches__c>();
        matchlst.add(new_match);
        insert matchlst;
}catch(Exception ex){
        system.debug('Error occurred while perfoming DML Operation :::::'+ ex.getMessage());
}
}
pls help me out
Hello,
I'm not a developer but have tried to create a visualforce page, that uses a standard controller, that inserts a record. The record inserted is master-detail to the opportunity object in SFDC.

The VF page works and saves the record as desired but I'd like to display a message to the end user that says, "Record Successfully Saved".

I'm afraid I need to create a controller extension to to this, which I do not know how to do. AND, if I have write a controller extension, I'll also have to write a test class, which I also do not know how to do.

Is this a basic request, and if so, could someone help me create the controller extension and test class? Please see below my VF page:


<apex:page standardcontroller="Customer_Survey__c">

<apex:form >
       
 
<apex:pageBlock title="Customer Survey" mode="edit">
      <apex:pageBlockButtons >
        <apex:commandButton action="{!save}" value="Save"/>
        <apex:commandButton action="{!cancel}" value="Cancel"/>
      </apex:pageBlockButtons>
     
      <apex:pageBlockSection title="General" columns="2">
      <apex:inputField value="{!Customer_Survey__c.Opportunity_Name__c}"/>  
      <apex:outputField value="{!Customer_Survey__c.Client__c}"/>
      <apex:outputField value="{!Customer_Survey__c.Opportunity_Owner__c}"/>
      <apex:outputField value="{!Customer_Survey__c.Site__c}"/>
      <apex:outputField value="{!Customer_Survey__c.Close_Date__c}"/>
      <apex:outputField value="{!Customer_Survey__c.CreatedDate}"/>
     
       </apex:pageBlockSection>
     
      <apex:pageBlockSection title="Questions" columns="2">
     
 
     
        <apex:selectList value="{!Customer_Survey__c.Question_1__c}" multiselect="false" size="1"
                label="1.  How important was it to choose a vendor that could take your product through development to commercialization?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
    
     
      <apex:selectList value="{!Customer_Survey__c.Question_2__c}" multiselect="false" size="1"
                label="2.  Please rate how your prior experience working with Patheon in the past was an important factor in your decision, if applicable?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
     
     
      <apex:selectList value="{!Customer_Survey__c.Question_3__c}" multiselect="false" size="1"
                label="3.  How easy was it to reach Patheon with your original request? ">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Difficult" itemLabel="1-Difficult"/>
         <apex:selectOption itemValue="Not Easy" itemLabel="2-Not Easy"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="Easy" itemLabel="4-Easy"/>
         <apex:selectOption itemValue="Very Easy" itemLabel="5-Very Easy"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
     
     
       <apex:selectList value="{!Customer_Survey__c.Question_4__c}" multiselect="false" size="1"
                label="4.  How was our CDA process?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Poor" itemLabel="1-Poor"/>
         <apex:selectOption itemValue="Below Average" itemLabel="2-Below Average"/>
         <apex:selectOption itemValue="Acceptable" itemLabel="3-Acceptable"/>
         <apex:selectOption itemValue="Good" itemLabel="4-Good"/>
         <apex:selectOption itemValue="Excellent" itemLabel="5-Excellent"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
     
     
      <apex:selectList value="{!Customer_Survey__c.Question_5__c}" multiselect="false" size="1"
                label="5.  How accurate were we in translating your RFP/project requirements into a formal proposal?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Poor" itemLabel="1-Poor"/>
         <apex:selectOption itemValue="Below Average" itemLabel="2-Below Average"/>
         <apex:selectOption itemValue="Acceptable" itemLabel="3-Acceptable"/>
         <apex:selectOption itemValue="Good" itemLabel="4-Good"/>
         <apex:selectOption itemValue="Excellent" itemLabel="5-Excellent"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
    
     
      <apex:selectList value="{!Customer_Survey__c.Question_6__c}" multiselect="false" size="1"
                label="6.  How much did our proposal and subsequent revision turnaround time influence your vendor selection decision?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
     
     
      <apex:selectList value="{!Customer_Survey__c.Question_7__c}" multiselect="false" size="1"
                label="7.  How large a factor was facility location in making your final decision?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
    
     
      <apex:selectList value="{!Customer_Survey__c.Question_8__c}" multiselect="false" size="1"
                label="8.  How important was the site qualification/technical visit in your vendor selection?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
    
     
      <apex:selectList value="{!Customer_Survey__c.Question_9__c}" multiselect="false" size="1"
                label="9.  Please rate how important Patheon’s regulatory history was in making your final decision?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
     
      <apex:selectList value="{!Customer_Survey__c.Question_10__c}" multiselect="false" size="1"
                label="10.  Please rate how important price was when making your final vendor selection?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Not at all" itemLabel="1-Not at all"/>
         <apex:selectOption itemValue="Somewhat" itemLabel="2-Somewhat"/>
         <apex:selectOption itemValue="Average" itemLabel="3-Average"/>
         <apex:selectOption itemValue="High" itemLabel="4-High"/>
         <apex:selectOption itemValue="Critical" itemLabel="5-Critical"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
      <apex:selectList value="{!Customer_Survey__c.Question_11__c}" multiselect="false" size="1"
                label="11.  Please rate the negotiation process for legal terms and conditions?">
         <apex:selectOption itemValue="--Select Option--" itemLabel="--Select Option--"/>
         <apex:selectOption itemValue="Poor" itemLabel="1-Poor"/>
         <apex:selectOption itemValue="Below Average" itemLabel="2-Below Average"/>
         <apex:selectOption itemValue="Acceptable" itemLabel="3-Acceptable"/>
         <apex:selectOption itemValue="Good" itemLabel="4-Good"/>
         <apex:selectOption itemValue="Excellent" itemLabel="5-Excellent"/>
         <apex:selectOption itemValue="N/A" itemLabel="Not Applicable"/>
      </apex:selectList>
     
      <br></br>
      <br></br>
      <br></br>
     
      <apex:inputField value="{!Customer_Survey__c.Feedback_Comments_Process_Improvements__c}"/>

  </apex:pageblocksection>

 
    </apex:pageBlock>


</apex:form>

</apex:page>

There is an "idea" to disable jobs, but is there a way to mass delete them all using Apex?   Would like to delete the following:

 

Dashboard Refresh

Data Export

Scheduled Apex

Report Run

 

 

 

https://sites.secure.force.com/success/ideaView?id=08730000000HBnU

Hi All,

Please look into this, I am not able to call the jQuery datatable function. Below are the details - 

DatatableApp.app - 
<aura:application >
        <c:DatatableComponent />
</aura:application>

DatatableComponent.cmp -
<aura:component controller="DatatableController">
<!-- Static Resource details - jQuery js file --> (jQUerySource), jQuery Datatable file --> (jqueryDatatableJS) -->
	<ltng:require scripts="/resource/1466061468000/jQuerySource,/resource/1466061531000/jqueryDatatableJS" afterScriptsLoaded="{!c.jsLoaded}"/>
<!-- doInit method will call JS controller and then will get the details from Apex Controller and put in into the HTML using aura:iteration -->
  <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 
              <table class="display" id="#sampleTable">
			<thead>
				<tr>
					<th>ID</th>
				</tr>
			</thead>
			<tbody>
				  <aura:iteration items="{!v.cases}" var="case">
         <tr><td>1</td><td>{!case.Id}</td></tr>
       </aura:iteration>
			</tbody>
		</table>
        </div>
        <div class="col-md-2"></div>
    </div>
 </aura:component>
DatatableComponentController.js - 
 
({
    jsLoaded: function(component, event, helper) {
        debugger;
        $('#sampleTable').DataTable();
    },
   doInit: function(component, event, helper) {    
      helper.getCaseList(component);   
   }
})
DatatableComponentHelper.js - 
({
    getCaseList: function(component) {
    var action = component.get("c.getCases");
    var self = this;
    action.setCallback(this, function(actionResult) {
        component.set("v.cases", actionResult.getReturnValue());            
    });
    $A.enqueueAction(action);
  }   
})
DatatableController.apxc - 
public class DatatableController {
   @AuraEnabled
   public static List<Case> getCases() {
       system.debug([SELECT Id FROM Case limit 10]);
       return [SELECT Id FROM Case limit 10];
   }   
}
On click of preview button. I am getting this error -

User-added image

I am using jquery data table (https://datatables.net/) here.

Need urgent help.

Thank you in advance.
 
Can anyone recommend a javascript library that allows drag and drop functionality (desktop and mobile) to a lightning component?

I'm attempting to implement the Sortable js library (https://github.com/RubaXa/Sortable) but I continue to get js errors in the console when trying to run a simple sample that work outside of the lightning component. Thanks!
  • August 20, 2015
  • Like
  • 1
https://login.salesforce.com/17181/logo180.png
Failed to load resource: the server responded with a status of 404 (Not Found)

When I load a VF page of a open case, in the Javascript console, the first line of the output has this error. The instructions at the url says to contact support to fix the issue because the resource no longer exists.
My question is of a specific and general nature.  First the specific aspect.  I have the following code in my controller:

public class ListVisableCategories {

    // INSTANTIATE CONTROLLER
    
    public ListVisableCategories(){}
    

    // SET VARIABLES
    
    public Set<String> setRootCat{get;set;}
    public String prefix = Site.getPathPrefix();
    
    
    // DESCRIBE VISABLE CATEGORIES
    
    public static List<String> describeVisibleCategories(Map<String, String> mLabelCat, Map<String, List<String>> mCatStructure, Map<String, String> mParentCategory){
    
        if (prefix == '/xyz') {
    
            Set<String> setRootCat = new Set<String>{'Buyer_Articles'};
        }
    
        else if (prefix == '/abc') {
    
            Set<String> setRootCat = new Set<String>{'All'};
        }

        List<String> listVisableCategories = new List<String>();
        
         ........
            
            // IF APPLICABLE, GATHER ALL CHILD CATEGORIES
            
            if(setRootCat.contains(dc.getName())){
            
                for(DataCategory dcChild : dc.getChildCategories()){ 
                
                    listVisableCategories.add(dcChild.getName());
                }
            }
            
            else{
    
                listVisableCategories.add(dc.getName());
            }
        }
    
        return listVisableCategories;
    }

}

Ignoring other aspects of the code that may be missing (I didn't paste the entire controller) why in the world is it giving me a Compile Error for both the "setRootCat" and "prefix" variables saying that they "don't exist"?  Both variables are declared public.  Shouldn't I be able to access them later in the controller?

The general aspect of my question is why Apex doesn't allow simple usage of a variable across various functions in a class.  PHP, Java, Javascript...they all allow this, but declaring and using variables in various Apex methods in a class seems very cumbersome.  Maybe I'm missing something simple?

Thanks ahead of time!

Hi,

 

I have a visualforce page comprised of a div with a horizontal scroll bar with large number of fields. Due to such design, I don't have a horizontal scroll bar on the window, instead I have it on my div so that I can navigate over all the available fields.

 

If I have a date field at last in the div, the datePicker doesn't appears right there, but it gets rendered at it's absolute position, because of which I need to scroll the window horizontally.

 

Thanks in anticipation

How do you get the ID of the specific object/record that a button was clicked for?