• AndyOgnenoff
  • NEWBIE
  • 0 Points
  • Member since 2011
  • Technical Architect


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi all,

Is it possible to give a 3rd party application access to a custom webservice without giving them access to the standard API? 

To give a little background on my project. Users will use their Salesforce credentials to login and register on one of our sister company's websites. Once they have logged into the site using their Salesforce credentials, the user needs the ability to pull down Salesforce data they own, such as customer information. 

What we have built for this works great, but the issue is being able to restrict the users to the custom service. Our security team his holding up this project because of the additional access to the standard api.

Any thoughts on how to limit access to the custom service only?



 

Hi,

 

Anybody else having problems with images in summer '12?

Our sandbox has been updated and pdf generation now gives an error 'PDF generation failed. Check the page markup is valid.'

 

Test example below gives same issue. Any ideas?

 

<apex:page renderas="pdf">
  <h1>Congratulations</h1>
  This is your new Page
  <img src="http://www.developerforce.com/assets/images/discussions/banner.gif"></img>
</apex:page>

 A case has been logged -but just wondering if there is a quick fix.

 

Thanks!

Rich.

 

 

 

Is it possible to share logic between test classes. The example I have is creating a test class for a trigger on a task. I have to first create an account and then a contact and finally a task. Is there some way to place creation of the account and contact in a separate class and call the class whenever I need to create them? I thought that this was made possible in the last release but I can't find it anywhere.

Does anyone know if there is a new release coming up for IDE? Are there alternatives for force.com ide? 

  • September 28, 2011
  • Like
  • 0

Hello Devs,

    Not sure what i have to modify in test class to make it 75% coverage , but right now it's only giving me 22%, any help is appreciated, this code can be implemented in any org since no custom fields are involved.

 

global class UpdPrimaryCampaignOnOpty implements Database.Batchable<sObject>{

    global String Query;
    global UpdPrimaryCampaignOnOpty(){
        query = 'Select Id, contactId, opportunityId,isPrimary from OpportunityContactRole where (createddate = today or lastmodifieddate = today) and  opportunity.CampaignId = null';
    }
   
   
     global DataBase.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        System.debug('scope size = '+scope.size());
        set<Id> conIds = new Set<Id>();
        Set<Id> optyIds = new Set<Id>();
        Map<Id,Id> optyConMap = new Map<Id,Id>();
        for(sObject s : scope){
            OpportunityContactRole ocr = (OpportunityContactRole)s;
            if(ocr.isPrimary){
                conIds.add(ocr.contactId);
                optyIds.add(ocr.opportunityId);
                optyConMap.put(ocr.OpportunityId, ocr.ContactId);
            }
        }
        System.debug('conIds size = '+conIds.size());
        System.debug('optyIds size = '+optyIds.size());
        System.debug('optyConMap size = '+optyConMap.size());
       
        List<CampaignMember> cmList = [Select id, CampaignId, ContactId, Campaign.createddate from CampaignMember where ContactId IN :conIds];
        System.debug('cmList size = '+cmList.size());
        Map<Id,CampaignMember> contactCampaignMap = new Map<Id,CampaignMember>();
        for(CampaignMember cm : cmList){
           
            if(contactCampaignMap.containsKey(cm.contactId) && cm.Campaign.createddate > contactCampaignMap.get(cm.contactId).Campaign.CreatedDate ){
                contactCampaignMap.put(cm.contactId, cm);
            }
            else{
                contactCampaignMap.put(cm.contactId, cm);
            }          
        }
       
        List<Opportunity> optyList = [Select Id, CampaignId from Opportunity where Id IN :optyIds];
       
        for(Opportunity opty : optyList){
            if(optyConMap.containsKey(opty.id) && contactCampaignMap.containsKey(optyConMap.get(opty.Id))){
                opty.CampaignId = contactCampaignMap.get(optyConMap.get(opty.Id)).CampaignId;
            }       
        }
       
        update optyList;
       
    }
   
    global void finish(Database.BatchableContext BC){
      
   }
        static testMethod void myUnitTest() {
        Test.StartTest();
        UpdPrimaryCampaignOnOpty upc =  new UpdPrimaryCampaignOnOpty();       
        upc.query = upc.query +'Limit 200' ;
        ID batchprocessid = Database.executeBatch(upc);
        Test.StopTest();    
   
  } 
}