• Stender
  • NEWBIE
  • 29 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 37
    Replies

Hello,

We have a custom email service that creates a Task from emails received (this is basically the commonly seen example of this).  However, there is a problem in that these tasks do not support the ability to actually REPLY to the email.  Looking at other tasks that are generated from sending an email from SF.com it looks like if an task has an InboundEmail record related to it, you caa then access that email and reply to it from the task.
 

My question is this:  is there a way to reply from a task created by this email service?  If so, what needs to happen?

Thanks,

Jeremy Stender

Hello,

I'll keep this short.  We are merging orgs and as part of this I want to recreate the standard objects in one org (i.e. Accounts, Contacts) and temporarily store those records in CUSTOM objects in a new org.  In order to recreate their object in the new org I was wanting to simply connect to their org using eclipse, get the object and workflow .xml files, and then simply copy and paste most of them into the new custom objects to quickly get all the fields, etc. created.  However, the starting org is PE and therefore has no API access.  Is there any app (free) or anything else out there that would let me get those xml files in order to do this?

Thanks!

Hello,

I have a complex situation that I am trying to resolve.  We have a custom email service that takes emails and plops them onto Tasks in SF.com (with the email Subject being the Subject of the task and the email Body being the task Description.  What is NOW needed is a way to send a REPLY email from this task.  I know that I can do a URL hack to a an email template and just have merge fields in the template, but I am having trouble getting the VF template to actually reference the task and pull in the Description and Subject of the task into the email fields.  
 

The issue is that the email I am sending can't be related to the Task itself (system won't let it), so instead it is related to the record the task is related to the tasks WhatID.  So basically, in the URL hack I am passing {!Task.WhatID} as the p3_lkid.  I have tried passing the relatedTo parameter directly from the   But I am thinking that the p3_lkid is the record that a VF page uses to find the "RelatedTo" record is that correct?

Is there any way I can pass the ID of the task into the URL of the custom button and then make that be the "RelatedTo" that the VF page uses?  Do I need to build a custom component/controller instead?  If so how do I reference the Task ID from the parameter, initial tests shows that the VF page doesn't like any custom parameters, does that change once this is in context of a controller?
 

Hope that all makes sense.

Jeremy Stender

Hello,

I am setting up a S2S connection that will share cases (and only SPECIFIC cases) to a partner Org (as well as Case Comments and Attachments).  The sharing of the cases will be done manually using the "External Sharing" related list as only some cases will need to be submitted to the partner.  However, I need to find a way to make some automatic updates to the case when it is first shared to the partner org, is there a way I can detect a case has been shared and make these updates using workflow?  Basically, is there a field on cases that is populated when they are shared that I can use to trigger the WF to fire or is this something I will have to write a trigger on the PartnerNetworkRecordConnection object creation to get to happen?

I have a customer email handler class that takes email messages and does some actions.  One of the things it does is create a comment on the appropriate case with the body of the email included.

The comment that it creates contains some language pertaining to the email, when it was received, the source, and a list of any attachments included.  I have set the piece the code up to automatically reduce the length of the comment to fall well within the 4000 character limit, but for some reason the code is still throwing errors when emails are received that are too long.

Here is a snippet of the code:
        string commentBody;       
        commentBody += 'Email Subject:  ' + email.subject + ' \r\n';    
        commentBody +=  ' \r\n';
        commentBody +=  'Email Body:  ' + ' \r\n';
        if(email.plainTextBody.length() > 3500){
         commentBody = commentBody + email.plainTextBody.trim().left(3500)+ '\r\n' + '\r\n' + '**NOTE: EMAIL BODY TRUNCATED IN COMMENT. SEE EMAIL ATTACHED TO CASE FOR FULL TEXT**';         
        }else{
         commentBody += email.plainTextBody.trim();
        }     
        if(fileAttachmentNames.size() > 0){
            string attachmentsText;
            attachmentsText += ' \r\n';
            attachmentsText += ' \r\n';
            attachmentsText += 'Attachments received:  ';           
            For(String faName :fileAttachmentNames){
                attachmentsText += ' \r\n';
                attachmentsText += faName;
            }
            commentBody = commentBody.left(3500 - attachmentsText.length());
            commentBody += attachmentsText;
        }
       
        newComment.CommentBody = commentBody.trim();
        insert newComment;

However, as I am using the left() method to reduce the length of the comment to 3500 characters I am still getting this error when the email is too long:
"System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Body: data value too large:"  The error is being thrown on the INSERT line, not before so it is acting like the comment body is too long or something.  Is it possible that the left() method is ignoring HTML values in the string or something?  What other methods should I use to help make sure that the comment stays within the 4000 character limit?
 

Thanks,

Jeremy Stender

I am experiencing an issue where "field history" records are not being created when fields are changed.  I am certain the fields are being tracked on the object.

I am wondering if this issue might be caused by a trigger?  I have a trigger that fires AFTER Update and makes some edits to a child master/detail record when this update happens based on the changing of these fields as well.  There ARE Roll-Up Summary fields b/w the two object so the update on the child record causes a save event on the parent record as well.

Could this secondary save event on the parent record be what is causing the history record to not be created?  I would have figured that record would be created BEFORE the trigger record actually fires. 
Hello,

We currently have an integration where a separate system logs into our SalesForce org and creates/updates records on a custom object that we then run other processes off.  A request has come in to include some other data points in the integration for use in Salesforce.  When running this by the developer/system admin for the other system they indicated that one of the new data points is in "ntext" format and that it may be long and contain images.

My question is if there is an ntext compatible field in SF (after a little digging I think ntext = nvarchar(max)?). I don't think the length will be an issue, but the images might?  Would making the field an RTF field be the best solution?

Thanks,
Jeremy Stender

Hello,

Real quick.  I am setting up a VF page that will be used to created a specific case RT selection.  I already have the override in place to go to the VF page when the specific RT is selected.  My question is whether there is a VF tag that will allow me to show the standard case page layout.  I will need to add other items to the page afterwards (hence the need for a custom page layout) but I wanted to be able to control what people see by the page layout and permissions assigned to them by profile. 
 
Also, this would mean that small changes to the page layout wouldn't need updating of code and the VF page, just the editing of standard page layouts.

Please let me know if this is possible.

Thanks,

Jeremy Stender

Hello,

 

I have some custom code written that is used to 'help' email to case.  Basically, what happens is that if an email is received for an already "Closed" case (via email-to-case) a trigger on the EmailMessage object does some evaluations and then creates a NEW child case and then creates a clone of the original EmailMessage and relates it to the new case.  I would simply just change the case the original emailMessage is related to, but we don't have access to change the ParentID field on the emailmessage record.

 

My issue is in getting the ATTACHMENTS to the orignal email and relating them to the new email.  When I query in my class for the attachments it returns 0 rows when testing and I KNOW there is an attachment on the email (the original emailMessage shows an attachment as well).  Is this because I am triggering on insert of the EmailMessage record, meaning that the attachment records have not yet been inserted?

 

If that IS the case is there any way I can get these attachments and related them to the correct cloned email at their insertion?  I just don't see how I will be able to hold the ID(s) needed in memory between the two separate DML operations that are happening (insertion of the original Email and then insertion of the Attachments)

 

Any help/ideas would be appreciated.

I have a method that I want to run in a few circumstances that will require a record be passed in and return a date.  The issue is that the sObject being passed will be different, depending on the situation. 


I want to house all of the logic in the same method as they are related AND share most of the logic itself, but I am unsure if I can cast a parameter of 'ambiguous' sObject type.

 

would the below line work?

 

public static Date gimmeTheDate(sObject s){
//logic to determine sObject type passed in and adjust logic used from there
}

 

 

Please let me know!

 

Thanks,
Jeremy Stender

Hello,

 

I have a custom email service that is used to track/update some things on cases.  I am having an issue though when parsing text from the email body.  There is a specific string I am looking for in the body that will cause certain updates to happen.  I have the code debug the email body and the two strings I am looking for are there, but the code acts like it is incorrect.

 

The frustrating thing is that this only happens when the email is sent from the original source.  I have a copy of the email and when I forward the message for testing reasons it recognizes the string just fine.  Here is the code for this piece:

string emailType;        
string emailStart = email.plainTextBody.left(325).normalizeSpace();
string initialResponseString1a = 'Thank you for approaching RateGain Customer Support';
string initialResponseString1b = 'We have received your message and logged it in our automated tracking system under the';                
system.debug('---------------------------------> emailStart:  ' + emailStart);
if(emailStart.contains(initialResponseString1a) &&  emailStart.contains(initialResponseString1b)){
    emailType = 'initial response';
}else{emailtype = 'update';}
system.debug('---------------------------------> emailType:  ' + emailtype);

 Here is the debug log of when this is from the original source:

4:00:13.217 (1217711000)|USER_DEBUG|[51]|DEBUG|---------------------------------> emailStart:  Thank you for approaching RateGain Customer Support.  We have received your message and logged it in our automated tracking system under the Ticket # 1029941. This ticket is now being assigned to a Resolution Expert who will analyze this and revert within 4 hours.  _________________________________________________________
14:00:13.217 (1217725000)|SYSTEM_METHOD_EXIT|[51]|System.debug(ANY)
14:00:13.217 (1217753000)|SYSTEM_METHOD_ENTRY|[57]|System.debug(ANY)
14:00:13.217 (1217770000)|USER_DEBUG|[57]|DEBUG|---------------------------------> emailType:  update

 

 

As you can see BOTH strings I am looking for are in there, but the code is still saying emailType = update.  However, when I send the email from my email address the debug says this:

14:24:56.206 (206699000)|USER_DEBUG|[51]|DEBUG|---------------------------------> emailStart:  Thank you for approaching RateGain Customer Support. We have received your message and logged it in our automated tracking system under the Ticket # 1029854. This ticket is now being assigned to a Resolution Expert who will analyze this and revert within 4 hours. ____________________________________________________________
14:24:56.206 (206722000)|SYSTEM_METHOD_EXIT|[51]|System.debug(ANY)
14:24:56.206 (206766000)|SYSTEM_METHOD_ENTRY|[57]|System.debug(ANY)
14:24:56.206 (206809000)|USER_DEBUG|[57]|DEBUG|---------------------------------> emailType:  initial response
14:24:56.206 (206825000)|SYSTEM_METHOD_EXIT|[57]|System.debug(ANY)

 

 

How is this possible.  Is it some sort of formatting with the email from the originating system?  How can I handle that in APEX?

 

Thanks,
Jeremy Stender

 

Hello,

 

I am attempting to implement email-to-case for one of our teams that is already using SF and has some complex business processes.  The issue is that they work from a custom "Work Orders" object, that is related to cases and about half the time they send emails to customer from THERE, not from cases.

 

This means that the 'thread ID' for the case will NOT be inserted into the email when it is sent, so a response will NOT automatically be attached to the case.  I am looking for a way to add this, but it looks like there is not way in apex to add the thread id to the email before it is sent.

 

Is my only option then a custom button?  I guess I would set up a 'dummy' email template that I could reference with a URL hack that just pulls in the thread ID automatically?  This also means that the hundred of email templates (as well as those included in WF) would have to be updated as well to include a merge field for the case's thread ID.

 

Is there an easier and more sure-fire way of doing this?

 

Thanks,
Jeremy Stender

Hello,

 

Here is my goal:  I want to be able to display an alert to users the first time they see specific records (cases in this instance).  What I am intending to do is on page load see if the case meets the primary criteria and also make sure that their user ID does not appear in a hidden field.  Then, if the above is true, the message will be displayed and then their user ID added to the hidden field and the record saved.  I want to avoid using customer controllers if possible, but if its necessary I will do it.  

 

The message is popping up fine but for some reason the record is either not being saved, or the field is not being updated before the save.

 

<apex:page standardController="Case" rendered="{!NOT(ISBLANK(Case.Pilot_Participation__c))}" id="thePage">
<apex:form rendered="{!NOT(CONTAINS(case.zTEST__c, LEFT($User.Id, 15)))}">
    <apex:actionFunction name="autosave" action="{!save}" id="autosave" >
        <apex:param assignTo="{!case.zTEST__C}" value="{!case.zTEST__c + ', ' + $User.Id}" name="testUpdate" id="testUpdate" />
    </apex:actionFunction>    
    <script type="text/javascript">
        {
            window.alert("Hello World!");                      
        }
    </script>
    <script>          
          function callAutoSave()
          {              
              autosave();
          }    
    </script>
    </apex:form>
</apex:page>

 

 

Here is what I have, please let me know how to change it (can I just assign the parameter in the java before I call the save function?

 

 

 

 

Thanks,
Jeremy Stender

Hello,

 

I am currently struggling with this problem right now.  I have a VF page on cases as an inline page.  The VF page itself does not apply to EVERY case that will use that page layout, so it is set to not display anything if the case does not meet requirements, meaning a lot of the time there is a 450 pixel blank spot in the middle of the case.

 

I have two ideas on how I might avoid this, but no idea how to go about them or if they are possible.

 

My first idea is to make the 'section' on the case DETAIL page the the VF page is in (it is the only thing in it) automatically collapse unless the case meets the same requirements that the VF has to display anything.  Is that possible using some sort of JAVA?

 

My second idea is a little trickier.  The VF page basically allows the user to perform some actions, right there in the page, quickly.  The VF page's default 'static' size is much smaller (around 150 pixels) than the potential size when performing the actions (which could be 1000+).   The stuff being displayed in the VF page is controlled using buttons.  My question is this:  Rather then having the buttons cause the VF page itself to expand and shrink as different things are being displayed, if it is possible to instead cause a window like the 'hover details' you get when hovering over an account name on a case pop up instead?  The user would need to be able to enter in details in that hover window and click buttons, but it would allow for the 'hover window' to resize accordingly and not require users to scroll in the inline VF page as well as reduce the size of the VF inline element itself, as the element would just need to be the 'static' size of the VF page.

 

Does that make sense?  Do I need to provide a mocked up screenshot of what I am trying to achieve?

 

Please let me know ANY ideas you have.

 

Thanks,
Jeremy Stender

 

 

Hello,

 

I have a psuedo-integration I am working on between our customer care department and another system's ticketing system.  The integration is actually going to be performed using emails sent using VisualForce/Apex and received via an email service.  In order for this to function the 'From' address in the email needs to be that of the inbound email service I have set up for replies.

 

The problems is that I am using an email template to send the emails to the other system.  The reason I am using the template (rather than building the message in apex) is to make it easier to update the information that will be included when emails are sent to the other system.  However,  I think this means that I can only use 'org-wide' email addresses as the from address.  Is this correct?  Are my only options at this point to 'do away' with the email templates (there are a few different ones that can be sent, depending on the situation) and just build the emails in code?

 

Any help would be appreciated.

Hello,

 

I a complex VF page and controller acting as a wizard to create new records.  The controller has 3 wrapper classes that nest inside each other.  I have a checkbox that will allow the user to 'selectAll' items from one of the nested wrapper classes.  I need to be able to pass the specific OUTER wrapper class to update the 'selected' value for all of the INNER wrapper classes on it.  Please note that this is all done in memory so I don't have a record ID to pass using the parameters function.

 

If I need to add code to help illustrate the issue I can, but thought it might muddy the waters.

 

Thanks for any help,

Jeremy Stender

Hello,

 

I have a VF page that is dynamically displaying pageblockheaders in a repeat section.  I have added a java script to auto-collapse the sections, but the problem is that the outcome of 20 or so collaped page block sections in a row is eye-watering to say the least.  I think that alternating the color of the section headers might help alleviate the problem, but I am unsure how.  Here is a stripped down version of my VF page.  At the top is where I apply the style to all of the pageblocksection headers.

 

<apex:page Controller="CustomOpportunityProductController" >
<style> .pbSubheader{ background-color: #317992 !important; border-color: none !important; } </style>   
        <apex:sectionHeader title="{!$ObjectType.Opportunity_Product__c.label} Edit" subtitle="New {!$ObjectType.Opportunity_Product__c.label}"/>
        <apex:form >        
        <apex:pageBlock title="New {!$ObjectType.Opportunity_Product__c.label}" id="mainPageBlock">
		<apex:pageBlockSection showHeader="true" title="Details" columns="1" collapsible="false" >    
        		****Intermediate code here, not important***
		</apex:pageBlockSection>
		<apex:repeat value="{!categories}" var="currentCategory" rendered="{!showProductSelection}" >
       			<apex:pageBlockSection id="categorySection" showHeader="true" title="Category:  {!currentCategory}" columns="1">
                		<apex:pageBlockTable value="{!separatedPSRecords[currentCategory]}" var="currentPSWrapper" cellpadding="4" border="1" >
					***Details of the repeat table here***
				</apex:pageBlockTable>                       
	                 </apex:pageBlockSection>
			 <script> twistSection(document.getElementById('{!$Component.categorySection}').getElementsByTagName('img')[0]) </script> ***This is the script that collapses the PBS***
                	 <br/>  ***Tried adding this to alleviate the problem, with only minimal effect.                  
		</apex:repeat>		
        </apex:pageBlock>        
        </apex:form>
</apex:page>

 Any help would be appreciated.

 

Thanks,
Jeremy Stender

Here is the short of it.  I have code trying to remove a substring from a field on deletion of a child record (the creation of each child record actually adds a string to a field on the parent record, bascially a way to have a roll-up summary of text).  Anyhow I need to REMOVE that text if a child record is deleted.  Here is the code that is giving me trouble:

		For(Opportunity o :opps){
				system.debug('Opp Looking at ------------------------------>  ' + o.ID);
			For(Opportunity_Product__c oP :oppProds){
				system.debug('Opp Prod Looking at ------------------------------>  ' + oP.ID);				
				If(oP.Opportunity_Name__c == o.ID){				
					string PSNameAndID = oP.Product_Service__r.Name;					
					system.debug('zOppProd4RuleFormulas before edit ------------------------------>  ' + o.zOppProd4RuleFormulas__c);
					system.debug('P/S Name ------------------------------>  ' + PSNameAndID);			
					o.zOppProd4RuleFormulas__c.replace(PSNameAndID, '');
					system.debug('zOppProd4RuleFormulas AFTER edit ------------------------------>  ' + o.zOppProd4RuleFormulas__c);																		
				}
			}
			oppsToUpdate.add(o);	
		}		
		update oppsToUpdate; 

 

 

Here is the output from a test of that:

36]|DEBUG|Opp Looking at ------------------------------>  006g0000001szvxAAA
11:31:47.129 (129161000)|SYSTEM_METHOD_EXIT|[36]|System.debug(ANY)
11:31:47.129 (129173000)|SYSTEM_METHOD_ENTRY|[37]|LIST<Opportunity_Product__c>.iterator()
11:31:47.129 (129207000)|SYSTEM_METHOD_EXIT|[37]|LIST<Opportunity_Product__c>.iterator()
11:31:47.129 (129217000)|SYSTEM_METHOD_ENTRY|[37]|system.ListIterator.hasNext()
11:31:47.129 (129229000)|SYSTEM_METHOD_EXIT|[37]|system.ListIterator.hasNext()
11:31:47.129 (129263000)|SYSTEM_METHOD_ENTRY|[38]|String.valueOf(Object)
11:31:47.129 (129290000)|SYSTEM_METHOD_EXIT|[38]|String.valueOf(Object)
11:31:47.129 (129303000)|SYSTEM_METHOD_ENTRY|[38]|System.debug(ANY)
11:31:47.129 (129312000)|USER_DEBUG|[38]|DEBUG|Opp Prod Looking at ------------------------------>  a1hg00000004DG4AAM
11:31:47.129 (129319000)|SYSTEM_METHOD_EXIT|[38]|System.debug(ANY)
11:31:47.129 (129349000)|SYSTEM_METHOD_ENTRY|[39]|Id.compareTo(Id, Boolean)
11:31:47.129 (129380000)|SYSTEM_METHOD_EXIT|[39]|Id.compareTo(Id, Boolean)
11:31:47.129 (129511000)|SYSTEM_METHOD_ENTRY|[42]|System.debug(ANY)
11:31:47.129 (129540000)|USER_DEBUG|[42]|DEBUG|zOppProd4RuleFormulas before edit ------------------------------>  Sabre PMS; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ
11:31:47.129 (129550000)|SYSTEM_METHOD_EXIT|[42]|System.debug(ANY)
11:31:47.129 (129566000)|SYSTEM_METHOD_ENTRY|[43]|System.debug(ANY)
11:31:47.129 (129588000)|USER_DEBUG|[43]|DEBUG|P/S Name ------------------------------>  XX Hardward Solution w/Software Licensing
11:31:47.129 (129596000)|SYSTEM_METHOD_EXIT|[43]|System.debug(ANY)
11:31:47.129 (129661000)|SYSTEM_METHOD_ENTRY|[45]|System.debug(ANY)
11:31:47.129 (129686000)|USER_DEBUG|[45]|DEBUG|zOppProd4RuleFormulas AFTER edit ------------------------------>  Sabre PMS; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ
11:31:47.129 (129695000)|SYSTEM_METHOD_EXIT|[45]|System.debug(ANY)
11:31:47.129 (129740000)|SYSTEM_METHOD_ENTRY|[37]|system.ListIterator.hasNext()
11:31:47.129 (129755000)|SYSTEM_METHOD_EXIT|[37]|system.ListIterator.hasNext()
11:31:47.129 (129793000)|SYSTEM_METHOD_ENTRY|[49]|LIST<Opportunity>.add(Object)
11:31:47.129 (129854000)|SYSTEM_METHOD_EXIT|[49]|LIST<Opportunity>.add(Object)
11:31:47.129 (129868000)|SYSTEM_METHOD_ENTRY|[35]|system.ListIterator.hasNext()
11:31:47.129 (129881000)|SYSTEM_METHOD_EXIT|[35]|system.ListIterator.hasNext()
11:31:47.129 (129942000)|DML_BEGIN|[51]|Op:Update|Type:Opportunity|Rows:1

 

 

Why is it not removing that string like it is supposed to?  I have tried setting the field to a string variable and then trying to use the replace() method, but still no dice.  What is the problem here?

 

Thanks,

Jeremy Stender

  • September 04, 2012
  • Like
  • 0

Hello,

 

I think this will be a really quick question/answer.  I have a class that is running a bunch of checks on an object while also looking for a bunch of other objects, kinda complex to describe quickly.  Anyhow as one point a List<Sold_Accounts__c>  (which is a custom object) is passed into a method that looks at fields on related (parent) records.  But those fields are returning as 'null' when I run tests (I am POSITIVE that the fields are populated when testing).  I know there is a simple way to get those fields, but for the life of me I can't remember how.  Here is the relevant bit of code:

	public static void createPDsandLITs(List<Sold_Accounts__c> sAs){
/* will end up with three lists:  soldAccountsToUpdate (this will be all that need to be updated with the PD id), pdsToBeCreated (this is a Map that we will use to create and PDs necessary and then insert their new ID into the corresponding sold Account record), and pdsToUpate (this will be BOTH PDs that need to have their billing action req'd filed updated as well as ones that need their vendor/interface fields updated) */
		
		//There are several scenarios that need to be handled, depending on the selection in the 'Billing Process' field on the P/S record.  A PD may need to be created, a LIT may need to be created
		//below are several variables that will handle these scenarios, which will all eventually be either 'discarded' or put into three lists: Sold Accounts to be updated (i.e. to insert PD record ID), PDs to be inserted(for those that always required a new PD, or those that )
		List<Sold_Accounts__c> checkForPD = new List<Sold_Accounts__c>();
		List<Sold_Accounts__c> saNeedsToCreatePD = new List<Sold_Accounts__c>();							
		//this Map<> will be used to hold a connection between a Sold Account (ID) and the PD that needs to be inserted.  This will allow us to easily add the PD's ID to the corresponding SA after insertion(creation) without having to find it (meaning less SOQL queries and therefore less chance of DML limits being hit)
		Map<ID, Participation_Detail__c> pdsToBeCreated = new Map<ID, Participation_Detail__c>();
		//this list will be a list of ALL SAs that need to have either an existing or newly created PD ID added to them, meaning the SA will then need to be updated
		List<Sold_Accounts__c> soldAccountsToUpdate = new List<Sold_Accounts__c>();		
		
		//Intermediate checks to see which 'category' each SA falls into (depending on selection made for Billing Process on P/S record).  They are added to appropriate lists and the PDs will be added later.
		
		For(Sold_Accounts__c currentSA :sAs){
			system.debug('*****************************************************--->  Current SAs PS:  ' + currentSA.Opportunity_Product_Record__r.Product_Service__c);
			system.debug('*****************************************************--->  Current SAs PS Billing Process:  ' + currentSA.Opportunity_Product_Record__r.Product_Service__r.Billing_Process__c);			
			If(currentSA.Opportunity_Product_Record__r.Product_Service__r.Billing_Process__c == 'Participation Details (PD) Only'){
				saNeedsToCreatePD.add(currentSA);				
			}
			If(currentSA.Opportunity_Product_Record__r.Product_Service__r.Billing_Process__c == 'PD and then Line Item/Subsequent Billing Tasks'){
				checkforPD.add(currentSA);
			}

******code continues*******

 

 

The debugs are coming out as null, which is incorrect.  What am I doing wrong and/or how can I easily fix this?

 

Thanks in advance for any help.

 

Jeremy Stender

 

 

Hello, I will make this quick (thanks in advance for any help).  I have two objects, Sold_Account__c (SA) and Particpation_Detail__c (PD).  Using apex I am looking at list of SA records and determining if a corresponding PDs need to be created.  However, once a PD has been inserted I need to be able to add the ID for the PD to the corresponding SA record (and then of course update all of those records as well).  Currently I am putting all of the SAs that need to have a PD created for them into a List<Sold_Account__c>, then cycling through that list ( For() ) of SAs to create a List<Participation_Detail__c> of PDs to insert (using contextual data to define values for fields on each PD, etc).  My question is how do I create and then insert the list of PDs in a way where I can keep some sort of association between them and the corresponding SA so I can then add the PD's ID to the field on the SA and the update them?

 

I know I can't be the first person to need to do this.  Any help would be appreciated.

 

 

Update:

 

Do I just need to make a 'wrapper' (or whatever the term is) class (lets call it SAtoPDConnector() )that holds both the already created SA and the 'to be created' PD.  And once the list of PDs is inserted I can basically say:

public class SAtoPDConnector{
public Sold_Accounts__c sa = new Sold_Accounts__c();
public Participation_Detail__c pd= new Participation_Detail__c();
}
List<SAtoPDConnector> connections = new List<SAtoPDConnector>();
List<Participation_Detail__c> pdToBeCreated = new List<Participation_Detail__c>();
//code code code blah blah blah to populate the two lists above appropriately (basically creating a PD and then adding it to both the list of PDs to created and then creating a new connector and setting its SA = to the corresponding SA and the PD = to the PD just added to the list to be created, then adding the class to list of 'connections') and then do this:


Insert (pdToBeCreated);
List<Sold_Accounts__c> soldAccountsToUpdate = new List<Sold_Accounts__c>();
For(SAtoPDConnector currentConnection :connections){
    Sa.Participation_Detail__c = pd.id;     soldAccountsToUpdate.add(sa);
}
Update soldAccountsToUpdate;

Is that how this is done?  I guess the real basis of this question is whether apex understands that the PD in the list to be inserted and the one in the list of 'connections'  are the same 'entity' and so once one is inserted if it will automatically assign the ID returned to the corresponding PD in the wrapper class.

 


Thanks,
Jeremy Stender

Hello,

We currently have an integration where a separate system logs into our SalesForce org and creates/updates records on a custom object that we then run other processes off.  A request has come in to include some other data points in the integration for use in Salesforce.  When running this by the developer/system admin for the other system they indicated that one of the new data points is in "ntext" format and that it may be long and contain images.

My question is if there is an ntext compatible field in SF (after a little digging I think ntext = nvarchar(max)?). I don't think the length will be an issue, but the images might?  Would making the field an RTF field be the best solution?

Thanks,
Jeremy Stender

Hello,

 

I am currently struggling with this problem right now.  I have a VF page on cases as an inline page.  The VF page itself does not apply to EVERY case that will use that page layout, so it is set to not display anything if the case does not meet requirements, meaning a lot of the time there is a 450 pixel blank spot in the middle of the case.

 

I have two ideas on how I might avoid this, but no idea how to go about them or if they are possible.

 

My first idea is to make the 'section' on the case DETAIL page the the VF page is in (it is the only thing in it) automatically collapse unless the case meets the same requirements that the VF has to display anything.  Is that possible using some sort of JAVA?

 

My second idea is a little trickier.  The VF page basically allows the user to perform some actions, right there in the page, quickly.  The VF page's default 'static' size is much smaller (around 150 pixels) than the potential size when performing the actions (which could be 1000+).   The stuff being displayed in the VF page is controlled using buttons.  My question is this:  Rather then having the buttons cause the VF page itself to expand and shrink as different things are being displayed, if it is possible to instead cause a window like the 'hover details' you get when hovering over an account name on a case pop up instead?  The user would need to be able to enter in details in that hover window and click buttons, but it would allow for the 'hover window' to resize accordingly and not require users to scroll in the inline VF page as well as reduce the size of the VF inline element itself, as the element would just need to be the 'static' size of the VF page.

 

Does that make sense?  Do I need to provide a mocked up screenshot of what I am trying to achieve?

 

Please let me know ANY ideas you have.

 

Thanks,
Jeremy Stender

 

 

I am experiencing an issue where "field history" records are not being created when fields are changed.  I am certain the fields are being tracked on the object.

I am wondering if this issue might be caused by a trigger?  I have a trigger that fires AFTER Update and makes some edits to a child master/detail record when this update happens based on the changing of these fields as well.  There ARE Roll-Up Summary fields b/w the two object so the update on the child record causes a save event on the parent record as well.

Could this secondary save event on the parent record be what is causing the history record to not be created?  I would have figured that record would be created BEFORE the trigger record actually fires. 
Hi,

I have portal users, chatter users and salesforce users.

When a user is created, I want a trigger that will check if the user is a portal user and then update the associated contact to show the contact has a portal account.  The contact object has a checkbox called "Portal_User__c" and I have put together the code below but I'm missing the section that updates the Contact field (shown below with the comment).  Can anyone suggest how I would update the contact?



trigger UpdateContactAsPortalUser on User (after insert, after update){

User uid =[select Contact from User where id=:UserInfo.getUserID()];

for (User newUser:Trigger.new){

if(uid.Contact !== null)

// Steps to set "Portal_User__c" field on Contact object to true

update uid;

}


Any assistance is appreciated.

Hello,

 

I have some custom code written that is used to 'help' email to case.  Basically, what happens is that if an email is received for an already "Closed" case (via email-to-case) a trigger on the EmailMessage object does some evaluations and then creates a NEW child case and then creates a clone of the original EmailMessage and relates it to the new case.  I would simply just change the case the original emailMessage is related to, but we don't have access to change the ParentID field on the emailmessage record.

 

My issue is in getting the ATTACHMENTS to the orignal email and relating them to the new email.  When I query in my class for the attachments it returns 0 rows when testing and I KNOW there is an attachment on the email (the original emailMessage shows an attachment as well).  Is this because I am triggering on insert of the EmailMessage record, meaning that the attachment records have not yet been inserted?

 

If that IS the case is there any way I can get these attachments and related them to the correct cloned email at their insertion?  I just don't see how I will be able to hold the ID(s) needed in memory between the two separate DML operations that are happening (insertion of the original Email and then insertion of the Attachments)

 

Any help/ideas would be appreciated.

I have a method that I want to run in a few circumstances that will require a record be passed in and return a date.  The issue is that the sObject being passed will be different, depending on the situation. 


I want to house all of the logic in the same method as they are related AND share most of the logic itself, but I am unsure if I can cast a parameter of 'ambiguous' sObject type.

 

would the below line work?

 

public static Date gimmeTheDate(sObject s){
//logic to determine sObject type passed in and adjust logic used from there
}

 

 

Please let me know!

 

Thanks,
Jeremy Stender

Hello,

 

I have a custom email service that is used to track/update some things on cases.  I am having an issue though when parsing text from the email body.  There is a specific string I am looking for in the body that will cause certain updates to happen.  I have the code debug the email body and the two strings I am looking for are there, but the code acts like it is incorrect.

 

The frustrating thing is that this only happens when the email is sent from the original source.  I have a copy of the email and when I forward the message for testing reasons it recognizes the string just fine.  Here is the code for this piece:

string emailType;        
string emailStart = email.plainTextBody.left(325).normalizeSpace();
string initialResponseString1a = 'Thank you for approaching RateGain Customer Support';
string initialResponseString1b = 'We have received your message and logged it in our automated tracking system under the';                
system.debug('---------------------------------> emailStart:  ' + emailStart);
if(emailStart.contains(initialResponseString1a) &&  emailStart.contains(initialResponseString1b)){
    emailType = 'initial response';
}else{emailtype = 'update';}
system.debug('---------------------------------> emailType:  ' + emailtype);

 Here is the debug log of when this is from the original source:

4:00:13.217 (1217711000)|USER_DEBUG|[51]|DEBUG|---------------------------------> emailStart:  Thank you for approaching RateGain Customer Support.  We have received your message and logged it in our automated tracking system under the Ticket # 1029941. This ticket is now being assigned to a Resolution Expert who will analyze this and revert within 4 hours.  _________________________________________________________
14:00:13.217 (1217725000)|SYSTEM_METHOD_EXIT|[51]|System.debug(ANY)
14:00:13.217 (1217753000)|SYSTEM_METHOD_ENTRY|[57]|System.debug(ANY)
14:00:13.217 (1217770000)|USER_DEBUG|[57]|DEBUG|---------------------------------> emailType:  update

 

 

As you can see BOTH strings I am looking for are in there, but the code is still saying emailType = update.  However, when I send the email from my email address the debug says this:

14:24:56.206 (206699000)|USER_DEBUG|[51]|DEBUG|---------------------------------> emailStart:  Thank you for approaching RateGain Customer Support. We have received your message and logged it in our automated tracking system under the Ticket # 1029854. This ticket is now being assigned to a Resolution Expert who will analyze this and revert within 4 hours. ____________________________________________________________
14:24:56.206 (206722000)|SYSTEM_METHOD_EXIT|[51]|System.debug(ANY)
14:24:56.206 (206766000)|SYSTEM_METHOD_ENTRY|[57]|System.debug(ANY)
14:24:56.206 (206809000)|USER_DEBUG|[57]|DEBUG|---------------------------------> emailType:  initial response
14:24:56.206 (206825000)|SYSTEM_METHOD_EXIT|[57]|System.debug(ANY)

 

 

How is this possible.  Is it some sort of formatting with the email from the originating system?  How can I handle that in APEX?

 

Thanks,
Jeremy Stender

 

Hello,

 

I am attempting to implement email-to-case for one of our teams that is already using SF and has some complex business processes.  The issue is that they work from a custom "Work Orders" object, that is related to cases and about half the time they send emails to customer from THERE, not from cases.

 

This means that the 'thread ID' for the case will NOT be inserted into the email when it is sent, so a response will NOT automatically be attached to the case.  I am looking for a way to add this, but it looks like there is not way in apex to add the thread id to the email before it is sent.

 

Is my only option then a custom button?  I guess I would set up a 'dummy' email template that I could reference with a URL hack that just pulls in the thread ID automatically?  This also means that the hundred of email templates (as well as those included in WF) would have to be updated as well to include a merge field for the case's thread ID.

 

Is there an easier and more sure-fire way of doing this?

 

Thanks,
Jeremy Stender

Hello,

 

Here is my goal:  I want to be able to display an alert to users the first time they see specific records (cases in this instance).  What I am intending to do is on page load see if the case meets the primary criteria and also make sure that their user ID does not appear in a hidden field.  Then, if the above is true, the message will be displayed and then their user ID added to the hidden field and the record saved.  I want to avoid using customer controllers if possible, but if its necessary I will do it.  

 

The message is popping up fine but for some reason the record is either not being saved, or the field is not being updated before the save.

 

<apex:page standardController="Case" rendered="{!NOT(ISBLANK(Case.Pilot_Participation__c))}" id="thePage">
<apex:form rendered="{!NOT(CONTAINS(case.zTEST__c, LEFT($User.Id, 15)))}">
    <apex:actionFunction name="autosave" action="{!save}" id="autosave" >
        <apex:param assignTo="{!case.zTEST__C}" value="{!case.zTEST__c + ', ' + $User.Id}" name="testUpdate" id="testUpdate" />
    </apex:actionFunction>    
    <script type="text/javascript">
        {
            window.alert("Hello World!");                      
        }
    </script>
    <script>          
          function callAutoSave()
          {              
              autosave();
          }    
    </script>
    </apex:form>
</apex:page>

 

 

Here is what I have, please let me know how to change it (can I just assign the parameter in the java before I call the save function?

 

 

 

 

Thanks,
Jeremy Stender

Hello,

 

I a complex VF page and controller acting as a wizard to create new records.  The controller has 3 wrapper classes that nest inside each other.  I have a checkbox that will allow the user to 'selectAll' items from one of the nested wrapper classes.  I need to be able to pass the specific OUTER wrapper class to update the 'selected' value for all of the INNER wrapper classes on it.  Please note that this is all done in memory so I don't have a record ID to pass using the parameters function.

 

If I need to add code to help illustrate the issue I can, but thought it might muddy the waters.

 

Thanks for any help,

Jeremy Stender

Here is the short of it.  I have code trying to remove a substring from a field on deletion of a child record (the creation of each child record actually adds a string to a field on the parent record, bascially a way to have a roll-up summary of text).  Anyhow I need to REMOVE that text if a child record is deleted.  Here is the code that is giving me trouble:

		For(Opportunity o :opps){
				system.debug('Opp Looking at ------------------------------>  ' + o.ID);
			For(Opportunity_Product__c oP :oppProds){
				system.debug('Opp Prod Looking at ------------------------------>  ' + oP.ID);				
				If(oP.Opportunity_Name__c == o.ID){				
					string PSNameAndID = oP.Product_Service__r.Name;					
					system.debug('zOppProd4RuleFormulas before edit ------------------------------>  ' + o.zOppProd4RuleFormulas__c);
					system.debug('P/S Name ------------------------------>  ' + PSNameAndID);			
					o.zOppProd4RuleFormulas__c.replace(PSNameAndID, '');
					system.debug('zOppProd4RuleFormulas AFTER edit ------------------------------>  ' + o.zOppProd4RuleFormulas__c);																		
				}
			}
			oppsToUpdate.add(o);	
		}		
		update oppsToUpdate; 

 

 

Here is the output from a test of that:

36]|DEBUG|Opp Looking at ------------------------------>  006g0000001szvxAAA
11:31:47.129 (129161000)|SYSTEM_METHOD_EXIT|[36]|System.debug(ANY)
11:31:47.129 (129173000)|SYSTEM_METHOD_ENTRY|[37]|LIST<Opportunity_Product__c>.iterator()
11:31:47.129 (129207000)|SYSTEM_METHOD_EXIT|[37]|LIST<Opportunity_Product__c>.iterator()
11:31:47.129 (129217000)|SYSTEM_METHOD_ENTRY|[37]|system.ListIterator.hasNext()
11:31:47.129 (129229000)|SYSTEM_METHOD_EXIT|[37]|system.ListIterator.hasNext()
11:31:47.129 (129263000)|SYSTEM_METHOD_ENTRY|[38]|String.valueOf(Object)
11:31:47.129 (129290000)|SYSTEM_METHOD_EXIT|[38]|String.valueOf(Object)
11:31:47.129 (129303000)|SYSTEM_METHOD_ENTRY|[38]|System.debug(ANY)
11:31:47.129 (129312000)|USER_DEBUG|[38]|DEBUG|Opp Prod Looking at ------------------------------>  a1hg00000004DG4AAM
11:31:47.129 (129319000)|SYSTEM_METHOD_EXIT|[38]|System.debug(ANY)
11:31:47.129 (129349000)|SYSTEM_METHOD_ENTRY|[39]|Id.compareTo(Id, Boolean)
11:31:47.129 (129380000)|SYSTEM_METHOD_EXIT|[39]|Id.compareTo(Id, Boolean)
11:31:47.129 (129511000)|SYSTEM_METHOD_ENTRY|[42]|System.debug(ANY)
11:31:47.129 (129540000)|USER_DEBUG|[42]|DEBUG|zOppProd4RuleFormulas before edit ------------------------------>  Sabre PMS; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ
11:31:47.129 (129550000)|SYSTEM_METHOD_EXIT|[42]|System.debug(ANY)
11:31:47.129 (129566000)|SYSTEM_METHOD_ENTRY|[43]|System.debug(ANY)
11:31:47.129 (129588000)|USER_DEBUG|[43]|DEBUG|P/S Name ------------------------------>  XX Hardward Solution w/Software Licensing
11:31:47.129 (129596000)|SYSTEM_METHOD_EXIT|[43]|System.debug(ANY)
11:31:47.129 (129661000)|SYSTEM_METHOD_ENTRY|[45]|System.debug(ANY)
11:31:47.129 (129686000)|USER_DEBUG|[45]|DEBUG|zOppProd4RuleFormulas AFTER edit ------------------------------>  Sabre PMS; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ; XX Hardward Solution w/Software Licensing - a0Jg00000008yzWEAQ
11:31:47.129 (129695000)|SYSTEM_METHOD_EXIT|[45]|System.debug(ANY)
11:31:47.129 (129740000)|SYSTEM_METHOD_ENTRY|[37]|system.ListIterator.hasNext()
11:31:47.129 (129755000)|SYSTEM_METHOD_EXIT|[37]|system.ListIterator.hasNext()
11:31:47.129 (129793000)|SYSTEM_METHOD_ENTRY|[49]|LIST<Opportunity>.add(Object)
11:31:47.129 (129854000)|SYSTEM_METHOD_EXIT|[49]|LIST<Opportunity>.add(Object)
11:31:47.129 (129868000)|SYSTEM_METHOD_ENTRY|[35]|system.ListIterator.hasNext()
11:31:47.129 (129881000)|SYSTEM_METHOD_EXIT|[35]|system.ListIterator.hasNext()
11:31:47.129 (129942000)|DML_BEGIN|[51]|Op:Update|Type:Opportunity|Rows:1

 

 

Why is it not removing that string like it is supposed to?  I have tried setting the field to a string variable and then trying to use the replace() method, but still no dice.  What is the problem here?

 

Thanks,

Jeremy Stender

  • September 04, 2012
  • Like
  • 0

Hello, I will make this quick (thanks in advance for any help).  I have two objects, Sold_Account__c (SA) and Particpation_Detail__c (PD).  Using apex I am looking at list of SA records and determining if a corresponding PDs need to be created.  However, once a PD has been inserted I need to be able to add the ID for the PD to the corresponding SA record (and then of course update all of those records as well).  Currently I am putting all of the SAs that need to have a PD created for them into a List<Sold_Account__c>, then cycling through that list ( For() ) of SAs to create a List<Participation_Detail__c> of PDs to insert (using contextual data to define values for fields on each PD, etc).  My question is how do I create and then insert the list of PDs in a way where I can keep some sort of association between them and the corresponding SA so I can then add the PD's ID to the field on the SA and the update them?

 

I know I can't be the first person to need to do this.  Any help would be appreciated.

 

 

Update:

 

Do I just need to make a 'wrapper' (or whatever the term is) class (lets call it SAtoPDConnector() )that holds both the already created SA and the 'to be created' PD.  And once the list of PDs is inserted I can basically say:

public class SAtoPDConnector{
public Sold_Accounts__c sa = new Sold_Accounts__c();
public Participation_Detail__c pd= new Participation_Detail__c();
}
List<SAtoPDConnector> connections = new List<SAtoPDConnector>();
List<Participation_Detail__c> pdToBeCreated = new List<Participation_Detail__c>();
//code code code blah blah blah to populate the two lists above appropriately (basically creating a PD and then adding it to both the list of PDs to created and then creating a new connector and setting its SA = to the corresponding SA and the PD = to the PD just added to the list to be created, then adding the class to list of 'connections') and then do this:


Insert (pdToBeCreated);
List<Sold_Accounts__c> soldAccountsToUpdate = new List<Sold_Accounts__c>();
For(SAtoPDConnector currentConnection :connections){
    Sa.Participation_Detail__c = pd.id;     soldAccountsToUpdate.add(sa);
}
Update soldAccountsToUpdate;

Is that how this is done?  I guess the real basis of this question is whether apex understands that the PD in the list to be inserted and the one in the list of 'connections'  are the same 'entity' and so once one is inserted if it will automatically assign the ID returned to the corresponding PD in the wrapper class.

 


Thanks,
Jeremy Stender

Hello,


I am having trouble writing test code for an incoming .csv file.  My functioanlity actually has two steps, one where a .csv is createed by a VF page and another that will 'consume' the data from the .csv and update records in SF.  My idea was to use the test code for the 'export' portion of the project to be used as the test blobl for the 'import' portion.  However, in my test code I can't use the 'getContent()' method for the current page to assign the export page as a blob.  Any ideas on how else to do this?

 

Thanks,
Jeremy Stender

Hello,

 

I am looking for help on creating a VF page/controller that will allow a user to create multiple records.  Right now in our Org we have a custom Opportunity_Product__c object related to Opportunities and a custom Sold_Accounts__c object related to the Opportunity_Product__c object.  The Sold Accounts record is basically a join object between the Opp Prod and Accounts.  My idea is to have a simple page with a lookup to Accounts where they will select the account with a button below that where they can add another lookup (allowing them to enter multiple accounts on a single page).  I am having trouble with the button part of this (its as far as I have gotten).  What happens when the button is clicked is instead of just adding another lookup field, it is 'refreshing' the page and giving a required field error on the initial field.  If I populate the initial field and click the button, the page refreshes with two lookup fields but then it removes the value from the first.  What am I doing wrong?  Here is my code:

<apex:page Controller="massCreateSoldAccountsController">
    <apex:form >
        <apex:pageBlock title="Mass Create Sold Accounts" mode="edit">
            <apex:repeat value="{!AccountLookups}" var="currentSoldAccount">
                <apex:inputField value="{!currentSoldAccount.Account__c}"/>           
            </apex:repeat>
            <apex:commandButton action="{!setAddOneToNumberOfAccounts}" value="Add Account" id="addAccountButton"/>
        </apex:pageBlock>
   </apex:form>
</apex:page>

 

 

 

 

 

public class massCreateSoldAccountsController {
       
        public Integer numberOfAccounts = 1;           
        public List<Sold_Accounts__c> soldAccountsToInsert = new List<Sold_Accounts__c>();      
        public void AddOneToNumberOfAccounts(){
                numberOfAccounts++;
        }
       
        public Opportunity_Product__c getOppProdSINGLE(){
                return [Select ID, Name, Product_Service__r.Name, Opportunity_Name__c FROM Opportunity_Product__c WHERE ID = : (ApexPages.currentPage().getParameters().get('oppProdID')) ];
        }
       
        //below method will return the list of Opportunity Products to the VF page.  This can be used to create the 'checkboxes'
        public List<Opportunity_Product__c> getOppProdsMULTI(){          
                Id oppID = (ApexPages.currentPage().getParameters().get('oppID'));
                List<Opportunity_Product__c> oppProducts = [Select ID, Pricing_Record__c, Product_Service__c, Product_Service__r.Name from Opportunity_Product__c WHERE Opportunity_Name__c = :oppID];
                If(oppProducts.size() == 0){
                        ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'This Opportunity has no related Opportunity Product records.  Please create all appropriate Opportunity Product records before continuing.'));
                        return null;                   
                } else{
                        return oppProducts;    
                }
               
        }
        /*public void setSoldAccountstoInsertSINGLE(){
                ID oppProdID = (ApexPages.currentPage().getParameters().get('oppProdID'));             
        }*/
        public List<Sold_Accounts__c> getAccountLookups(){
                List<Sold_Accounts__c> soldAccounts = new List<Sold_Accounts__c>();
                For(Integer i = 0; i < numberOfAccounts; i++){
                                Sold_Accounts__c soldAccount = new Sold_Accounts__c();
                                soldAccount.Add(soldAccount);
                }
                return soldAccountsTest;
        }
}

 

 

 

Thanks again for any help!

 

Jeremy Stender

Hello, I have a question that I thought somebody on here might be able to help me with.  Let me preface this by saying that I am completely new to Apex/Trigger coding in SF and how it is set up.  But I AM able to see code already constructed and decipher how it is working (I have some programming backgroung but no Apex/SF specific coding background).  Anyhow, to the question.  I am trying to create a field that will list the "Last Activity" for a case.  This is available already on Contacts and Accounts (I believe) but not on Cases.  I am sure I am not the first to deal with this issue and I am also pretty sure that the trigger for this would be very general (i.e. not Org specific) and the only differences might be what one would call an "Activity".  I really only want it to reflect the same as it does on a contact in regards to e-mails sent and received that are related to a specific case.  If someone could provide me with a set of basic trigger code for this I would be much obliged.  Also, I assume the trigger would reside on the activities object, correct?  Thanks in advance!

 

Jeremy Stender

  • September 09, 2011
  • Like
  • 0

Hi

 

I want a pageblock section to be collapsed by default at the time of page loading. I tried using solutions posted on our discussion board but none of them are working correctly. Please post the correct approach.

 

thanks

Is it possible to control which page layout Sections (detail view) are open or closed? have this defined from a picklist field

 

Not using VF, the standard page layout.

 

For instance I have a custom object page, there is a pick list with values of = Stage 1, Stage 2, Stage3, Stage 4 etc

I have Page Layout Sections that are named correspondingly (Stage 1, Stage 2, Stage 3 etc)

 

I would like to know if anyone has done or knows of the technology to use to control - if picklist = Stage 2, then All sections will be closed except Stage 2 will be open.

 

I've searched and can only find some info, on interaction with VF pages and Javascript. to achieve this.

 

Are we able to control the open or close state of a page layout section, using a standard page layout  (not VF page)? Can we use Javascript (or some other solution) to some how, read a field (even if displayed on the page) and then control which sections are opened or closed?

 

This would really be great .