• Chris Heath
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 9
    Replies
Hi all,

I was at Dreamforce this year and attended a session about Sandbox management. In this session, the presenter was using a single-click link in their Production org to log in to their Testing org without having to enter credentials. I believe the method he was using was with Environment Hub, which apparently requires a "My Domain" to be used for single sign-on.

Is there a way to do this without having to deploy "My Domain" to all users?

I apologize if this is in the wrong Topic - I wasn't sure what it should be filed under.

Thank you in advance.
Not sure where to ask this question, as I couldn't find a relative topic here or in the Answers forum.

I have a question about History Tracking. One of my records has history tracking on a certain field. This field is shown as being changed from 625 to 626. 2 days later, the next entry in the history tracking, the same field is shown as being changed from 625 to 624. How is this possible? This means either something was tracked without the value actually changing, or the value changed without being tracked.

Tracking was not changed in between or anything like that.

Thank you in advance for the help.
I have a question about what causes referencing a formula field inside a formula to add so many characters to the compiled character count.

I have a formula(text) field (call it Formula__c) that is just
TEXT(Parent__r.Picklist_Field__c)

When I reference this in a new formula field
IF(Formula__c == "Text Value", TRUE_STUFF, FALSE_STUFF)
It seems to add around 250 more characters to the compiled character count than if I were to just do
IF(ISPICKVAL(Parent__r.Picklist_Field__c, "Text Value"), TRUE_STUFF, FALSE_STUFF)
Where do all of the extra characters come from?
 
Hello all,

I'd like to know if there is a way to open an apex:tab element in a new window when the tab header is clicked.

Currently, I have a way to link directly to a specific tab on my Visualforce page using a page parameter. However, I'm having trouble with my implementation.

My desired functionality is as such:
  • When a tab header is clicked, do not go to that page.
  • Instead, a new window will open directly to that tab header.
What I've tried so far:
onclick="window.open('/apex/pagename?tab=tabname','_blank');" disabled="true"
This causes nothing to happen when header is clicked.
 
onclick="window.open('/apex/pagename?tab=tabname','_blank');"
This causes the tab to function in the standard way - opens in the current tab without carrying over the parameters in the URL.
 
ontabEnter="window.open('/apex/pagename?tab=tabname','_blank');"
This causes the tab to open in a new window as desired, carrying over the parameters; however, the original window still loads the new tab instead of staying on the previous tab.


Any help is much appreciated.

Thank you.

 
Hello all,

I'm having a strange issue with my Eclipse Force.com IDE.

Before version 31.0 came out and since it came out, I've been working on my main computer which has version 30.0 of Apex installed. With this version, Eclipse allows me to save a file, it will go through the Building Workspace process, and it will save the file to production as long as it passes all the checks.

I have a different computer that I have installed Eclipse and API version 31.0 on today. When I attempt to save a changed file, it starts the Building Workspace process, then after a few seconds stops with no error or warning messages without saving the changes to production. 

I tried both ways with the developer console open. The first way was fine with no messages popping up, and the log showed that it was successful. When I tried to save in version 31.0, it gives me the message "Can't alter metadata in an active org".

If I switch to Work Offline mode and save the file, then right click -> Force.com -> Save to server, it proceeds to save to production. However, this is a much slower process, as I can't edit any other files while waiting for that to save.

Any suggestions to resolve this issue are much appreciated.

Thank you.
This is my third time trying to post this question... Third time's the charm?

Hello all,

I'm having an issue trying to display an image in a PDF rendered Visualforce Page. The image's URL is stored in a field on the object controlling the page.

I've tried using <apex:image...> and <img src...>. Using the actual URL works just fine and displays the image. Removing the renderAs="pdf" displays all images correctly.

Any help would be much appreciated.

Thank you!

Code snippet:

<apex:page standardController="Order__c" showheader="false" standardStylesheets="true" renderAs="PDF">

<apex:pageBlock >
<apex:image value="ImageStoredAsDocument" width="98%"/> <!-- this displays fine -->

        <img src="{!Order__c.CustomField_URL__c}" /> <!-- this does not display when rendered as PDF -->
        <img src="ActualURL" /> <!-- this displays fine -->
</apex:pageBlock>


Hello,

I'm having some trouble with my VisualForce page. What I'm trying to do is create a table that shows relevant objects and a button next to each object. When the user clicks the button, it should change to the next page and pass the Id of the object along.

Here's what I have so far...
<apex:page Controller="ReceiveInventory" showHeader="false" sidebar="false" title="Select Lot">
<div style="zoom:300%;">

<script>
    function confirmCancel() {
        var isCancel = confirm("Are you sure you wish to cancel?");
        if (isCancel) return true;  
        
        return false;
    }  
</script>

<apex:form id="all">
<apex:outputText >Please select the lot you have scanned.<br /><br /></apex:outputText>
<apex:pageBlock >
<apex:pageBlockSection title="Lots" id="LotsTable" columns="1">
<apex:pageBlockTable value="{!lots}" var="lot">
<apex:column >
    <apex:commandButton action="{!step3}" value="Choose Lot" rerender="all">
            <apex:param name="chosenLotParam" value="{!lot.Id}" assignTo="{!chosenLot}" />
    </apex:commandButton>
</apex:column>
<apex:column value="{!lot.Name}" />
<apex:column value="{!lot.Quantity__c}" />
<apex:column value="{!lot.Date_Ordered__c}" />
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true" />
</apex:form>

</div>
</apex:page>

Relevant Apex code from ReceiveInventory class:
public with sharing class ReceiveInventory {

	public String chosenLot {get;set;}
	
	public PageReference step3 () {		
		system.debug('Chosen Lot: ' + chosenLot);
		PageReference pageref3 = Page.ReceiveInventory3;
		pageref3.getParameters().put('chosenLot',chosenLot);
		return pageref3;
	}
}


I've got the page displaying the objects and the buttons fine, however, it doesn't do what expected. When I click a button, nothing seems to happen; however, looking at the debug log, I see the debug line from above ("Chosen Lot: xxxxxx"). When I click the button again, I get an error page saying "The page you submitted was invalid for your session. Please click Save again to confirm your change.".

I was trying to model my code a little bit after this link (http://bobbuzzard.blogspot.com/2011/07/passing-parameters-to-apex-method-from.html).

If anyone could chip in and suggest how I can fix this issue, it would be much appreciated.

Thanks in advance!
Hello,

I am receiving this error on a clip of test code after writing a different trigger...

"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TrainingFellowshipPatientUpdate: execution of AfterInsert caused by:
System.NullPointerException: Attempt to de-reference a null object Trigger.TrainingFellowshipPatientUpdate: line 5, column 1: []"

Account a = new Account();
a.Name = 'Test Name';
insert a;

Here is the trigger with the numbered line bolded:

trigger TrainingFellowshipPatientUpdate on Account (after insert, after update) {

for (Account pt: trigger.new) {
 
  Account old = Trigger.oldMap.get(pt.Id);
 
  if (pt.OwnerId != old.OwnerId) {
   //User u = [SELECT Id FROM User WHERE Id = :pt.OwnerId];
   
   Training_Fellowship__c tf = new Training_Fellowship__c();
  
   //if(pt.OwnerId != null) {
   tf = [SELECT Id FROM Training_Fellowship__c WHERE User__c = :pt.OwnerId LIMIT 1];
   //}
  
   if (tf != null) {
    pt.Training_Fellowship__c = tf.Id;
   } else {
    pt.Training_Fellowship__c = null;
   }
   update pt;
  }
}
}

Could somebody please help me with this?

Thank you in advance!
Hello,

I am trying to figure out a way to automatically verify that a lead email is valid.

My idea is to use a workflow to automatically email the registered email address a link that they would click. This link would then automatically update a custom field in the lead object titled "Verified".

Is a link like this a possibility? What would I need to do for this link?

Thank you in advance!
Hello,

I am trying to set up a trigger to update fields on a Lead object when said Lead is created.

What I'd like to do is set it up so that it assigns the Lead a Centile number based on the Zip Code.

I have an excel file mapping 30,000+ zip codes to these Centiles.

I cannot create a trigger that just says "If zip code is this, centile is this..." 30,000+ times because that will quickly reach the 100,000 character limit.

How would it be recommended that I complete this task?

Thank you,
Hello all,

I'm having a strange issue with my Eclipse Force.com IDE.

Before version 31.0 came out and since it came out, I've been working on my main computer which has version 30.0 of Apex installed. With this version, Eclipse allows me to save a file, it will go through the Building Workspace process, and it will save the file to production as long as it passes all the checks.

I have a different computer that I have installed Eclipse and API version 31.0 on today. When I attempt to save a changed file, it starts the Building Workspace process, then after a few seconds stops with no error or warning messages without saving the changes to production. 

I tried both ways with the developer console open. The first way was fine with no messages popping up, and the log showed that it was successful. When I tried to save in version 31.0, it gives me the message "Can't alter metadata in an active org".

If I switch to Work Offline mode and save the file, then right click -> Force.com -> Save to server, it proceeds to save to production. However, this is a much slower process, as I can't edit any other files while waiting for that to save.

Any suggestions to resolve this issue are much appreciated.

Thank you.
Hi all,

I was at Dreamforce this year and attended a session about Sandbox management. In this session, the presenter was using a single-click link in their Production org to log in to their Testing org without having to enter credentials. I believe the method he was using was with Environment Hub, which apparently requires a "My Domain" to be used for single sign-on.

Is there a way to do this without having to deploy "My Domain" to all users?

I apologize if this is in the wrong Topic - I wasn't sure what it should be filed under.

Thank you in advance.
Hello all,

I'm having a strange issue with my Eclipse Force.com IDE.

Before version 31.0 came out and since it came out, I've been working on my main computer which has version 30.0 of Apex installed. With this version, Eclipse allows me to save a file, it will go through the Building Workspace process, and it will save the file to production as long as it passes all the checks.

I have a different computer that I have installed Eclipse and API version 31.0 on today. When I attempt to save a changed file, it starts the Building Workspace process, then after a few seconds stops with no error or warning messages without saving the changes to production. 

I tried both ways with the developer console open. The first way was fine with no messages popping up, and the log showed that it was successful. When I tried to save in version 31.0, it gives me the message "Can't alter metadata in an active org".

If I switch to Work Offline mode and save the file, then right click -> Force.com -> Save to server, it proceeds to save to production. However, this is a much slower process, as I can't edit any other files while waiting for that to save.

Any suggestions to resolve this issue are much appreciated.

Thank you.
This is my third time trying to post this question... Third time's the charm?

Hello all,

I'm having an issue trying to display an image in a PDF rendered Visualforce Page. The image's URL is stored in a field on the object controlling the page.

I've tried using <apex:image...> and <img src...>. Using the actual URL works just fine and displays the image. Removing the renderAs="pdf" displays all images correctly.

Any help would be much appreciated.

Thank you!

Code snippet:

<apex:page standardController="Order__c" showheader="false" standardStylesheets="true" renderAs="PDF">

<apex:pageBlock >
<apex:image value="ImageStoredAsDocument" width="98%"/> <!-- this displays fine -->

        <img src="{!Order__c.CustomField_URL__c}" /> <!-- this does not display when rendered as PDF -->
        <img src="ActualURL" /> <!-- this displays fine -->
</apex:pageBlock>


Hello,

I'm having some trouble with my VisualForce page. What I'm trying to do is create a table that shows relevant objects and a button next to each object. When the user clicks the button, it should change to the next page and pass the Id of the object along.

Here's what I have so far...
<apex:page Controller="ReceiveInventory" showHeader="false" sidebar="false" title="Select Lot">
<div style="zoom:300%;">

<script>
    function confirmCancel() {
        var isCancel = confirm("Are you sure you wish to cancel?");
        if (isCancel) return true;  
        
        return false;
    }  
</script>

<apex:form id="all">
<apex:outputText >Please select the lot you have scanned.<br /><br /></apex:outputText>
<apex:pageBlock >
<apex:pageBlockSection title="Lots" id="LotsTable" columns="1">
<apex:pageBlockTable value="{!lots}" var="lot">
<apex:column >
    <apex:commandButton action="{!step3}" value="Choose Lot" rerender="all">
            <apex:param name="chosenLotParam" value="{!lot.Id}" assignTo="{!chosenLot}" />
    </apex:commandButton>
</apex:column>
<apex:column value="{!lot.Name}" />
<apex:column value="{!lot.Quantity__c}" />
<apex:column value="{!lot.Date_Ordered__c}" />
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true" />
</apex:form>

</div>
</apex:page>

Relevant Apex code from ReceiveInventory class:
public with sharing class ReceiveInventory {

	public String chosenLot {get;set;}
	
	public PageReference step3 () {		
		system.debug('Chosen Lot: ' + chosenLot);
		PageReference pageref3 = Page.ReceiveInventory3;
		pageref3.getParameters().put('chosenLot',chosenLot);
		return pageref3;
	}
}


I've got the page displaying the objects and the buttons fine, however, it doesn't do what expected. When I click a button, nothing seems to happen; however, looking at the debug log, I see the debug line from above ("Chosen Lot: xxxxxx"). When I click the button again, I get an error page saying "The page you submitted was invalid for your session. Please click Save again to confirm your change.".

I was trying to model my code a little bit after this link (http://bobbuzzard.blogspot.com/2011/07/passing-parameters-to-apex-method-from.html).

If anyone could chip in and suggest how I can fix this issue, it would be much appreciated.

Thanks in advance!

Does anyone know a way for my Apex code to determine the difference in being logged in as a standard Salesforce user, versus an Admin user that logged in and in their admin session logged in as that user?

 

Thanks,

David Wright, Gerson Lehrman Group