• scottbcovert
  • NEWBIE
  • 445 Points
  • Member since 2011
  • President & Lead Developer
  • Tython


  • Chatter
    Feed
  • 14
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 127
    Replies
I am trying to get Post from wordpress and store into Salesforce Account.

Note : CALLOUT_RESPONSE|[29]|System.HttpResponse[Status=Forbidden, StatusCode=403]

I am getting 403 status code.

public with sharing class WordpressIntegration {
   // Created a remote site setting for this Rest API
    //public List <JSONWrapper> listWrapper {get;set;}
    public List <JSONWrapperWordpess> listWrapper {get;set;}
    List<Account> lstAcc = new List<Account>();
    public String accessToken = 'YWRtaW46QW1hemluZ0AxMjM=';
    public WordpressIntegration() {
        listWrapper = new List < JSONWrapperWordpess >();
    }
    public void fetchDataFromExternalSystem(){
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        String username = 'admin';
        String password = 'Amazing@123';
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        
        //req.setEndPoint('https://api.github.com/users/hadley/orgs');
        req.setEndPoint('http://localhost/project1/wp-json/wp/v2/posts?_fields=author,id,excerpt,title,link');
        req.setMethod('GET');
        HTTPResponse res = h.send(req);
        System.debug('res.getStatusCode() ###'+res.getStatusCode());
        //JSONParser parser = JSON.createParser(res.getBody());
        if (res.getStatusCode() == 200) {
            listWrapper = (List<JSONWrapperWordpess>)System.JSON.deSerialize(res.getBody(), List<JSONWrapperWordpess>.class);
            /*
            If the response contains only one value instead list, then you can use the below code
            JSONWrapper obj = (JSONWrapper) JSON.deSerialize(res.getBody(), JSONWrapper.class); 
            listWrapper.add(obj);
            */
            System.debug('listWrapper @@'+ listWrapper);
            for(JSONWrapperWordpess a : listWrapper){
                Account aa = new Account();
                aa.Name = a.title;
                aa.DOB__c = date.newInstance(2012,05,22);
                aa.Site = a.link;
                aa.AccountNumber = a.id;
                lstAcc.add(aa);
            }
            insert lstAcc;
        }
    }
    public class JSONWrapperWordpess {
        public String title {get;set;}
        public String id {get;set;}
        public String link {get;set;}
        
    }
}
Hi, 
I am trying to build a component int Aura lightning framework and I found out that there is a know issue with "force:inputField" tag. force:inputfiled tag for picklist values is disabled by default and I saw some work around to activate it by removing attribute "disabled", but for some reason my not able to achieve it. Need your help to find out  the issue.  here is my Code. 
**************

test.cmp code: 

<div class="form-group">
              
                <div id="contact_Type" class="col-sm-10">
                    <force:inputField aura:id="contactType" value="{!v.contact.Contact_Type__c}" />
               </div>
           </div>

testController.js : 
({
    init : function(component, event, helper) {
        
              
 
        console.log(' in init : ');
        
    },
    
    newContact : function(component, event,helper){
        
        console.log("in newcontact");
        
        var contact = component.get("v.contact");
        var contactType = component.find("contactType");
        
        contact["Contact_Type__c"] = contactType.get("v.value") ;
        
        console.log("contact firstname : "+contact["firstName"]);
        console.log("contact Type "+ contact["Contact_Type__c"]);
        
        helper.insertContact(component, contact);
        
    }
    
    
})


TestRenderer.js


({
    // Your renderer method overrides go here
    // 
    render : function(cmp){
        
         var ret = this.superRender();
        
         var element = cmp.find("contactType");
        
        
        var contactType = element.getElement();
        
        console.log('contactType has disabled attr ?  '+  contactType.hasAttribute("disabled"));
        
         contactType.removeAttribute("disabled");
       
        return ret; 
    }
})



In the browser console contactType.hasAttribute('disabled'); is comming up as False. So contactType (element) doesnot have that attribute at the time of render. I think the issue is with the order of running "render()" and actual compnent rendering. 
 
  • November 18, 2015
  • Like
  • 0
Hi All,
I have created a CA-Signed Certificate in my Org, But I would like to know what are the steps to get the Certificate Signed and Who will be the person to sign the Certificate. I mean to ask what should be the position of that person who is signing the Certificate. Please help me out.
I am trying to create a new list button on opportunity where the user should be prompted to choose from 3 of our currently 7 opportunity record types.  I have to clue where to even begin solving this. My Button is currently defined as follows:

/006/e?
ent=Opportunity
&retURL=%2F{!Contact.Id}
&accid={!Account.Id}
&opp3={!Contact.Name} - Donation {!YEAR( TODAY() )}
&opp9={!TODAY()}
&opp11=Prospect ID

When the button is used it defaults to the master Record Type, but I want to design the button so it prompts the user to select the Record Type from a subset of types.

Any suggestions ideas are welcome. At a minimum I would like to at least have the user prompted to select any of the current record types.
Hi everyone,

I have an issue when I am trying to clone(standard clone button) a record ,it is redirecting to recordtype page where we choose record type to create record which should not happen . can any please help me out how to resolve it .

Thanks in advance
Hi,

I am trying to create a simple button for an Opportunity that brings the user to a new record page for a custom Object called Policies(Policies__c). The reason I need a custom button is because there is an account lookup field that I want auto populated when clicking new policy off the opportunity. 

However when inserting the Opportunity Name and and Opportunity ID in the custom field for the opportunity lookup it returns as expected with the correct name but the ID returns as 0. I could just remove the ID part and it would work but it causes confusion for a user if there are multiple opps with the same name for example.

Here is what it looks like if I was to hit the default button(doesnt contain Account lookup)
/a04/e?
CF00NN0000001MqbU=testy+testy+-+Risk+Sales+-+2015-11-03
&CF00NN0000001MqbU_lkid=006N0000007UtHL
&retURL=%2F006N0000007UtHL

My Custom one looks like this
/a04/e?
&CF00NN0000001MqbU={!Opportunity.Name}
&CF00NN0000001MqbU_lkid={!Opportunity.Id}
&CF00NN0000001MqO6={!Opportunity.Account}
&CF00NN0000001MqO6_lkid={!Opportunity.AccountId}
&retURL={!Opportunity.Id}

It returns the Account ID but not the opp ID
https://cs6.salesforce.com/a04/e?
&CF00NN0000001MqbU=testy+testy+-+Risk+Sales+-+2015-11-04&
CF00NN0000001MqbU_lkid=0
&CF00NN0000001MqO6=testy+testy
&CF00NN0000001MqO6_lkid=001N000000XgEcH
&retURL=0


 
Hello,

Account Hierarchy is available for Some of the Profiles,

How can i make it available to all the users ?

Thanks for suggestion !
  • November 03, 2015
  • Like
  • 0
I had retrieved the list of user names that is to be updated via metadata api to the custom picklist in the sobj 'contact'. Question is how do i update the picklist values in the loop?
 
MetadataAPIService.MetadataPort service = createService();
    service.SessionHeader.sessionId = sessionId;
    MetadataAPIService.CustomField customField = new MetadataAPIService.CustomField();
    customField.fullName = 'Contact.Test__c'; 
    customField.label = 'Test';
    customField.type_x = 'Picklist'; //customField.type = 'Picklist';
    metadataAPIservice.Picklist sown = new metadataAPIservice.Picklist();
    sown.sorted= false;
    metadataAPIservice.PicklistValue pval = new metadataAPIservice.PicklistValue();
    pval.fullName= 'SHP Picked';
    pval.default_x=false ;
    // Get the user list
    list<user> users = getUserList();
    for (User usr:users){
        //what to do in to insert the list into picklistValues?
    }
    sown.picklistValues = new List<MetadataAPIService.PicklistValue>{pval};

 
  • November 03, 2015
  • Like
  • 0
I am trying to figure out how to use the Rest-Api.  I am getting the error No operation available for request {urn:enterprise.soap.sforce.com}describeSObject I am not sure what I am doing wrong.
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setMethod('GET');
req.setHeader('Content-Type', 'text/xml');
req.setHeader('SOAPAction', 'describeSObject');
//req.setHeader('Authorization', 'OAuth'+UserInfo.getSessionId());



String b = '';
b += '<?xml version="1.0" ?>';
b += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">';
b += '<soapenv:Header>';
b += '<urn:SessionHeader>';
b += '<urn:sessionId>'+UserInfo.getSessionId()+'</urn:sessionId>';
b += '</urn:SessionHeader>';
b += '</soapenv:Header>';
b += '<soapenv:Body>';
b += '<urn:describeSObject>';
b += '<urn:sObjectType>Account</urn:sObjectType>';
b += '</urn:describeSObject>';
b += '</soapenv:Body>';
b += '</soapenv:Envelope>';

req.setBody(b);
req.setCompressed(false);
req.setEndpoint('https://na34.salesforce.com/services/Soap/u/25.0');
HTTPResponse resp = h.send(req);
System.debug(resp.getBody());

 
Hi, I have a code for counting completed activities and it works well in my sandbox. However I cannot deploy it to production because the testclass keeps failing..  I get this error:

Class test_ActivityUtils
Method Name mainTest
Pass/Fail Fail
Error Message System.AssertException: Assertion Failed: Expected: 3, Actual: 0
Stack Trace Class.test_ActivityUtils.mainTest: line 86, column 1

I have bolded line 86


@isTest(seeAllData = true)
private class test_ActivityUtils {
 
    static testMethod void mainTest() {
                Account acc = new Account();
                acc.Name = 'Test Account';
                acc.Industry = 'Transportation'; 
                insert acc;
 
 try { // Perform some database operations that 
 // might cause an exception. 
 insert acc; } 
 catch(DmlException e) { // DmlException handling code here. 
 System.debug('The following exception has occurred:  ' + e.getMessage());
 
 }
        Contact c = new Contact();
        c.FirstName = 'Joe';
        c.LastName = 'Smith';
        c.AccountId = acc.Id;
        c.Email = 'ramanjot_sidhu@hotmail.com';
        insert c;

  try { // Perform some database operations that 
 // might cause an exception. 
 insert c; } 
 catch(DmlException e) { // DmlException handling code here. 
 System.debug('The following exception has occurred: ' + e.getMessage());
 }
        Opportunity o = new Opportunity();
        o.AccountId = acc.Id;
        o.StageName = 'Open';
        o.Amount = 5000.00;
        o.CloseDate = Date.today() + 7;
        o.Name = 'Test Opp';
        insert o;
 
   try { // Perform some database operations that 
 // might cause an exception. 
 insert o; } 
 catch(DmlException e) { // DmlException handling code here. 
 System.debug('The following exception has occurred: ' + e.getMessage());
 }
         
        Task[] tList = new list<task>();
        for(Integer i=0; i<3; i++) {
            Task t = new Task();
            t.Status = 'Not Started';
            t.Priority = 'Normal';
            t.Type = 'Scheduled Call Back';
            if(i==0) t.WhatId = acc.Id;
            if(i==1) t.WhatId = o.Id;
            if(i==2) t.WhoId = c.Id;
            tList.add(t);
 
          
          Event[] eList = new list<event>();
          {
            Event e = new Event();
            e.StartDateTime = DateTime.now() + 7;
            e.EndDateTime = DateTime.now() + 14;
            if(i==0) e.WhatId = acc.Id;
            if(i==1) e.WhatId = o.Id;
            if(i==2) e.WhoId = c.Id;
             eList.add(e);
        }
        insert tList;
        insert eList;
 
   try { // Perform some database operations that 
 // might cause an exception. 
 insert tlIST; } 
 catch(DmlException e) { // DmlException handling code here. 
 System.debug('The following exception has occurred:' + e.getMessage());
 }
 
    try { // Perform some database operations that 
 // might cause an exception. 
 insert elIST; } 
 catch(DmlException e) { // DmlException handling code here. 
 System.debug('The following exception has occurred: ' + e.getMessage());
 }
 
 
        test.startTest();
           system.assertEquals(3, [SELECT Completed_Activities__c FROM Account WHERE Id = :acc.Id].Completed_Activities__c);

            system.assertEquals(2, [SELECT Completed_Activities__c FROM Opportunity WHERE Id = :o.Id].Completed_Activities__c);
            system.assertEquals(2, [SELECT Completed_Activities__c FROM Contact WHERE Id = :c.Id].Completed_Activities__c);
            
            //Delete some activities and run assertions again
            delete eList;
            system.assertEquals(3, [SELECT Completed_Activities__c FROM Account WHERE Id = :acc.Id].Completed_Activities__c);
            system.assertEquals(1, [SELECT Completed_Activities__c FROM Opportunity WHERE Id = :o.Id].Completed_Activities__c);
            system.assertEquals(1, [SELECT Completed_Activities__c FROM Contact WHERE Id = :c.Id].Completed_Activities__c);
           
          
            //Delete the rest activities and run assertions again for zero
            delete tList;
            system.assertEquals(0, [SELECT Completed_Activities__c FROM Account WHERE Id = :acc.Id].Completed_Activities__c);
            system.assertEquals(0, [SELECT Completed_Activities__c FROM Opportunity WHERE Id = :o.Id].Completed_Activities__c);
            system.assertEquals(0, [SELECT Completed_Activities__c FROM Contact WHERE Id = :c.Id].Completed_Activities__c);
         
         
        }
 
}
}
I am writing a test class and I cant use Test.getStandardPricebookId()   , and if I use @isTest (SeeAllData = true)   Ill get the error that 
STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product: [] 

Here is the test case
 
Product2 prod = new Product2(Name = 'Laptop X200', 
            Family = 'Hardware');
        insert prod;
        
        // Get standard price book ID.
        // This is available irrespective of the state of SeeAllData.
        Id pricebookId = Test.getStandardPricebookId();
        
        // 1. Insert a price book entry for the standard price book.
        // Standard price book entries require the standard price book ID we got earlier.
        PricebookEntry standardPrice = new PricebookEntry(
            Pricebook2Id = pricebookId, Product2Id = prod.Id,
            UnitPrice = 10000, IsActive = true);
        insert standardPrice;
        
        // Create a custom price book
        Pricebook2 customPB = new Pricebook2(Name='Custom Pricebook', isActive=true);
        insert customPB;
        
        // 2. Insert a price book entry with a custom price.
        PricebookEntry customPrice = new PricebookEntry(
            Pricebook2Id = customPB.Id, Product2Id = prod.Id,
            UnitPrice = 12000, IsActive = true);
        insert customPrice;


             QuoteLineItem qli = New QuoteLineItem();
             qli.Product2Id=prod.id;
             qli.UnitPrice=12;
             qli.Quantity=50;
             qli.QuoteId=qot.id;
             qli.UnitPrice=50;
             qli.PricebookEntryId=customPrice.id;
             insert qli;

 
I've created a VF page that works great.  However, I cannot get the test class to pass for the life of me.  Below is an exceprt from my VF extension:
public class OpportunityWonExt{
    
    ApexPages.StandardController controller;
    public Opportunity theOpp {get;set;}
    public Account act {get; set;}
    public Contract ct {get; set;}
    
    public OpportunityWonExt(ApexPages.standardController controller){
        theOpp = (Opportunity)controller.getRecord();
        theOpp.CloseDate = Date.today();
        theOpp.StageName = 'Closed Won';
        String actid = theOpp.AccountID;
        OpportunityWonProcess__c settings = OpportunityWonProcess__c.getInstance('Standard Settings');
        String ctOwner = settings.Contract_Owner__c;
        act = [SELECT Id, Name, Company_Size_Type__c FROM Account WHERE ID =:actid ];
        system.debug('LOOK HERE act' + act);
        ct = new Contract();
        ct.AccountID = theOpp.AccountID;
        ct.Status = 'Draft';
        ct.ContractTerm = 12;
        ct.OwnerID = ctOwner;
Below is an excerpt from my test class
 
@isTest(SeeAllData=true) 
private Class OpportunityWonTest{
    
    static testMethod void theTests(){
        // setup some variables 
        String standardPriceBookId = '';
        String UID = '';
        String opportunityName = 'This Is My Favorite Opportunity1234';
        User u = [SELECT ID FROM User WHERE IsActive = TRUE LIMIT 1];
        UID = u.ID;
        
        // Select pricebook
        PriceBook2 pb2Standard = [SELECT ID FROM Pricebook2 WHERE IsStandard = TRUE];
        standardPriceBookId = pb2Standard.Id;
        
        // Setup Account
        Account a = new Account(Name = 'Test Account',Website = 'www.test.com',Company_Size_Type__c = 'Enterprise',OwnerID=UID);
        insert a;
        
        // Setup Opportunity
        Date closedate =  Date.today();
        Opportunity o = new Opportunity(Account = a, Name=opportunityName, StageName='Prospecting', CloseDate=Date.today(),Logo_Use__c = 'Yes', OwnerID=UID);
        insert o;
        Opportunity opp = [Select ID from Opportunity WHERE Name = 'This Is My Favorite Opportunity1234'];
        
        // set up product2
        Product2 p2 = new Product2(Name='Test Product',isActive=true);
        insert p2;
        
        // set up PricebookEntry
        PricebookEntry pbe = new PricebookEntry(Pricebook2Id=standardPriceBookId, Product2Id=p2.Id, UnitPrice=99, isActive=true);
        insert pbe;
        
        // set up OpportunityLineItem
        OpportunityLineItem oli = new OpportunityLineItem(PriceBookEntryId=pbe.Id, OpportunityId=o.Id, Quantity=1, TotalPrice=99, Discount__c=0, Contract_Length__c = 12);
        insert oli;

        // load the page       
        PageReference pageRef = Page.OpportunityWon;
        pageRef.getParameters().put('Id',opp.id);
        Test.setCurrentPageReference(pageRef);
        
        // load the extension
        ApexPages.StandardController newcontroller = new ApexPages.StandardController(opp);
       OpportunityWonExt OppWonExt = new OpportunityWonExt(newcontroller);

When I run the test I get the error "System.QueryException: List has no rows for assignment to SObject" pointing to line 15 for the extension class and line 45 for the test class.

The confusing part is the Account is defined, as it saves the Account fields when I save the page.  Additionally, when I debug there is an Account being selected, so no idea how the list is ending up empty...
Hi All,
How to write test method for following code, please help me.

public class UpdateContactController {
public class MyWrapper
    {
      public string BenifitPlan1{get; set;}
      public Integer PersonnelNumber1 {get; set;}
      public Integer PlanNumber1 {get; set;}
      public string DependentPlan1 {get; set;}
      
      public MyWrapper(Integer PersonnelNumber,string BenifitPlan,string DependentPlan,Integer PlanNumber )  //
      {
          
          PersonnelNumber1 = PersonnelNumber;
          BenifitPlan1 = BenifitPlan;
          DependentPlan1 = DependentPlan;
          PlanNumber1 = PlanNumber;
          
      }
    }
}

Thanks in Advance
Hi All,

i'm totally new with API stuff, 
i had a look on guide (API REST, AJAX SOAP...etc) but i'm a bit lost.
i'm looking for a way to just "read" the SObject (REsult of Query) and inject result into our own Mysql databse for post process on our own Web App (PHP).

could you let me know the easiest way to to that please ?
notice that we just want to "copy" data, not do any changes on SF database.
and volume of data is really low.

Many thanks for all assistance you could provide.
Hi, I'm new to this area and need some help. I have a Google Event with a list of invitees. I have a python code which syncs this event with Salesforce by creating a Event sObject. I queried for the emails in the invitees list of my Google event to check whether such a contact exists.

Now I want to add Invitees through my python code to the Event sObject created in sync with Google Event. I am using salesforce-python-toolkit for the same.(https://github.com/BayCitizen/salesforce-python-toolkit). This is a snippet of the code i have implemented so far. (here eventData is a dictionary containing the information about the event)
h=SforceEnterpriseClient('file://localhost/path-to/wsdl.jsp.xml')
h.login('username','pass','token')
event = h.generateObject('Event')
event.Subject = eventData['title']
event.Location = eventData['location']
event.Description = eventData['description']

acceptedIds = []
for email in eventData['invitees']:
    #query their contacts database using suitable query to check whether a contact who is invitee is available
    query_contact = h.query("SELECT Id,Name FROM Contact WHERE Email=" + "'" + email + "'")
    if query_contact.size != 0 :
        for record in query_contact.records:
            acceptedIds.append(record.Id)
event.AcceptedEventInviteeIds = acceptedIds
result = h.create(event)
h.logout()

But this is not updating the event on my salesforce developer account online, and I cant seem to find the problem. Please suggest changes to this code. 
Thanks!!
I am trying to get Post from wordpress and store into Salesforce Account.

Note : CALLOUT_RESPONSE|[29]|System.HttpResponse[Status=Forbidden, StatusCode=403]

I am getting 403 status code.

public with sharing class WordpressIntegration {
   // Created a remote site setting for this Rest API
    //public List <JSONWrapper> listWrapper {get;set;}
    public List <JSONWrapperWordpess> listWrapper {get;set;}
    List<Account> lstAcc = new List<Account>();
    public String accessToken = 'YWRtaW46QW1hemluZ0AxMjM=';
    public WordpressIntegration() {
        listWrapper = new List < JSONWrapperWordpess >();
    }
    public void fetchDataFromExternalSystem(){
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        String username = 'admin';
        String password = 'Amazing@123';
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        
        //req.setEndPoint('https://api.github.com/users/hadley/orgs');
        req.setEndPoint('http://localhost/project1/wp-json/wp/v2/posts?_fields=author,id,excerpt,title,link');
        req.setMethod('GET');
        HTTPResponse res = h.send(req);
        System.debug('res.getStatusCode() ###'+res.getStatusCode());
        //JSONParser parser = JSON.createParser(res.getBody());
        if (res.getStatusCode() == 200) {
            listWrapper = (List<JSONWrapperWordpess>)System.JSON.deSerialize(res.getBody(), List<JSONWrapperWordpess>.class);
            /*
            If the response contains only one value instead list, then you can use the below code
            JSONWrapper obj = (JSONWrapper) JSON.deSerialize(res.getBody(), JSONWrapper.class); 
            listWrapper.add(obj);
            */
            System.debug('listWrapper @@'+ listWrapper);
            for(JSONWrapperWordpess a : listWrapper){
                Account aa = new Account();
                aa.Name = a.title;
                aa.DOB__c = date.newInstance(2012,05,22);
                aa.Site = a.link;
                aa.AccountNumber = a.id;
                lstAcc.add(aa);
            }
            insert lstAcc;
        }
    }
    public class JSONWrapperWordpess {
        public String title {get;set;}
        public String id {get;set;}
        public String link {get;set;}
        
    }
}
I have a number of problems/questions that I'm facing with respect to Named Credentials/Auth. Providers in my managed package. I'll cover my first problem here.

I have created a Connected App and included it in our managed package.

Now, because the URL is different for each of our clients, we must create a new Named Credential in each installed org - we can't put it into the managed package. Also, since Auth. Providers can't be included in managed packages, we must create a new Auth. Provider in each installed org. The Auth. Provider is using Salesforce OAuth authentication and is saved with a Callback URL which Salesforce generates. When I tested this in the org where I created the managed package, I had to copy that generated Callback URL into the Callback URL list of my Connected App. This raises a problem: I can't edit the Callback URL list of the Connected App in the org into which I've installed the Connected App - it's in the managed package so Salesforce won't allow editing of that list.

So my question: is there a way to edit the Callback URL list of the Connected App in the managed package? If not, is there any other work-around other than adding the Callback URL from the Auth. Provider to my Connected App and generating a new version of the package?

Thanks in advance for any help/insight.
I currently use an app called ring my bell that when an opportunity is closed won it will notify other salesforce users with a sound. It also has a home page component that shows information about the last closed won opportunity. I would like to do the same thing for cases. When someone closes a case it would trigger a sound notification for other users. Any ideas on how to accomplish this?
Hi All
We have enable Platform encryption in our organizations. It works with standard and the custom  fields. While coming to encrypting the files and attachment, files are displaying content even they are encrypted. How to encrypt the files using Platform Encryption
I am using Dev instance where Platform Encryption is enabled. When attaching the file to relevant record, it will encrypt the files before storing into Salesforce Db. But that attachment file is still visible to another user.
My Question is how to show encrypted the uploaded files attachment to specific user who dont have "View Encrypted Data" permission. 

Attachment Files must be seen in plain text only who have 'View Encrypted Data' Permission.
Hi, 
I am trying to build a component int Aura lightning framework and I found out that there is a know issue with "force:inputField" tag. force:inputfiled tag for picklist values is disabled by default and I saw some work around to activate it by removing attribute "disabled", but for some reason my not able to achieve it. Need your help to find out  the issue.  here is my Code. 
**************

test.cmp code: 

<div class="form-group">
              
                <div id="contact_Type" class="col-sm-10">
                    <force:inputField aura:id="contactType" value="{!v.contact.Contact_Type__c}" />
               </div>
           </div>

testController.js : 
({
    init : function(component, event, helper) {
        
              
 
        console.log(' in init : ');
        
    },
    
    newContact : function(component, event,helper){
        
        console.log("in newcontact");
        
        var contact = component.get("v.contact");
        var contactType = component.find("contactType");
        
        contact["Contact_Type__c"] = contactType.get("v.value") ;
        
        console.log("contact firstname : "+contact["firstName"]);
        console.log("contact Type "+ contact["Contact_Type__c"]);
        
        helper.insertContact(component, contact);
        
    }
    
    
})


TestRenderer.js


({
    // Your renderer method overrides go here
    // 
    render : function(cmp){
        
         var ret = this.superRender();
        
         var element = cmp.find("contactType");
        
        
        var contactType = element.getElement();
        
        console.log('contactType has disabled attr ?  '+  contactType.hasAttribute("disabled"));
        
         contactType.removeAttribute("disabled");
       
        return ret; 
    }
})



In the browser console contactType.hasAttribute('disabled'); is comming up as False. So contactType (element) doesnot have that attribute at the time of render. I think the issue is with the order of running "render()" and actual compnent rendering. 
 
  • November 18, 2015
  • Like
  • 0
I am trying to get a list of records to display as a group of tiles in a grid style layout. I however cannot get the second record to display in the second column. 

Here is my code:
<apex:repeat value="{!metric}" var="PM"> 
    <apex:outputPanel layout="block" >
        <apex:panelgrid>
                    <apex:image url="{!PM.Badge_Image__c}" styleClass="imageStyle"/>
                    <apex:outputpanel>
                        <apex:panelGroup styleClass="dataStlye"  >
                            <apex:outputText value="{!PM.Performance_Badge__c}"/><br/>
                            <apex:outputText value="{!PM.Name}"/><br/>
                            <apex:outputText value="{!PM.Points__c}"/><br/>
                            <apex:outputText value="{!PM.Earned_Date__c}"/><br/>
                        </apex:panelGroup>
                    </apex:outputpanel>
               </apex:panelgrid>
    </apex:outputPanel> 
      </apex:repeat>

I currently get this:
User-added image

I want this:
User-added image

Any ideas? 
 
Hello,

Ive created a custom REST webservice within Salesforce.com. This webservice will be consumed by users from a 3rd Party website that register on that site with their Salesforce.com credentials. I would like to allow users to consume my custom webservice but do not want to give them free reign of all data they own via the Salesforce.com APIs in the process. This is due to the sensitivity of some of the information that we do not want to provide via the custom web service. So I could use some advice on how best to accomplish this, here's what I have done so far..

1. Ive created a Connected App that uses OAuth for authentication and allowing the following scopes..
  • Access your basic information (id, profile, email, address, phone)
  • Perform requests on your behalf at any time (refresh_token, offline_access)
2. Ive created a custom apex class that defines the REST service and given permission to this class to the proper profiles.

What steps do I need to perform to make sure the users only have access to the REST service and not all data?

Thank you for your help. All suggestions are appreciated!

I have created a Connected App so that the 
Hi All,
I have created a CA-Signed Certificate in my Org, But I would like to know what are the steps to get the Certificate Signed and Who will be the person to sign the Certificate. I mean to ask what should be the position of that person who is signing the Certificate. Please help me out.
I am trying to create a new list button on opportunity where the user should be prompted to choose from 3 of our currently 7 opportunity record types.  I have to clue where to even begin solving this. My Button is currently defined as follows:

/006/e?
ent=Opportunity
&retURL=%2F{!Contact.Id}
&accid={!Account.Id}
&opp3={!Contact.Name} - Donation {!YEAR( TODAY() )}
&opp9={!TODAY()}
&opp11=Prospect ID

When the button is used it defaults to the master Record Type, but I want to design the button so it prompts the user to select the Record Type from a subset of types.

Any suggestions ideas are welcome. At a minimum I would like to at least have the user prompted to select any of the current record types.
Hi everyone,

I have an issue when I am trying to clone(standard clone button) a record ,it is redirecting to recordtype page where we choose record type to create record which should not happen . can any please help me out how to resolve it .

Thanks in advance
Hi ,
 My question is how long download link of a beta release of an app available for download to install beta release app for testing?
 
I find really complex programming instructions when I search for Oauth, but I know I did use an Oauth to install Salesforce for Outlook and that was simple. 
Hi,

Is their any way to modify the filter for date values to select for a value based on date field and not using the calendar
  • November 10, 2015
  • Like
  • 0
Hi,

I am trying to wirte a trigger that will pull the Ad ops team member from opportunity teams to the opportunity page. I found code in the forum that I was able to tweak and make work but it the trigger is on the opporunityteam so it only updates the field when I edit the opportunity team. Since our opportunity teams are inserted automatically when the opportunity is created this is a problem. I was wondering if anyone has already solved this problem. 

Thanks in advance for your help,

Edward
Hi all,

I am attempting to create a custom highlight panel. What I ultimately need to do is on the focus of a subtab, I need an event to fire and send information to the highlight panel. The highlight panel is for the primary tab (Account), and the event needs to fire from the subtab (Opportunity). The reason I need to do it like this is because we pull in information via an outside API (which is displayed on the subtab on a VF page), and when a subtab is focused, I need the fired event to send this information so the primary tab highlight panel can grab it.

I am aware of the sforce.console.onFocusedSubtab() method, however, the issue with this is that the event will fire for every subtab that is open. So if 3 opporutnity subtabs are open for one account, when one of those subtabs is focused, all 3 events will be fired from all 3 subtabs.

Does anyone have any suggestions how I can go about getting the event to fire only from the focused subtab?

Thanks in advance, and any suggestions/comments would be much appreciated.
Hi,

I have enabled lightning experience in my org. Now I am trying to edit the layout of account detail page using lightning app builder.  Here I can find only for desktop(Mobile and tablet are not found).  How to edit the layout of account detail page in mobile and tablet.  Please suggest..

Thanks in advance..

We are using SDocs with images hosted in Box due to image size constraints.  We are having an issue where the PDF renders VERY quickly, however the images which are hosted on Box do not have time to render before the PDF creation is complete.  Is there a way to slow down the PDF creation process to ensure that the images are rendered prior to the PDF finalization?

This was working for about 2 months, however we're back to this issue after Summer '14 release.  We did find a whitelist issue that was resolved, so the images are not broken, however they also do not show up.

We've updated to SDocs Winter '15 in our sandbox (we do not have a Salesforce Winter '15 instance this time), however that does not solve the issue.  In addition, we're using direct links (non-redirected) to ensure that the images are loaded as quickly as possible.