• Ginny Mahant
  • NEWBIE
  • 80 Points
  • Member since 2016

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 31
    Replies
Is it possible to create a trigger that can set the priority and the reason for the case based on key words. It would also be good to have the ability to add,remove or update key words without the need to update the trigger?
I have a unit test that covers the undelete of contacts, but it is failing with the message: 'Methods defined as TestMethod do not support Web service callouts'
I believe this is because the installed Cloudingo package also has a trigger on the contact object named ContactUpdatePOSyncTrigger.  There is also a connected app for this package.  The failure doesn't occur until Test.stopTest() is called so it's difficult to narrow it down further.  Is there a way to disable a managed package while running unit tests?  I don't believe I can mock this service callout since it's in a mananged package, and really I have no insight into what the method signature is.

Thanks,
Steve MunLeeuw
Hi All,

      We have done integration from Salesforce to external systems with REST callouts i.e. Salesforce makes request to Survery Monkey, JIRA via REST API when certain records are updated or button are clicking in Salesforce.
      This is the first time we are trying to do the opposite, wherein when a field in JIRA issue is updated, the value of that field needs to be updated in Salesforce. We have written an inbound Apex REST Webservice  in Salesforce and created webhooks in JIRA but are struggling with setting the Authorization header, don't know where and how to set it. Other than webhooks are there any ways to make callouts from JIRA to Salesforce.
P.S. For cost reasons we cannot use a connector. 

Please help.

Thanks & Regards,

     
Workbench

Here is a screenshot from workbecnch. List of object for SOQL and SOSL differs.  How do we understand in general the objects that allow SOQL and objects that allow SOSL. 
Can we follow the rule that all objects (std, custom and metadata ) with NAME, PHONE, EMAIL FIELDS in them allow SOSL ???

Please help I can't understand .
Workbench

Here is a screenshot from workbecnch. List of object for SOQL and SOSL differs.  How do we understand in general the objects that allow SOQL and objects that allow SOSL. 
Can we follow the rule that all objects (std, custom and metadata ) with NAME, PHONE, EMAIL FIELDS in them allow SOSL ???

Please help I can't understand .
Hi Guys,

It is quite a while I do not touch Salesforce so this may be easier than I think. I have a custom object, change request box. I need a field that shows the line manager of the requestor. I thought I could do a formula field as the User object already have a Manager field, so I would just pick that up. However, the only option I see is a ManagerID. There is any way I can get the Manager name instead? When I do the formula field, should not just display an option for it and automatically pick up the line manager from the lookup(user) field I have in the object (requestor)? Thank you :)
HI All 

Looking for a good "allrounder"  for Project support in Global Roll out, 8-9 month contract experienced Business Analyst prefered . Supporting live users, writing requirments, testing, project planning and follow up etc.

Thanks
 
Hi,
We have many cases in which we ask to update both account and title of contact, using the bulk API, and we only see a partial update (only account or only title), even though the result returned from Salesforce was successful.

We upload many contacts in each batch and check results of every single batch. We suspect that an error of any kind in one of the records may cause a partial update of the allegedly successful ones, is that true? how do we prevent such cases?

Thanks!
Tal
Hi All,
When I click on command button I am showing data in outputtext
Data which is showing in output text I want to show it in JSON format.
How can I do this one?
Please help me

Thanks in Advance
Hi All

How can i improve my code coverage of my controller
public class SampleRollupSummary {  
    
    public static void rollupContacts(list<Sales__c> lstOfconts){
        
        system.debug('==lstOfconts== : '+lstOfconts);
        
        set<id> accIds = new set<id>();
        
        list<Contact> updLstOfAccs = new list<Contact>();      
        
         double  totalAmount = 0;
        
        for(Sales__C con : lstOfconts){
            
            accIds.add(con.Customer_Name__c);
            
        }
        
        system.debug('==accIds==:'+accIds);
        
        list<Contact> lstAccs = [select id,Total_Sale__c,(select id,Sold_Price__c from Sales__r) from Contact where id in : accIds];
        
        
        
        for(Contact acc : lstAccs){
            
            
            
            for(Sales__c cpr : acc.Sales__r){
                
                totalAmount = totalAmount + cpr.Sold_Price__c ;
                
            }
            
            acc.Total_Sale__c= totalAmount;
            
            updLstOfAccs.add(acc);
            
        }
        
        if(updLstOfAccs.size() > 0){
            
            update updLstOfAccs;
            
        }
        
        
        
        
        
    }
    
    
    
}
 
@isTest
public with sharing class SampleRollupSummaryTest 
{ 
    static testmethod void validateStandardController()
    {
    Contact con  = new Contact(LastName = 'abc');
    Sales__c pro = new Sales__c();
    pro.sold_price__c=123;
   
     
    insert pro;
 
    insert con;
     
     
  
        
        
     
     }  
  
  
   
}

 
Is it possible to create a trigger that can set the priority and the reason for the case based on key words. It would also be good to have the ability to add,remove or update key words without the need to update the trigger?

Hi, i have  a master-detail relation ship between Car__c(master) and Car_detail__c(detail) and i need a  picklist to choose to every record it's car__c(relationsheep) field.

i tried this code but have " A value cannot be stored to Car__c in type Car_Detail__c" problem 

public List<SelectOption> getCar(){ 
	List<SelectOption> options = new List<SelectOption>(); 
	List<Car__c> carList = new List<Car__c>(); 
	carList = [Select Id, Name FROM Car__c]; 
	options.add(new SelectOption('--None--','--None--'));
    
	for (Car__c cars : carList) 
{ 
	options.add(new SelectOption(cars.Id,cars.Name));
    Car_detail__c.Car__c = cars.Id;    
}          
	return options; 
}
Hi,
I'm getting an Error while executing Async SOQL as "errorCode":"INSUFFICIENT_ACCESS","message":"You don’t have permission to query this object Account with Async SOQL.
What Permissions I have to give ,Am I Missing anything here ...Please Let Me Know Thanks in Advance
Hi,
Recently started on salaeforce. Got a new assignment at work. Need to connect salesforce to sql server and pull live data from tables that maniframe jobs contineously update and then have to transform this data into an dashboard for everyone in the firm to see and only my team has slaesforce.
I just learned through trailhead how to create simple dashboards, It would be very helpful if someone could point me in the right direction
Hello,

I have used limitation in query still i am facing the same problem, can anyone help me here please.

global class POCreationBatch implements Database.Batchable<sObject>
{

    global Database.QueryLocator start(Database.BatchableContext DBC)
    {
         return Database.getQueryLocator([Select Id,Name,Purchase_Order_Type__c,ActiveContractAsset_Count__c from Account where Purchase_Order_Type__c='Required for Invoice' limit 5000]);

             
    }

    global void execute(Database.batchableContext bc,List<sObject> scope)
    {

        List<Account> accountList = (List<Account>)scope;
        Set<Id> accountIdSet = new Set<Id>();

        for(Account accountRecord : accountList)
        {
            accountIdSet.add(accountRecord.id);
        }

        ProductOrderUtils POU = new ProductOrderUtils();
        POU.createPurchaseOrders(accountIdSet);
    }


    global void finish(Database.batchableContext BC){}

}
select id,OwnerId,Territory_ID__c, Patient__c.Territory_ID__r.Current_TM1_Assignee__c from Patient__c where OwnerId !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c =: OwnerId


it is saying "unknow error parsing query"
I have a unit test that covers the undelete of contacts, but it is failing with the message: 'Methods defined as TestMethod do not support Web service callouts'
I believe this is because the installed Cloudingo package also has a trigger on the contact object named ContactUpdatePOSyncTrigger.  There is also a connected app for this package.  The failure doesn't occur until Test.stopTest() is called so it's difficult to narrow it down further.  Is there a way to disable a managed package while running unit tests?  I don't believe I can mock this service callout since it's in a mananged package, and really I have no insight into what the method signature is.

Thanks,
Steve MunLeeuw
Hi All,

This is my trigger which will send an email with attachement whenever a pdf is uplaoded in Notes and Attachement. I wrote a test class but it doesn't cover the code? Would be great if anyone could help me on this. Thanks.
 
trigger EmailTrigger on ContentVersion (after insert){
    
    if(Trigger.isAfter){
        
        List<Messaging.SingleEmailMessage> allMessages = new List<Messaging.SingleEmailMessage>(); 
        if(Trigger.isInsert){
        
		    //Retrieve all invoices based on the requried Invoice Ids. Add your criteria to fetch 
		    // relevant invoices in the Where clause based on the Invoice and ContentVersion 
		    // object relationship. Replace <yourInvoiceIdSet> below with the actual Id Set
            List<Invoice_Payment__c> invoiceList = [Select Id, Name
										    From Invoice_Payment__c 
										   where Id IN (SELECT FirstPublishLocationId FROM ContentVersion WHERE Id IN :trigger.new)];
		
            for(ContentVersion cv : trigger.new){

                Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment(); 
                attachment.setBody(Blob.valueof(cv.ContentBodyId));
                attachment.setFileName(cv.Title + '.' + cv.FileType); 
                
                Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage(); 
                
					message.setToAddresses(new String[] { 'andre.nobre@cleantechsolar.com' ,'rupesh.baker@cleantechsolar.com'});
                    message.setccAddresses(new String[] { 'krishnamurthy.ka@cleantechsolar.com' ,'divina.minoza@cleantechsolar.com'});
                
				//Subject with the retrieved Invoice Number
				message.subject = 
					String.format('Your Invoice having Invoice # {0} is due for payment', 
						new String[]{invoiceList[0].Name}); 
                
				//Email body containing Name with the retrieved invoice
				message.plainTextBody = 
					String.format('Your invoice for {0} with the file name {1} is attached alongwith.', 
						new String[]{invoiceList[0].Name, cv.Title});
						
                message.setFileAttachments(new Messaging.EmailFileAttachment[] {attachment}); 
                allMessages.add(message); 
            } 
        }
        Messaging.sendEmail(allMessages); 
    }
}

Kind Regards
Krishnamurthy
Hi All,

I wanted to get user info detail by using the salesforce OAuth  Apex Callout . I have the access token in my previous step.  Now I am setting the end point url with oauth_token parameter as below:
HttpRequest request = new HttpRequest();
 request.setMethod('GET');
 request.setTimeout(60000);
 String endpoint = 'https://login.salesforce.com/services/oauth2/userinfo?oauth_token='+accessToken;
 request.setEndpoint(endpoint);
 HttpResponse response = new Http().send(request);

I am getting the response  body as :Missing_OAuth_Token "System.HttpResponse[Status=Forbidden, StatusCode=403]".
referred documentation: https://help.salesforce.com/articleView?id=remoteaccess_using_userinfo_endpoint.htm&type=0

Please help.
​Thanks in Advance!!!
 
  • December 11, 2017
  • Like
  • 1