• AK123
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies

Hello, we are experiencing something very odd with our salesforce. Certain users using Chrome will have excessive white space in their page layout, while other users using Chrome or other browsers do not experience this issue. You can ignore the black boxes, the white space in the red box is the issue. Has anyone experienced this before and know of a fix? 

 

 

 

It also seems to happens after one of our VF fields, could be related

 

Thanks!

  • November 14, 2013
  • Like
  • 0

Hello, I am trying to write code for a custom button using Java, please see below:

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 

var caseObj = new sforce.SObject("Lead"); 
caseObj.Id = '{!Lead.Id}'; 
caseObj.Rating = '2'; 
caseObj.Customer_Interest_Level__c= "Interested to learn more about FX"; 
caseObj.ATL__c= '{!User.Id}';


if (caseObj.ATL_Pass__c==null) {
caseObj.ATL_Pass__c='{!User.Id}'} 

var result = sforce.connection.update([caseObj]); 

if (result[0].success=='false') { 
alert(result[0].errors.message); 
} else { 
location.reload(true); 
}

 

Basically I am trying: if ATL_pass__c = null, then update this field to the current user ID. If not, leave untouched. The conditional portion of this (in red above) does not seem to be working. It is changing the value of ATL_pass__c regardless if it is null or not. Please advise.

 

Thanks!

  • October 24, 2013
  • Like
  • 0

Hello, I am trying to write code for a custom button using Java, please see below:

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 

var caseObj = new sforce.SObject("Lead"); 
caseObj.Id = '{!Lead.Id}'; 
caseObj.Rating = '2'; 
caseObj.Customer_Interest_Level__c= "Interested to learn more about FX"; 
caseObj.ATL__c= '{!User.Id}';


if (caseObj.ATL_Pass__c==null) {
caseObj.ATL_Pass__c='{!User.Id}'} 

var result = sforce.connection.update([caseObj]); 

if (result[0].success=='false') { 
alert(result[0].errors.message); 
} else { 
location.reload(true); 
}

 

Basically I am trying: if ATL_pass__c = null, then update this field to the current user ID. If not, leave untouched. The conditional portion of this (in red above) does not seem to be working. It is changing the value of ATL_pass__c regardless if it is null or not. Please advise.

 

Thanks!

  • October 17, 2013
  • Like
  • 0

Hello, I am writing a trigger that displays information from the most recently created opportunity on the account page. The fields are dynamic, meaning anytime theres an account update or insert, it looks for the most recently created opportunity, and grabs the necessary info. The trigger works fine, except when you move an opportunity. When moving an opporuntiy,  the information displayed on the account page is from the newly moved opportunity (which is incorrect). It does trigger an account update, but it still shows the old/incorrect data. My thought was to write a second after update trigger. Below is the error message i receive when attempting to update any field on the account page. Seems to be an iterative loop problem. 

 

Error:Apex trigger DynamicOppDataOnAcctPageafter caused an unexpected exception, contact your administrator: DynamicOppDataOnAcctPageafter: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 001g0000006lRjZAAU; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, DynamicOppDataOnAcctPageafter: maximum trigger depth exceeded Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ]: []: Trigger.DynamicOppDataOnAcctPageafter: line 17, column 1

 

I have included both the before and after triggers below, any help/advice would be greatly appreciated

 

Before Trigger

 

trigger DynamicOppDataOnAcctPageBefore on Account (before insert, before update) {
 
Account acct = Trigger.new[0];
String accountid = acct.id;
String OpQ = null;
String OpA = null;
 
for (Opportunity opp: [SELECT id, security_question__c, security_answer__c
                                        FROM opportunity
                                        WHERE (AccountID = :accountid) AND (recordtypeid = '01230000000000K'  OR recordtypeid = '012600000009I8D'
                                        OR recordtypeid = '012600000009FS0' OR recordtypeid = '01230000000000L')
                                        ORDER BY user_created_date__c ASC
                                        ]){
                                       
              acct.Security_question_opp__c  =  opp.security_question__c ;
              acct.Security_answer_opp__c  =  opp.security_answer__c   ;                    
              } 
}

 

After Trigger

 

 

trigger DynamicOppDataOnAcctPageAfter on Account (after update) {

Account acct = Trigger.new[0];
String accountid = acct.id;


   Map<Id, Account> accountMap = new Map<Id, Account>();
   for (Opportunity opp: [SELECT id, accountid, security_question__c, security_answer__c FROM opportunity
      WHERE (AccountID = :accountid) AND (recordtypeid = '01230000000000K'  OR recordtypeid = '012600000009I8D'
      OR recordtypeid = '012600000009FS0' OR recordtypeid = '01230000000000L')
      ORDER BY user_created_date__c ASC]){

      Account acct1 = new Account(Id=opp.AccountId, Security_Question_opp__c = opp.security_question__c, security_Answer__c = opp.Security_Answer__c);
      AccountMap.put(acct1.Id, acct1);
   } 
   if(accountMap.size()>0) {
       update accountMap.values();
   }

  Thanks Again!

 

  • September 20, 2013
  • Like
  • 0

Hello, I am writing a trigger that displays information from the most recently created opportunity on the account page. The fields are dynamic, meaning anytime theres an account update or insert, it looks for the most recently created opportunity, and grabs the necessary info. The trigger works fine, except when you move an opportunity. When moving an opporuntiy,  the information displayed on the account page is from the newly moved opportunity (which is incorrect). It does trigger an account update, but it still shows the old/incorrect data. My thought was to add an after update condition, but I get the below error:

 

trigger DynamicOppDataOnAcctPageBefore on Account (before insert, before update) {

 

Account acct = Trigger.new[0];

String accountid = acct.id;

String OpQ = null;

String OpA = null;

 

for (Opportunity opp: [SELECT id, security_question__c, security_answer__c

                                        FROM opportunity

                                        WHERE (AccountID = :accountid) AND (recordtypeid = '01230000000000K'  OR recordtypeid = '012600000009I8D'

                                        OR recordtypeid = '012600000009FS0' OR recordtypeid = '01230000000000L')

                                        ORDER BY user_created_date__c ASC

                                        ]){

                                       

              acct.Security_question_opp__c  =  opp.security_question__c ;

              acct.Security_answer_opp__c  =  opp.security_answer__c   ;                    

              } 

}

 

Error when adding the after update piece, the line bolded above is line 15:

 

Error:Apex trigger DynamicOppDataOnAcctPageBefore caused an unexpected exception, contact your administrator: DynamicOppDataOnAcctPageBefore: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.DynamicOppDataOnAcctPageBefore: line 15, column 1

 

Any help would be greatly appreciated.

 

Thanks!

  • September 18, 2013
  • Like
  • 0

Hello, 

 

    We currently use Inbound Email services for our SF org, integrating various Outlook inboxes into SF as a custom object. I am having some difficulty collecting the inbound email headers from the email itself. If it helps, I am looking for a way to read the created date/time of email, which is contained in "email.headers", but I am getting errors try to capture and then display this information in SF. Any assistance or sample code will greatly be appreciated.

 

Thanks!

  • June 24, 2013
  • Like
  • 1

Hello, I am trying to create a custom button that will create a child object record from a parent object.  I am trying to create a button that will create a new CHILD record, off of a custom button found on the PARENT record list view. PARENT__c and CHILD__c are both custom objects, master-detail relationship.  Below is the code i compiled, but am having no luck. Any assistance would be greatly appreaciated.

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS( $ObjectType.PARENT__C)};
var UpdateID = '{!PARENT__C.Id}';
var c= new sforce.SObject("CHILD__C");
c.PARENT__C = UpdateID;
c.Name = new Date ();
c.Details__c = 'No New Update';
var result = sforce.connection.create(records);
window.location.reload();

if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}

 

THANKS

  • April 24, 2013
  • Like
  • 0

Hello All,

 

    I am creating a custom button that will create a lead automatically from my custom object, pass over field values to the new created lead from the custom object, and link the newly created lead to the original custom object. I am having trouble with the third part. Basically. I need to store the ID of the newly created Lead, so it can be connected to my custom object, please see below:

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

    var lead = new sforce.SObject("Lead");    
    var email = '{!Client_Email__c.From_Email_Address__c}';
    var name = '{!Client_Email__c.From__c}';
    var emaiIID=  '{!Client_Email__c.Id}';    
    lead.email=email;
    lead.company = name;
    lead.lastname = name;  
    var result = sforce.connection.create([lead]);  

    var leadID = '{!Lead.Id}'   ;         

    var clientemail = new sforce.SObject("Client_Email__c")
    clientemail.ID = emaiIID
    clientemail.Lead__c = leadID
    var result = sforce.connection.update([clientemail]);


    if (result[0].success=='false') {
         alert(result[0].errors.message);
    } else {
         location.reload(true);
    }

 

  The code highlighted in bold is causing issues because it is being passed a null value. The lead ID is assigned after I create the object, but i cannot seem to find a way to reference the newly created lead. Any help or guidance on this would be greatly appreciated.

 

Many Thanks!

  • July 18, 2012
  • Like
  • 0

Hello All,

 

   I currently set up an Inbound Email service/class that parses through XML attachments and maps the corresponding info to fields in a custom object.,the XML attachments come via email. My question to the community is if its possible for Salesforce/APEX to parse through encrypted XML attachments, PGP encryption. Please let me know your thoughts, thanks

 

~Thanks

  • February 14, 2012
  • Like
  • 0

Hello, 

 

    We currently use Inbound Email services for our SF org, integrating various Outlook inboxes into SF as a custom object. I am having some difficulty collecting the inbound email headers from the email itself. If it helps, I am looking for a way to read the created date/time of email, which is contained in "email.headers", but I am getting errors try to capture and then display this information in SF. Any assistance or sample code will greatly be appreciated.

 

Thanks!

  • June 24, 2013
  • Like
  • 1

Hello, I am trying to write code for a custom button using Java, please see below:

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 

var caseObj = new sforce.SObject("Lead"); 
caseObj.Id = '{!Lead.Id}'; 
caseObj.Rating = '2'; 
caseObj.Customer_Interest_Level__c= "Interested to learn more about FX"; 
caseObj.ATL__c= '{!User.Id}';


if (caseObj.ATL_Pass__c==null) {
caseObj.ATL_Pass__c='{!User.Id}'} 

var result = sforce.connection.update([caseObj]); 

if (result[0].success=='false') { 
alert(result[0].errors.message); 
} else { 
location.reload(true); 
}

 

Basically I am trying: if ATL_pass__c = null, then update this field to the current user ID. If not, leave untouched. The conditional portion of this (in red above) does not seem to be working. It is changing the value of ATL_pass__c regardless if it is null or not. Please advise.

 

Thanks!

  • October 17, 2013
  • Like
  • 0

Hello, I am writing a trigger that displays information from the most recently created opportunity on the account page. The fields are dynamic, meaning anytime theres an account update or insert, it looks for the most recently created opportunity, and grabs the necessary info. The trigger works fine, except when you move an opportunity. When moving an opporuntiy,  the information displayed on the account page is from the newly moved opportunity (which is incorrect). It does trigger an account update, but it still shows the old/incorrect data. My thought was to write a second after update trigger. Below is the error message i receive when attempting to update any field on the account page. Seems to be an iterative loop problem. 

 

Error:Apex trigger DynamicOppDataOnAcctPageafter caused an unexpected exception, contact your administrator: DynamicOppDataOnAcctPageafter: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 001g0000006lRjZAAU; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, DynamicOppDataOnAcctPageafter: maximum trigger depth exceeded Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ] Account trigger event AfterUpdate for [001g0000006lRjZ]: []: Trigger.DynamicOppDataOnAcctPageafter: line 17, column 1

 

I have included both the before and after triggers below, any help/advice would be greatly appreciated

 

Before Trigger

 

trigger DynamicOppDataOnAcctPageBefore on Account (before insert, before update) {
 
Account acct = Trigger.new[0];
String accountid = acct.id;
String OpQ = null;
String OpA = null;
 
for (Opportunity opp: [SELECT id, security_question__c, security_answer__c
                                        FROM opportunity
                                        WHERE (AccountID = :accountid) AND (recordtypeid = '01230000000000K'  OR recordtypeid = '012600000009I8D'
                                        OR recordtypeid = '012600000009FS0' OR recordtypeid = '01230000000000L')
                                        ORDER BY user_created_date__c ASC
                                        ]){
                                       
              acct.Security_question_opp__c  =  opp.security_question__c ;
              acct.Security_answer_opp__c  =  opp.security_answer__c   ;                    
              } 
}

 

After Trigger

 

 

trigger DynamicOppDataOnAcctPageAfter on Account (after update) {

Account acct = Trigger.new[0];
String accountid = acct.id;


   Map<Id, Account> accountMap = new Map<Id, Account>();
   for (Opportunity opp: [SELECT id, accountid, security_question__c, security_answer__c FROM opportunity
      WHERE (AccountID = :accountid) AND (recordtypeid = '01230000000000K'  OR recordtypeid = '012600000009I8D'
      OR recordtypeid = '012600000009FS0' OR recordtypeid = '01230000000000L')
      ORDER BY user_created_date__c ASC]){

      Account acct1 = new Account(Id=opp.AccountId, Security_Question_opp__c = opp.security_question__c, security_Answer__c = opp.Security_Answer__c);
      AccountMap.put(acct1.Id, acct1);
   } 
   if(accountMap.size()>0) {
       update accountMap.values();
   }

  Thanks Again!

 

  • September 20, 2013
  • Like
  • 0

Hello, I am writing a trigger that displays information from the most recently created opportunity on the account page. The fields are dynamic, meaning anytime theres an account update or insert, it looks for the most recently created opportunity, and grabs the necessary info. The trigger works fine, except when you move an opportunity. When moving an opporuntiy,  the information displayed on the account page is from the newly moved opportunity (which is incorrect). It does trigger an account update, but it still shows the old/incorrect data. My thought was to add an after update condition, but I get the below error:

 

trigger DynamicOppDataOnAcctPageBefore on Account (before insert, before update) {

 

Account acct = Trigger.new[0];

String accountid = acct.id;

String OpQ = null;

String OpA = null;

 

for (Opportunity opp: [SELECT id, security_question__c, security_answer__c

                                        FROM opportunity

                                        WHERE (AccountID = :accountid) AND (recordtypeid = '01230000000000K'  OR recordtypeid = '012600000009I8D'

                                        OR recordtypeid = '012600000009FS0' OR recordtypeid = '01230000000000L')

                                        ORDER BY user_created_date__c ASC

                                        ]){

                                       

              acct.Security_question_opp__c  =  opp.security_question__c ;

              acct.Security_answer_opp__c  =  opp.security_answer__c   ;                    

              } 

}

 

Error when adding the after update piece, the line bolded above is line 15:

 

Error:Apex trigger DynamicOppDataOnAcctPageBefore caused an unexpected exception, contact your administrator: DynamicOppDataOnAcctPageBefore: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.DynamicOppDataOnAcctPageBefore: line 15, column 1

 

Any help would be greatly appreciated.

 

Thanks!

  • September 18, 2013
  • Like
  • 0