• Mahesh sfdc 5
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
how to check field data type with populated value using trigger?
we have an object called data update with below fields,
Field 1 -> Field 1 value
Field 2 -> Field 2 value

Here Field 1 will select from a picklist with label as Field 1 and api name is Field _1__c and Field 1 value is a text field.

And similarly,

Here Field 2 will select from picklist (but object level created as a check box )  with label as Field 2 and api name is Field _2__c and Field 2 value with a text field.

Now how to validate object level field datatype with populated value using trigger.?
Hi,

If Account type(picklist) is "ABC" and while creating contact ,On contact the field type(picklist) should be "Operations" if we select any other except "operations" it should through an error.

Error Message : ABC account should have a contact type operations.

Please suggest.

 
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,Messaging.InboundEnvelope envelope) {
        
        Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
        list<ProcessInstanceWorkitem> lstApprovalProcess = new list<ProcessInstanceWorkitem>();
        set<ID> setUserID = new set<ID>(); 
        String subToCompare = 'Approver';
        String strUSerID = email.plainTextBody;
        List<String> lstID = strUSerID.split('-');
        
         System.debug('lstID is:'+ lstID );
        if(email.subject.contains(subToCompare) && !lstID.isEmpty() )
        {
            for(ProcessInstanceWorkitem objProcessInstance: [Select  p.Id,
                                                             p.ProcessInstanceId,
                                                             p.ProcessInstance.Status,
                                                             p.ProcessInstance.TargetObjectId,
                                                             p.ActorId,
                                                             p.OriginalActorId,
                                                             p.CreatedById,
                                                             p.CreatedDate
                                                             from ProcessInstanceWorkitem p
                                                             where p.ProcessInstance.TargetObjectId = : lstID[0]]){
                                                                   if(lstID[1] != null && lstID[1] != ''){
                                                                    string appID = (lstID[1]).trim();
                                                                    if(appID.length() == 18 || appID.length() == 15){
                                                                        objProcessInstance.ActorId = appID; 
                                                                    }
                                                                    else if(appID.length() > 18){
                                                                        objProcessInstance.ActorId = appID.subString(0,18);
                                                                    }
                                                                }
                                                                 lstApprovalProcess.add(objProcessInstance);
                                                             }
            if(!lstApprovalProcess.isEmpty()){
                update lstApprovalProcess;
            } 
        }
        return   result;
    }
}

Could you please assit on this,
Hi Every one,

For these type mails(Subject : ATTENTION: Premier+ Success Plan Courtesy License Replacement)
what action I have to take?.

Can anyone please suggest greatly appriciate..

Thanks,
Hi All,
Any on know how to resolve First error: [QUERY_TIMEOUT] Your query request was running for too long." ?

This the query I am using in my batch class start Method:

filterDate is Today date.

query = 'SELECT Id, Case__c  FROM Case_Action__c WHERE Case__r.ClosedDate >= ' + filterDate + ' OR Case__r.ClosedDate = NULL ORDER BY Case__r.Temp_Case_Action_Date__c';

If any one help will appriciate.

Thanks,
Mahesh

 
how to check field data type with populated value using trigger?
we have an object called data update with below fields,
Field 1 -> Field 1 value
Field 2 -> Field 2 value

Here Field 1 will select from a picklist with label as Field 1 and api name is Field _1__c and Field 1 value is a text field.

And similarly,

Here Field 2 will select from picklist (but object level created as a check box )  with label as Field 2 and api name is Field _2__c and Field 2 value with a text field.

Now how to validate object level field datatype with populated value using trigger.?
Hi All,
Any on know how to resolve First error: [QUERY_TIMEOUT] Your query request was running for too long." ?

This the query I am using in my batch class start Method:

filterDate is Today date.

query = 'SELECT Id, Case__c  FROM Case_Action__c WHERE Case__r.ClosedDate >= ' + filterDate + ' OR Case__r.ClosedDate = NULL ORDER BY Case__r.Temp_Case_Action_Date__c';

If any one help will appriciate.

Thanks,
Mahesh

 
Helloo,

How is it possible to give read aces for Report folde to certain users and read write acess to certain users
 
  • September 25, 2015
  • Like
  • 0