• mxravi
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 8
    Replies

Hello, 

 

I have a enahnced list view and the profile is having mass edit from lists permission enabled. Still they are not able to see the check box when the filter criteria has a OR condition. 

 

Please advice. 

Hello, 

 

We have a dependent cutom picklist field called status detail, depending on standard field status on case object. The status value NEW does not have any dependent picklist values associated with it where as other status values have one or two status detail values associated with them. When I change the status of the case to NEW manually, the status detail goes blank automatically which is correct. But when I do mass update or run a batch to change the status to NEW, the status detail of the previous status remains. It does not go blank. 

 

Any Help?

 

Thank You

 

Mrudula

Hello, 

 

We are having issue with synchronizing the sandbox and the production and need assistance in properly having a UAT for testing and have a proper version controlling tool for betterment of programming and testing. We face these issues of not having synchronized features within sandbox and production. 

 

Need Help.. 

 

Thank You

 

Mridula

  • August 03, 2012
  • Like
  • 0

I am trying to schedule a report using Apex Code. How to schedule a report using apex code? Please help. 

 

 

Thank You

 

Mrudula Ravindran

Private Sharing Settings on Case object. 

 

Case creator should be able to change a checkbox field where as case owner should not be able to do this. 

 

  • March 15, 2012
  • Like
  • 0

Case is having a private security model. 

 

Only case owners can change the data. 

 

Here there is a requirement that case creator should be able to change one of the field and not the case owner. 

 

How to go about with this? 

 

 

  • March 15, 2012
  • Like
  • 0

OWD on case is private with different sharing rules for different groups. Now I need to created an alternate case owner field and user in this field should have the same privileges as the owner. 

 

Please suggest me some way to do this. Thank You

 

 

  • February 29, 2012
  • Like
  • 0

Hello, 

 

I have a screenpop up code for a CTI integration and I am logging an activity whenever there is a call landing into salesforce though my code. But it is logging two activities at a time. Is there anyway I can get this resolved? 

 

Thank You

 

Mrudula Ravindran

  • February 13, 2012
  • Like
  • 0

I was trying to access field history from the opportunityfieldhistory object for the field name StageName. It is not pulling up any records which is weird. Am I doing anything wrong?

 

Thank You

 

Mrudula Ravindran

  • January 23, 2012
  • Like
  • 0

I would like to add the field due time in the task related list. How is it possible? Please let me know as soon as possible. 

 

Thank You

 

 

  • December 29, 2011
  • Like
  • 0

Unable to process more than one batch. Please help. Here is the code. 

 

global class ICG_Opportunity_Disp_App_Booked implements Database.Batchable<sObject> {

global string query = null;
global string clause='';
global Boolean calledByTestClass = false;
global Datetime startDate;
global Datetime endDate;
global Datetime testdate;
global list<string> op_List = new list<string>();
// global list<string> products = new list<string>();

global ICG_Opportunity_Disp_App_Booked (){
ApexClass apexClass = [SELECT Name, Id FROM ApexClass where name = 'ICG_Opportunity_Disp_App_Booked'];
//AsyncApexJob asyncApexJob =[SELECT Id, ApexClassId, CompletedDate, JobType, Status FROM AsyncApexJob where ApexClassId=:apexClass.Id order by CompletedDate desc limit 1];
setStartEndDate();
// disposition();
// productcategory();

if(startdate!=NULL && enddate!=NULL){
system.debug('startdate:'+startdate);
system.debug('enddate:'+enddate);

op_list.add('Application booked');
op_list.add('Application in progress');
op_list.add('Application Approved');
op_list.add('Entered in Net Oxygen');
op_list.add('Application Entered');
system.debug('Op_list @@@@@@@@ ' +op_list);


query = 'select accountid,Product_Category__c,StageName,createddate FROM Opportunity where createddate >=:startdate AND createddate <=:enddate AND stagename IN :op_list';

}else{
//testdate = asyncApexJob.CompletedDate;
system.debug('testdate:'+testdate);
query = 'select accountid,Product_Category__c,stageName,createddate FROM Opportunity where createddate >=:testdate AND stagename IN :op_list';
}

system.debug('Query:'+query);
}


global private void setStartEndDate(){
Job_scheduler__c jobSchedulerSettings = Job_scheduler__c.getInstance('Date_Range_Oppty');
startdate = jobSchedulerSettings.Start_date__c;
enddate = jobSchedulerSettings.End_date__c ;
}

// Global method - start

global Database.QueryLocator start(Database.BatchableContext BC){
if(calledByTestClass) {
query +=' limit 200';
System.debug('query value: ' +query );
}
system.debug('Query:'+query);
return Database.getQueryLocator(query);
}

// Global method - execute

global void execute(Database.BatchableContext BC, List<sObject> scope){
system.debug('Executing...');
Map<ID,Set<String>> AccMap = new Map<ID,Set<String>>();
Map<String,Opportunity> AccMap2 = new Map<String,opportunity>();
try{
for(Sobject s: scope){
Opportunity custPros= new Opportunity ();
custPros = (Opportunity)s;


if(!(AccMap.containsKey(custPros.accountid))) {
Set<String> temp1 = new SET<String>();
//Date temp2;
//DateTime testdate = custPros.CreatedDate;
String key = custPros.accountid+'-'+custPros.Product_Category__c;
temp1.add(custPros.Product_Category__c);
//temp2= custPros;
AccMap.put(custPros.accountid,temp1);
AccMap2.put(key,custPros);
}else {
Set<String> temp = AccMaP.get(custPros.AccountId);
//Date temp2;
String key = custPros.accountid+'-'+custPros.Product_Category__c;
temp.add(custPros.Product_Category__c);
system.debug('this is the date we have a prob'+custPros.CreatedDate.date());
//temp2 = custPros.CreatedDate.date();
AccMap.put(custPros.accountid,temp);
AccMap2.put(key,custPros);
}

}
}Catch(Exception e){
System.debug('Preparing the Key Map Logic'+e);
}
List<Customer_Product__c> cpList = new list<Customer_Product__c>();
try{
cpList= [SELECT id,customer_Prospect__c,Product__r.Product_Category_Desc__c,CreatedDate FROM Customer_Product__c where Customer_prospect__c In:AccMap.keySet() order by createddate desc];
system.debug('Size of CP list'+cpList.size());

}Catch(Exception e){
System.debug('Customer Products Query'+e);
}

set<Opportunity> Opps= new set<Opportunity>();
list<opportunity> updateopps = new list<opportunity>();

String keyMatch;

try{
for(Customer_Product__c cp: cpList){
if(AccMap.containsKey(cp.customer_prospect__c)){
keymatch = cp.customer_prospect__c+'-'+cp.product__r.product_category_desc__c;
system.debug('KeyMatch' +keymatch);
if(AccMap2.get(keymatch)!= NULL) {
Opportunity opp = AccMap2.get(keyMatch);

if(!(opps.contains(opp))){
system.debug('OPP@@@@@@@@ ' +opp);
if(cp.createddate>opp.createddate){

opp.StageName='Application Booked';
system.debug('Created Date' +cp.createddate);
opp.CloseDate = cp.CreatedDate.date();
opps.add(opp);
system.debug('Opp..............'+opps);
}
}
}
}
}

system.debug('set of opportunities' +opps);
for(opportunity unique_op: opps){
updateopps.add(unique_op);
}
system.debug('List of opportunities' +updateopps);

}Catch(Exception e){
System.debug('Looping Customer products'+e);
}


if(UpdateOpps.size() > 0){
Database.update(UpdateOpps,false);
}
}


global void finish(Database.BatchableContext BC){
// Get the ID of the AsyncApexJob representing this batch job
// from Database.BatchableContext.
// Query the AsyncApexJob object to retrieve the current job's information.

AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed,TotalJobItems, CreatedBy.Email
from AsyncApexJob
where Id =:BC.getJobId()];

// Send an email to the Apex job's submitter notifying of job completion.
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {a.CreatedBy.Email};
mail.setToAddresses(toAddresses);
mail.setSubject('Apex Opportunity update ' + a.Status);
mail.setPlainTextBody('The batch Apex job processed ' + a.TotalJobItems +' batches with '+ a.NumberOfErrors + ' failures.');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}

  • November 28, 2011
  • Like
  • 0

Does Salesforce.com support a dedicated extranet connection over Cisco VRF (bank standard) with encryption  ?

 

If so, do they have bandwidth recommendations for number of users?

 

  • November 09, 2011
  • Like
  • 0

Does Salesforce.com support a dedicated extranet connection over Cisco VRF (bank standard) with encryption? 

 If so, do they have bandwidth recommendations for number of users?

  • November 09, 2011
  • Like
  • 0

OWD on case is private with different sharing rules for different groups. Now I need to created an alternate case owner field and user in this field should have the same privileges as the owner. 

 

Please suggest me some way to do this. Thank You

 

 

  • February 29, 2012
  • Like
  • 0

I was trying to access field history from the opportunityfieldhistory object for the field name StageName. It is not pulling up any records which is weird. Am I doing anything wrong?

 

Thank You

 

Mrudula Ravindran

  • January 23, 2012
  • Like
  • 0

I would like to add the field due time in the task related list. How is it possible? Please let me know as soon as possible. 

 

Thank You

 

 

  • December 29, 2011
  • Like
  • 0

Unable to process more than one batch. Please help. Here is the code. 

 

global class ICG_Opportunity_Disp_App_Booked implements Database.Batchable<sObject> {

global string query = null;
global string clause='';
global Boolean calledByTestClass = false;
global Datetime startDate;
global Datetime endDate;
global Datetime testdate;
global list<string> op_List = new list<string>();
// global list<string> products = new list<string>();

global ICG_Opportunity_Disp_App_Booked (){
ApexClass apexClass = [SELECT Name, Id FROM ApexClass where name = 'ICG_Opportunity_Disp_App_Booked'];
//AsyncApexJob asyncApexJob =[SELECT Id, ApexClassId, CompletedDate, JobType, Status FROM AsyncApexJob where ApexClassId=:apexClass.Id order by CompletedDate desc limit 1];
setStartEndDate();
// disposition();
// productcategory();

if(startdate!=NULL && enddate!=NULL){
system.debug('startdate:'+startdate);
system.debug('enddate:'+enddate);

op_list.add('Application booked');
op_list.add('Application in progress');
op_list.add('Application Approved');
op_list.add('Entered in Net Oxygen');
op_list.add('Application Entered');
system.debug('Op_list @@@@@@@@ ' +op_list);


query = 'select accountid,Product_Category__c,StageName,createddate FROM Opportunity where createddate >=:startdate AND createddate <=:enddate AND stagename IN :op_list';

}else{
//testdate = asyncApexJob.CompletedDate;
system.debug('testdate:'+testdate);
query = 'select accountid,Product_Category__c,stageName,createddate FROM Opportunity where createddate >=:testdate AND stagename IN :op_list';
}

system.debug('Query:'+query);
}


global private void setStartEndDate(){
Job_scheduler__c jobSchedulerSettings = Job_scheduler__c.getInstance('Date_Range_Oppty');
startdate = jobSchedulerSettings.Start_date__c;
enddate = jobSchedulerSettings.End_date__c ;
}

// Global method - start

global Database.QueryLocator start(Database.BatchableContext BC){
if(calledByTestClass) {
query +=' limit 200';
System.debug('query value: ' +query );
}
system.debug('Query:'+query);
return Database.getQueryLocator(query);
}

// Global method - execute

global void execute(Database.BatchableContext BC, List<sObject> scope){
system.debug('Executing...');
Map<ID,Set<String>> AccMap = new Map<ID,Set<String>>();
Map<String,Opportunity> AccMap2 = new Map<String,opportunity>();
try{
for(Sobject s: scope){
Opportunity custPros= new Opportunity ();
custPros = (Opportunity)s;


if(!(AccMap.containsKey(custPros.accountid))) {
Set<String> temp1 = new SET<String>();
//Date temp2;
//DateTime testdate = custPros.CreatedDate;
String key = custPros.accountid+'-'+custPros.Product_Category__c;
temp1.add(custPros.Product_Category__c);
//temp2= custPros;
AccMap.put(custPros.accountid,temp1);
AccMap2.put(key,custPros);
}else {
Set<String> temp = AccMaP.get(custPros.AccountId);
//Date temp2;
String key = custPros.accountid+'-'+custPros.Product_Category__c;
temp.add(custPros.Product_Category__c);
system.debug('this is the date we have a prob'+custPros.CreatedDate.date());
//temp2 = custPros.CreatedDate.date();
AccMap.put(custPros.accountid,temp);
AccMap2.put(key,custPros);
}

}
}Catch(Exception e){
System.debug('Preparing the Key Map Logic'+e);
}
List<Customer_Product__c> cpList = new list<Customer_Product__c>();
try{
cpList= [SELECT id,customer_Prospect__c,Product__r.Product_Category_Desc__c,CreatedDate FROM Customer_Product__c where Customer_prospect__c In:AccMap.keySet() order by createddate desc];
system.debug('Size of CP list'+cpList.size());

}Catch(Exception e){
System.debug('Customer Products Query'+e);
}

set<Opportunity> Opps= new set<Opportunity>();
list<opportunity> updateopps = new list<opportunity>();

String keyMatch;

try{
for(Customer_Product__c cp: cpList){
if(AccMap.containsKey(cp.customer_prospect__c)){
keymatch = cp.customer_prospect__c+'-'+cp.product__r.product_category_desc__c;
system.debug('KeyMatch' +keymatch);
if(AccMap2.get(keymatch)!= NULL) {
Opportunity opp = AccMap2.get(keyMatch);

if(!(opps.contains(opp))){
system.debug('OPP@@@@@@@@ ' +opp);
if(cp.createddate>opp.createddate){

opp.StageName='Application Booked';
system.debug('Created Date' +cp.createddate);
opp.CloseDate = cp.CreatedDate.date();
opps.add(opp);
system.debug('Opp..............'+opps);
}
}
}
}
}

system.debug('set of opportunities' +opps);
for(opportunity unique_op: opps){
updateopps.add(unique_op);
}
system.debug('List of opportunities' +updateopps);

}Catch(Exception e){
System.debug('Looping Customer products'+e);
}


if(UpdateOpps.size() > 0){
Database.update(UpdateOpps,false);
}
}


global void finish(Database.BatchableContext BC){
// Get the ID of the AsyncApexJob representing this batch job
// from Database.BatchableContext.
// Query the AsyncApexJob object to retrieve the current job's information.

AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed,TotalJobItems, CreatedBy.Email
from AsyncApexJob
where Id =:BC.getJobId()];

// Send an email to the Apex job's submitter notifying of job completion.
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {a.CreatedBy.Email};
mail.setToAddresses(toAddresses);
mail.setSubject('Apex Opportunity update ' + a.Status);
mail.setPlainTextBody('The batch Apex job processed ' + a.TotalJobItems +' batches with '+ a.NumberOfErrors + ' failures.');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}

  • November 28, 2011
  • Like
  • 0

Hey,

 

I have been playing around with this for a day or two now and from what I have found it is definitely possible. The only issue is I am unsure exactly how the call should be made to acheive this.

 

From my understanding the only way to get Field Level Permission is through the Profile. The only way to get the Profile information is through the retrieve() function. The only way to get the specific Field Level Permissions is to ask for an object associated to the profile.

 

The retrieve function seems to use 3 parameters:

$response=$mySforceConnection->retrieve("1", "2", "3);

 

What I am trying to understanding is how I can make the call for Field Level Security to be displayed for ProfileX on ObjectY.

 

If anyone has had any experience with this please let me know.

 

Thanks!

Kyle

It appears that if a user sets the IsPrivate field to true on an Opportunity record, all workflows are bypassed when saving the record.  I can't find any help text for this field and my best guess is that it would have something to do with a sharing model.  I would NOT have guessed that it bypasses workflow rules as that seems like a great way to get bad data into your org.  What other magic is tied to this field?

We're having a problem with handling a fault coming back from a Callout.  We are getting an exception stating we received a SOAP fault (we want the fault for the purposes of testing error handling), and I'm unclear on the real problem-- is the problem with our ability to get to the fault data, or did we create a problem with the content of our fault, hence triggering the exception.

 

I have a couple of questions:

 

1) Normally, does any fault throw an exception, or would a fault appear in the response?  I haven't found anything in the documentation that explicitly explains how faults are handled.

 

2) What other methods and members are available for me to examine in the CalloutException other than the common methods (getCause()/getMessage())?  Again, the documentation is vague, and I can't find anything absolute that says CalloutException exactly what CalloutException provides (e.g. like JavaDocs for the APIs).

 

3) The exception we recieve manages to display the standard faultcode and faultstring, and the faultstring appears as what is provided by the exceptions's getMessage() method.  This gives me the sense that the fault is completely successfully parsed, or I'm getting a really poor error message from the API.  Below is the full SOAP Fault we receive.  I read another forum message indicating namespace prefixing was required for items in the detail of the message.  As far as I can tell, this is legal syntax, and other tools importing this WSDL handle faults properly: 

 

 

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:Fault xmlns:ns2="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
      <faultcode>ns2:Client</faultcode>
      <faultstring>"IGI0120:CBM5644:The Telephone Number Area Code is incorrect."</faultstring>
      <detail>
        <AAAError:AAAError xmlns="AAA" xmlns:AAAError="AAA">
          <AAAError>
            <RC>1495</RC>
            <MQQ>1</MQQ>
            <MSGNO>1495</MSGNO>
            <MSGTEXT>"IGI0120:CBM5644:The Telephone Number Area Code is incorrect."</MSGTEXT>
          </ICOMSError>
        </AAAError:ICOMSError>
      </detail>
    </ns2:Fault>
  </S:Body>
</S:Envelope>

The following formula will calculate the number of working days (inclusive) between 2 dates. A working day is defined as Monday to Friday. Even if the start or end dates are a weekend, these are accommodated.

IF(AND((5 - (CASE(MOD( Start_Date__c - DATE(1900, 1, 6), 7), 0, 0, 1, 5, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0)) < (CASE(MOD(  End_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 0)) ),
((( End_Date__c  -   Start_Date__c ) + 1) < 7)),
((CASE(MOD(  End_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 0)) - (5 - (CASE(MOD(  Start_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 5, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0)))),
(((FLOOR((( End_Date__c  -  Start_Date__c ) - (CASE(MOD(  Start_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0))) / 7)) * 5) +
(CASE(MOD(  Start_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 5, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0)) +
(CASE(MOD(  End_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 0))))


The Start Date and End Date fields are custom in the above example and can be replaced as required. If use of a DateTime field is required then the DATEVALUE function will be required.

I also recommend a simple field validation rule is added to check that the End Date is after the Start Date.
  • January 05, 2009
  • Like
  • 2