• Hare
  • NEWBIE
  • 80 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 53
    Questions
  • 50
    Replies

I have written this REST class in SFDC developer Org. And I am able to access this REST callout thorugh workbench.developerforce.com using this URL

 

REST URL= 

/services/apexrest/StakkonForce/v1.0/MYCALL/getAccountRecords

===================================================================================================

//Apex Class:

 

@RestResource(urlMapping='/v1.0/MYCALL/*')
global without sharing class MyRestWs{

@HttpGet
global static List<Account> getListOfAccount() {
RestRequest request = RestContext.request;
RestResponse response = Restcontext.response;
String operation = request.requestURI.substring(request.requestURI.lastIndexOf('/getAccountRecords')+1);
String resource = operation.split('/').get(0);
list<Account> lstAccount=new list<Account>();
if(resource == 'getAccountRecords') {
lstAccount= [ Select ID, Name, Phone, BillingState from Account limit 100];
}
return lstAccount;

}

}

===========================================================================================

 

I wanted to Access this above REST call out from different sfdc Developer Org.

 

Please provide me some sample code And Steps.

Thanks in advance.

 

 

 

  • December 04, 2013
  • Like
  • 0
HI Curently we are using Queue base Omni-Channel Routing. if we Enable Skills-Based Routing will that be addtional cost ? or Free .
  • April 10, 2019
  • Like
  • 0
we have configured Omni Routing Configurations in my Org. in Routing Configuration "Overflow Assignee" currently we are assigning to user called "John Test". lets say after few days "John Test" user deactivated what will happens to omni Chanel. 
  • April 03, 2019
  • Like
  • 0
Hi All,

I wrote a batch class which updating records. as per batch query it is returning 70 records .. but it is failing every time in prodution  with this "First error: [REQUEST_RUNNING_TOO_LONG] Your request was running for too long, and has been stopped.". error . in prod also 70 record with batch query condition . 

Thanks,
Hare
  • December 06, 2018
  • Like
  • 0
How to route a case a second time using omni-channel?
Example: Omni-channel auto assigns Case 1 to Agent A from Queue A1.

Agent A changes to status C  and an Trigger moves case 1 to Queue B1.

After x time a time-based workflow is used then qualifies Case 1 with same status C to move back to Queue A1  by using trigger .
in salesforce we are able to see Case1  record in  Queue A1.. but in Omni  Chanel Omni Supervisor Queue A1 not able see Case1 record .
Please help me 
 
  • November 17, 2018
  • Like
  • 0
please advise me we are migrating our project to classic to Lightning just want to know best way to Convert notes to New Enhanced Notes lightning and Convert old attachments to New Files lightning

please advice me.
  • January 11, 2018
  • Like
  • 0
I am not able to see Setup Assistant in my ORG do we need any licence for this ?
please suggest me 

Thanks,
Hare
  • October 20, 2017
  • Like
  • 0
public  static String ApproveRejectnavigation() { 
        String url='';  
        string myParam = apexpages.currentpage().getparameters().get('myParam'); 
        system.debug('1111111111'+myParam );
       // string returl = '&retURL=%2Fapex/TWC_ThisWeekTCMeeting';
        url='https://'+ System.URL.getSalesforceBaseUrl().getHost() +   
            '/p/process/ProcessInstanceWorkitemWizardStageManager?id=' + myParam+'&retURL=%2Fapex'+'/'+'TWC_ThisWeekTCMeeting';      
        return url;  
    }
please help me
  • January 08, 2017
  • Like
  • 0
How to  navigate Opportunity files list in salesforce1 mobile app in
i have a vf page with one button when i click on button k it shoud go related opportunity files ection
               sforce.one.navigateToRelatedList('RelatedAttachmentList',oid);
please help 
  • January 08, 2017
  • Like
  • 0
I hve overided Opportunity New Standedbutton with below VF page to prepopulate some values up on creating new record 
it is working fine for desk top but in salesforce1 not working please help me below is my code

<apex:page action="{!prepopulateValues}" standardController="Opportunity" extensions="MyControlleroppy">
</apex:page>
 
 public class MyControlleroppy
{

public opportunity oppty {get;set;}  

      
    private final Opportunity o; //Opportunity object
    
    //constructor
    public MyControlleroppy(ApexPages.StandardController standardPageController) {
        o = (Opportunity)standardPageController.getRecord(); 
    }
    
    //method called from the Visualforce page action attribute
    public PageReference prepopulateValues() {
        
        Map<String, String> passedParams = System.currentPageReference().getParameters(); 
        PageReference pageWhereWeEndUp = new PageReference('/006/e');
        
        pageWhereWeEndUp.getParameters().putAll(passedParams); 
        
        
            
        pageWhereWeEndUp.getParameters().put('opp3','Prospecting'); 
        pageWhereWeEndUp.getParameters().put('opp9',Date.Today().addDays(30).format()); 
        
        String dropSaveNew = pageWhereWeEndUp.getParameters().remove('save_new'); 
        String dropSave = pageWhereWeEndUp.getParameters().remove('save'); 
        
        pageWhereWeEndUp.getParameters().put('nooverride', '1'); 
        pageWhereWeEndUp.setRedirect(true);
        return pageWhereWeEndUp;
    }

}
  • December 06, 2016
  • Like
  • 0
HI 

I have Opportunuty Object in That i have Status pick list field have 3 values(in progress, startted , completed)
if Status values='completed' user should not be Edit or delete Record .

But user shoud able to create a  new record with Status completed "

Any help Apprisiated 

 
  • November 29, 2016
  • Like
  • 0
i have 3 objects   Child__c is junction object , Account is master obj, Contact master object.
while createing a junction object record need to maintain uniqness its working fine
but How to write trigger to avoid duplicate records when bulkfying the trigger

my trigger is:
trigger Dupcheck on Child__c (before insert,before update) {

List<Child__C> junctionObjs = new List<Child__C>();

Set<Id> ParentAObjs = new Set<Id>();
Set<Id> ParentBObjs = new Set<Id>();

for(Child__C c:trigger.new){
    parentAObjs.add(c.physition__c);
    parentBObjs.add(c.site__c);
}

JunctionObjs = [
SELECT startDate__C, endDate__C,Role__c,Child__c.physition__c,Child__c.site__c
FROM Child__C
WHERE physition__c in :parentAObjs AND
    site__c in :parentBObjs
];
           system.debug('i am JunctionObjs '+JunctionObjs );

for(Child__c j :JunctionObjs) {
    for(Child__c c: Trigger.new) {
        if(c.physition__c == j.physition__c && c.site__c== j.site__c && c.Role__c==j.role__c){
            if((c.EndDate__C >= j.StartDate__C && c.EndDate__C <= j.EndDate__C) ||
                       (c.StartDate__C >= j.StartDate__C && c.EndDate__C <= j.EndDate__C) ||
                       (c.StartDate__C >= j.StartDate__C && c.StartDate__C <= j.EndDate__C) ||
                       (c.StartDate__C < j.EndDate__C && c.EndDate__C > j.EndDate__C  )
                      )
            {
            
                   c.addError('Youre attempting to insert a record that overlaps time-wise with an existing child object');
              }
        }
    }

    }

this is working fine when inserting single records but it is not working when inserting morer than one record like using dat loader i am inserting 10 record .. please help me on this 
  • June 08, 2016
  • Like
  • 0

I have a vf page with email template pick list user able to select email template name
Choose file : user able to upload a file attachment from his computer.
there is a command button send email . once clicking on send email need to send email with selected template with email attachment . please help me on this.. sample code :
<apex:page standardController="Contact" extensions="WrapperClsOnContactMass">
    <apex:form >
    <apex:pageMessages >
    </apex:pageMessages>
        <apex:pageBlock >
            <apex:pageBlockTable value="{!wrapperObj}" var="x">
                <apex:column value="{!x.conobj.name}"/>
                <apex:column value="{!x.conobj.email}"/>
                <apex:column >
                  <apex:inputcheckbox value="{!x.checkBox }"/>
                </apex:column>
            </apex:pageBlockTable>
            <apex:pageBlockSection >
            <apex:commandButton value="SendEmail" action="{!sendEmail}"/>
            
            </apex:pageBlockSection>
            </apex:pageBlock>
    </apex:form>
</apex:page>
--------------------------------
public with sharing class WrapperClsOnContactMass {

    public List<WrapperClassEx> WrapperList{get;set;}
    
    public WrapperClsOnContactMass(ApexPages.StandardController controller) {
        
    }
     
    public List<WrapperClassEx> getwrapperObj(){
        List<Contact> conList =[select id, name, email from contact limit 5];   
        WrapperList = new List<WrapperClassEx>();
        for(Contact con: conList){
            
            
            WrapperList.add(New WrapperClassEx(con,false));  
        }
        return WrapperList;  
    }
    
    public class WrapperClassEx{
        
       public WrapperClassEx(){
            
        }
       public Contact conObj{get;set;}
       public Boolean checkBox{get;set;}
       public WrapperClassEx(Contact conRec, boolean SelectedBox){               
          conObj= conRec;
          checkBox = SelectedBox;
       }
    }
        
       public void sendEmail(){
         List<Messaging.SingleEmailMessage> lstEmailId=new List<Messaging.SingleEmailMessage>();
         for(WrapperClassEx w: WrapperList){
            if(w.checkBox == true){
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                mail.setToAddresses(new String[] {w.conObj.Email});
                mail.setReplyTo('sumit.shukla@magicsw.com');
                mail.setplainTextBody('Hello');
                mail.setSenderDisplayName('Your Company Name');
                mail.setSubject('Test Email From Force.com Sites');
                lstEmailId.add(mail);                        
            }
          }
            if(lstEmailId.size()>0){
                try{
                    Messaging.sendEmail(lstEmailId);
                    ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.Confirm,'Sent!'));
                }Catch(Exception ee){
                    ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.Error,ee.getMessage()));
                }
                
            }
       }     
}
  • May 12, 2016
  • Like
  • 0
i have 3 objects   Child__c is junction object , ParentA__c is master obj, Parentb__c master object.

so child__c (Many to Many relation ship) is junction object bitween ParentA__c and ParentB__c
in child__c i have 2 date fiels Startdate, enddate
while createing a junction object record need to maintain uniqness using ParentA__c ,ParentB__c and range of Startdate, enddate
example :  dd/mm/yyyy
    Record1: startdate  10/06/2016  enddate 10/07/2016  save record sucessfully          
     Record2: startdate  10/06/2016  enddate 02/07/2016  need to give error message 
      Record3: startdate  20/06/2016  enddate 20/07/2017  save record sucessfully
     Record4: startdate  20/06/2016  enddate 01/07/2016 need to give error message 

for this i wrote below sample code please help me bulkyfy

trigger Jundupcheck on Child__c (before insert) {
for (Child__c  ci : trigger.new) {


     
// We only care if there is one record<br>      
List<Child__c> resultList = [SELECT id,Name,Enddate__c,StartDate__c,(selected id)  FROM Child__c  WHERE  ParentA__c = :ci.ParentA__c AND   ParentB__c = :ci.ParentB__c and  ( (StartDate__c >= :ci.StartDate__c AND StartDate__c <= :ci.EndDate__c) OR (endDate__c  >= :ci.StartDate__c AND endDate__c  <= :ci.endDate__c) )  ];
                     
            // Raise the error back if any records found    
            
            if (resultList.size()>0) {
             ci.addError('Duplicate record, a Affisiation already exists for that combination');    
             }  }

}
  • May 10, 2016
  • Like
  • 0
I have  Parent and Child two objects with lookup relation.
in parent obje we have Location  text field.
in child obj also we have Location  text field.
whenever createding paren record with Boston as Location .. it need to check in child object . if in child obj with Location Boston if we found 6 records then need to cratee 6 child records.
please help me on this.

trigger CreateChild on Parent__c (after insert) {
List<Child__c> Childs = new List<Child__c>();
for(Parent__c a : trigger.new){
Child__c Child = new Child__c ();
Child.Parent__c = a.id;
Child.Name = 'testName';
Childs.add(Child);
}
insert Childs;
}
 
  • November 03, 2015
  • Like
  • 0
I Have a Parent Account object in this i have check box field "No Asset exist". when ever i am trying to check the checkbox it need to show error message if Assert records exist for this Account Object. if no assert are exist for Account no error message need to show . Assert is child of Account. its shoud be bulkify need to work for multiple Accounts

Need achive by using trigger...plese help on this
  • August 26, 2015
  • Like
  • 0
I have Account as parent object. Campaigne and Candidate objects are child objects of (lookup) Account Objects. in Candidate Objects I have 3 fields first name, Last Name, Age fields. when i am treying to save Campagine record if it shoud check related candidate fields(first name, Last Name, Age) should not bank. if blank upon saveing Campagine records it should display error message that 'first name, Last Name, Age' fileds should not blank. it should work if any of candidate field is blank also...

kindly suggest me....
  • August 24, 2015
  • Like
  • 0
validation rule  : Either Opportunity Name field or Case Number field must be populated, but not both. plz help me on this
  • June 04, 2015
  • Like
  • 0
Please find below link me also ave sae requirment but addtionally delete also please help on is
http://salesforce.stackexchange.com/questions/40701/update-checkbox-on-parent-when-any-of-its-child-records-are-updated
 
  • June 01, 2015
  • Like
  • 0
Hi i have equirment like below .. 

Sfdc Sanded  Mouse over functionality
Need  Salesforce Standad mouse over functionality on custom Object . need  help  
  • April 23, 2015
  • Like
  • 0
I have installed apptus from Appexchange .. As per my requirment i need to change controller .. but controller code not visiable.. plz help me on this if any one ave idea.
  • April 22, 2015
  • Like
  • 0
How to route a case a second time using omni-channel?
Example: Omni-channel auto assigns Case 1 to Agent A from Queue A1.

Agent A changes to status C  and an Trigger moves case 1 to Queue B1.

After x time a time-based workflow is used then qualifies Case 1 with same status C to move back to Queue A1  by using trigger .
in salesforce we are able to see Case1  record in  Queue A1.. but in Omni  Chanel Omni Supervisor Queue A1 not able see Case1 record .
Please help me 
 
  • November 17, 2018
  • Like
  • 0

We have written a before/after update trigger on AgentWork object to get information about the Owner Change from Queue to User on Case record acceptance from Omni Channel. To get this From and To owner information we tried to use UserId and OriginalQueueId fields from AgentWork object. As we tried to access and use OriginalQueueId field in our trigger's handler class, Our trigger stopped firing. We found no debug logs in developer console on case acceptance. As we commented or removed OriginalQueueId field from our trigger code, trigger started executing. In our findings we saw that "OriginalQueueId" field is not present within AgentWork object from trigger.new list.
Here is the log:

AgentWork: AgentWork:{Id=0Bz5B0000004LhuSAE, IsDeleted=false, Name=00004387, CreatedDate=2017-09-28 12:33:56, CreatedById=0055B000000W1hGQAS, LastModifiedDate=2017-09-28 12:34:01, LastModifiedById=0055B000000W1hGQAS, SystemModstamp=2017-09-28 12:34:01, UserId=0055B000000W1hGQAS, WorkItemId=5005B000002SIDGQA4, Status=Opened, ServiceChannelId=0N932000000TN1KCAW, LASessionId=2de1db2c-6ae1-429e-97b9-160592cae978, StatusSequence=0, CapacityWeight=1.00, CapacityPercentage=null, RequestDateTime=2017-09-28 12:28:48, AcceptDateTime=2017-09-28 12:34:01, DeclineDateTime=null, CloseDateTime=null, SpeedToAnswer=313, AgentCapacityWhenDeclined=null, PendingServiceRoutingId=0JR5B0000000Ke6WAE, PushTimeout=60, PushTimeoutDateTime=null, HandleTime=null, ActiveTime=null, DeclineReason=null, CancelDateTime=null, AssignedDateTime=2017-09-28 12:33:56}


As we did not find this field in AgentWork record from trigger.new list, We tried to do the following query on AgentWork record to get OriginalQueueId field value:

SELECT Id, OriginalQueueId FROM AgentWork WHERE Id in: setCurrentAgentWorkIds


and again this stopped our trigger from execution and found no debug logs were generated for our trigger statements.
We try to execute the same query in Developer console & eclipse and we were able to see OriginalQueueId field value in results. It is just not working in use with our trigger execution. I verified the isAccessible via Schema.DescribeFieldResult and it is returning "true" for OriginalQueueId field.

Can we get an explanation on this behavior? Is there any special restriction on using OriginalQueueId field in AgentWork trigger?
See Class Here:

public with sharing class AgentWorkTriggerHandler {

    public static void afterUpdate( list<AgentWork> lstNewAgentWorks, map<Id, AgentWork> mapNewAgentWorks, list<AgentWork> oldNewAgentWorks, map<Id, AgentWork> mapOldAgentWorks ){

        map<Id, AgentWork> mapAWorkByCaseId = new map<Id, AgentWork>();
        for( AgentWork aWork : lstNewAgentWorks ){
            System.debug('---> AgentWork: '+aWork);
            if( aWork.Status == 'Opened' && String.valueOf( aWork.WorkItemId ).startsWith( '500' ) ){
                mapAWorkByCaseId.put( aWork.WorkItemId, aWork );
            }
        }

        if( mapAWorkByCaseId.size() > 0 ){
            map<Id, Case> mapNewCase = new map<Id, Case>();
            map<Id, Case> mapOldCase = new map<Id, Case>();

            map<Id, Id> mapQueueIdByWorkId = getQueueIdByWorkId( mapNewAgentWorks.keyset() );

            for( Case caseObj : [SELECT Id, OwnerId, Status, CreatedDate FROM Case WHERE Id in:mapAWorkByCaseId.keySet()]){
                AgentWork aWork = mapAWorkByCaseId.get( caseObj.Id );
                mapNewCase.put( caseObj.Id, caseObj );

                Case oldCase = caseObj; 
                oldCase.OwnerId = mapQueueIdByWorkId.get( aWork.Id );
                mapOldCase.put( caseObj.Id, oldCase );
            }
            System.debug( '----> mapOldCase: '+mapOldCase);
            System.debug( '----> mapNewCase: '+mapNewCase);
            CaseTriggerHandler.updateCaseLifeCycleRecords( mapNewCase.values(), mapNewCase, mapOldCase.values(), mapOldCase );
        }
    }

    public static map<Id, Id> getQueueIdByWorkId( set<Id> workIds ){
        map<Id, Id> mapQueueIdByWorkId = new map<Id, Id>();

        // If I comment below loop statement, I can see debug logs from this handler class in Developer console.
        // If I leave below loop uncommented, I did not get any debug logs for this handler class in developer console. even no debugs from the trigger. 
        for( AgentWork aWork : [SELECT Id, OriginalQueueId FROM AgentWork WHERE Id in:workIds]){ 
            mapQueueIdByWorkId.put( aWork.Id, aWork.OriginalQueueId );
        }
        return mapQueueIdByWorkId;
    }
}
Hi folks,

Does any one know if it's possible to set parent id parameter in e.force:createRecord event in Lightning Component or any workaround for this?

I have two custom objects in a master (Project)-detail (Task) relationship. I want to override the OOTB New button on the Tasks related list. When I click a custom Quick Action button from the Project page to create a new Task, I do some validation first and then if success I'd like to forward the user to the create new Task page with the parent field for Project to be populated like it works with the out of the box New button on the related list. Because the parent id is not being passed, when the new Task form gets loaded, the parent field appears open in the search mode and the user has to select the parent record which is very inconvenient. 

Would anyone have a suggestion? Thankyou in advance
  • March 28, 2017
  • Like
  • 1
HI 

I have Opportunuty Object in That i have Status pick list field have 3 values(in progress, startted , completed)
if Status values='completed' user should not be Edit or delete Record .

But user shoud able to create a  new record with Status completed "

Any help Apprisiated 

 
  • November 29, 2016
  • Like
  • 0
i have 3 objects   Child__c is junction object , Account is master obj, Contact master object.
while createing a junction object record need to maintain uniqness its working fine
but How to write trigger to avoid duplicate records when bulkfying the trigger

my trigger is:
trigger Dupcheck on Child__c (before insert,before update) {

List<Child__C> junctionObjs = new List<Child__C>();

Set<Id> ParentAObjs = new Set<Id>();
Set<Id> ParentBObjs = new Set<Id>();

for(Child__C c:trigger.new){
    parentAObjs.add(c.physition__c);
    parentBObjs.add(c.site__c);
}

JunctionObjs = [
SELECT startDate__C, endDate__C,Role__c,Child__c.physition__c,Child__c.site__c
FROM Child__C
WHERE physition__c in :parentAObjs AND
    site__c in :parentBObjs
];
           system.debug('i am JunctionObjs '+JunctionObjs );

for(Child__c j :JunctionObjs) {
    for(Child__c c: Trigger.new) {
        if(c.physition__c == j.physition__c && c.site__c== j.site__c && c.Role__c==j.role__c){
            if((c.EndDate__C >= j.StartDate__C && c.EndDate__C <= j.EndDate__C) ||
                       (c.StartDate__C >= j.StartDate__C && c.EndDate__C <= j.EndDate__C) ||
                       (c.StartDate__C >= j.StartDate__C && c.StartDate__C <= j.EndDate__C) ||
                       (c.StartDate__C < j.EndDate__C && c.EndDate__C > j.EndDate__C  )
                      )
            {
            
                   c.addError('Youre attempting to insert a record that overlaps time-wise with an existing child object');
              }
        }
    }

    }

this is working fine when inserting single records but it is not working when inserting morer than one record like using dat loader i am inserting 10 record .. please help me on this 
  • June 08, 2016
  • Like
  • 0
I have  Parent and Child two objects with lookup relation.
in parent obje we have Location  text field.
in child obj also we have Location  text field.
whenever createding paren record with Boston as Location .. it need to check in child object . if in child obj with Location Boston if we found 6 records then need to cratee 6 child records.
please help me on this.

trigger CreateChild on Parent__c (after insert) {
List<Child__c> Childs = new List<Child__c>();
for(Parent__c a : trigger.new){
Child__c Child = new Child__c ();
Child.Parent__c = a.id;
Child.Name = 'testName';
Childs.add(Child);
}
insert Childs;
}
 
  • November 03, 2015
  • Like
  • 0
Hello everyone! hope you are fine :)

Right now I´m developing a page that contains filters like the add campaign members:
User-added image
I do almost everything, but I still have problems with the filters, because the costumer wants the same behavior that have that page. I need to render the operators for the specific data type selected and if it is a look up I must allow the user to search with the magnifying glass button.

If somebody has a good idea or had a similar code, please lend me know it, I'm desperate.

Thank you so much! :)

Have a nice day!
I Have a Parent Account object in this i have check box field "No Asset exist". when ever i am trying to check the checkbox it need to show error message if Assert records exist for this Account Object. if no assert are exist for Account no error message need to show . Assert is child of Account. its shoud be bulkify need to work for multiple Accounts

Need achive by using trigger...plese help on this
  • August 26, 2015
  • Like
  • 0
I have Account as parent object. Campaigne and Candidate objects are child objects of (lookup) Account Objects. in Candidate Objects I have 3 fields first name, Last Name, Age fields. when i am treying to save Campagine record if it shoud check related candidate fields(first name, Last Name, Age) should not bank. if blank upon saveing Campagine records it should display error message that 'first name, Last Name, Age' fileds should not blank. it should work if any of candidate field is blank also...

kindly suggest me....
  • August 24, 2015
  • Like
  • 0
Hello, 

I'm trying to add a new VF page component for Custom Items to Approve on Home page. Is it possible to bring a custom field value of a custom object on to this list? 

Thanks,
Radmhya
Hi , 

I am writing single email message to code to send emails. I am dynamically constructing toAddresses to send emails. The code is working fine and sending email to toAddresses and setTargetobjectid. 

I don't want to send email to setTargetobjectId. is there any way to stop sending email to setTargetobjectid?

Thanks
Siva.

Hi

 

I'm trying to send an email via apex using an email template.

 

The problem I'm coming across is that apparently I need to set the targetObjectId, even though I'm setting the toAddresses (and the documentation states that it only requires one of these to be populated).

 

Here's the code:

 

public static void bypassEmail(String email, String offerId) {

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

EmailTemplate et = [Select Id from EmailTemplate where Name = 'Bypass / Delegated Approval'];

mail.setWhatId(OfferId);

mail.setTemplateId(et.Id);

mail.setToaddresses(new String[] {email});

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

 

I can't set a targetObjectId as it needs to be sent to an address held in a custom field. Does anyone know a way to make this work or am I going to have to do a replace on the template Body to turn the merge fields into the values?

 

Thanks

 

Steve

In Winter 11, we can now have Attachments on Tasks. I have a trigger (after update, after insert, after delete, after undelete) on Attachment which will update a custom field on Task with the Attachment Count. This works fine when adding or deleting Attachments in my Unit Tests as well as through UI on the Attachment screen if I update the attachment.

 

My issue is that if a user is on the Task "Edit" page, there is the button to "Attach File" on the Attachment section which gives you the popup to attach multiple files. When the user adds Attachments via this page the Trigger isn't firing for Attachments. I don't see the Attachment trigger even firing in the debug logs. Very odd. Anyone have any suggestions or similar experience?  Alternative solutions are accepted also.

 

This isn't a typical Master-Detail Relationship so you can't do Roll-Up Summary fields.


Thanks.

I'm encountering some rather odd behaviour with a SOQL query involving a join to a junction object.

 

I have two custom objects, Custom_a__c and Custom_b__c and a junction object for modelling a multi-multi relationship between them.

 

I have a list of ids for Custom_b__c objects that should exclude their associated Custom_a__c objects from availability.

 

The code in question is as follows:

 

List<Custom_a__c> available=[select id, Name from Custom_a__c where id NOT IN (select Custom_a__c from A_to_B_Association__c where Custom_b__c IN :excludeIds ) ];

 

 

I have a number of unit tests that check all the edge cases for this, and they are initially all working when run from the Force IDE or online.

 

However, after a period of time they will all suddenly fail.  I have plenty of debug in the unit tests that shows my test data is not changing between runs.  Even stranger, if I add an additional whitespace entry to the code above and save it back, the next run of the unit tests works fine. 

 

I also have another version of this code that carries out the same processing, but splits the SOQL into two queries, and the unit tests for this version never fail.

 

Has anybody else experienced this behaviour?  I've been looking through all the documentation and I can't see anything that is wrong with the SOQL.  I'm wondering if there are issues around using fields in the where clause of a join that aren't retrieved in the select, although that wouldn't explain why it works for a while and then goes wrong.

 

 

In Winter 11, we can now have Attachments on Tasks. I have a trigger (after update, after insert, after delete, after undelete) on Attachment which will update a custom field on Task with the Attachment Count. This works fine when adding or deleting Attachments in my Unit Tests as well as through UI on the Attachment screen if I update the attachment.

 

My issue is that if a user is on the Task "Edit" page, there is the button to "Attach File" on the Attachment section which gives you the popup to attach multiple files. When the user adds Attachments via this page the Trigger isn't firing for Attachments. I don't see the Attachment trigger even firing in the debug logs. Very odd. Anyone have any suggestions or similar experience?  Alternative solutions are accepted also.

 

This isn't a typical Master-Detail Relationship so you can't do Roll-Up Summary fields.


Thanks.