• Mike Summitt
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 17
    Replies

I need to add a rollup summary to the Zuora subscription object.  When I attempt to create it, the option is disabled, with a hover message saying that it can't be used because this object isn't the master in a master-detail relationship.

I know that this message is incorrect because 1) there are no master-detail fields in the subscription object, and 2) I've successfully created a rollup summary in the account object using the opportunity object, and there is no master-detail relationship between them, or any master-detail field in opportunity.

I can't add a master-detail relationship because not all the records in the table being rolled up are related to subscriptions.

Is there any way to change the forms authentication login screen to force chimera to recognize it and understand how to log in?

Is it possible to add tags or labels or invisible text to the logon.aspx page of a site that would cause chimera to find the logon page and log on, when it otherwise can't find the log on page or can't log on using it?
 
How can I code a class so that it will have permission to add and delete contact objects, even when the invoking user doesn't, and not use "without sharing" (SalesForce security review won't allow it)?

The class is an entry point in a managed package, and must pass security review, so "without sharing" is not allowed, neither is omitting the sharing clause. The class sends emails using templates, which requires each addressee to have a Contact object. Therefore, it must create temporary Contact objects and then delete them after the email is sent.

We're building a package which, among other things, sends emails.  We want to use a specific OrgWideEmailAddress as the sender of the email if, and only if, the currently logged on user's profile allows him/her access to that OrgWideEmailAddress, otherwise fall back and use the user's email address as the From.

We've encountered 2 problems.

In the administration menu, you can set an OrgWideEmailAddress to allow all profiles, or only certain profiles.  But if you select 2 profiles out of the list, or all of them but one, and save, it pretends to save your input but the list of OrgWideEmailAddress object will show "No Access" for that OrgWideEmailAddress.  Only if you select a single profile and save will the list show that the selected profile now has access.

In the code, the statement "SELECT Id, DisplayName, Address FROM OrgWideEmailAddress" returns all records, whether the currently logged on user's profile is allowed to use them or not.  There is no field, array, or related record that can be queried to determine whether an OrgWideEmailAddress is usable by the current user's profile.  If you attempt to send an email using try/catch, no exception is generated, but the email is not sent, and there's no mechanism to determine whether the email was refused due to non-permitted use of orgWideEmailAddress.

Does anyone have a strategy for getting around this problem?

Created new partial copy sandbox (CS26) because old sandbox (CS4) had undeployed mods in it that kept going to production by accident.  Later refreshed CS26 and it MOVED to CS4!!!

Do I have to delete ALL sandboxes before creating one in order to be sure that sandboxes with bad code won't be used?  Why did it merge them?  Why is there no option to delete the partial copy sandbox?
 
After creating sandbox and copying licenses, cannot point to Marketo sandbox, says "Diagnostics Test Failed! Required fields are not configured in:" but then list is blank, just shows a bullet and no text.  Has anyone else had this issue?
If I populate a SalesForce Offline Edition, and then I purge 100,000 archived activity records online, and then later I do a sync, will the offline edition lose 100,000 records as well, or will the offline version put back the 100,000 records I just purged?

What I'd like to do is use offline edition to maintain a data mining environment, and keep copies of old activities without paying SalesForce a bunch of money for extra disk space.  If it could also be used in the office when the internet is down, and sync back (without putting back activity records), that would be even better.

Is there a "codeless" way to create a related list using an external ID column rather than the SFID and standard lookup?

Example: I have an object rateplan which is regularly replicated into SF from an external source, and its SFIDs change every time this is done, becuase it deletes and re-adds each record.  The rateplan object also has a UPC column in it, defined as an external ID.  I have another object specialorder, which also has a column named UPC, but it's just a plain value column with size and type the same as the external ID in rateplan.  On the rateplan page, I want to put a related list of specialorders.

My first choice would be to do this declaratively, with no code, second choice would be to create a class/controller for just the related list, and have it appear among the other related lists in the page designer.  Last choice would be to have to rewrite the entire master page.

I want to create a related list to drop onto a page, based on an indirect relationship.

Example: I have an object subscription and a second object subscriptiondetail, which has a lookup (not a master/detail) to subscription.  The subscriptiondetail also contains a lookup to the standard SF object Product.  I want to define a related list and put it on the product page, containing subscriptions that have subscriptiondetail records that relate to the product.  I don't want a related list of subscriptiondetails, the related list will need to contain fields from the subscription object, so it needs to be a related list of subscriptions, but the actual relationship is a level lower in subscriptiondetail.

Is this possible by creating a controller or class for just the related list, rather than replacing the entire parent page with a custom version?

I had a pair of triggers that fired from Zuora 360 doing inserts or updates to its productrateplan or subscription objects. Zuora's replication strategy often deletes and re-adds these records, causing their SFID to change.  As a result, the triggers had a lot of work to do finding other references to the object and correcting them.  It couldn't be done with workflow because there are no master/detail relationships.

Both triggers started occasionally generating SOQL limit errors (the dreaded 101) even though they were fully bulkified.  To stop this, I moved a segment of bulkified logic into an Apex method marked with @future, so that the "key fixup" would be in a different scope and wouldn't hit the limit.

Unfortunately, the update to productrateplan sometimes causes changes to subscription records, which then cause the subscription trigger to fire.  Even though the @future method didn't directly call another @future method, but only did an update which fired a trigger which called a @future method, SF still detected it and blocked the attempt.  Also, I'm now getting other error messages, including "First exception on row 0 with id a1si0000002Gf3xAAC; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []".

Does anyone have suggestions on how else this could be implemented?  The changes are all "fixups", the specified SFID has been nulled by Zuora's delete operation, now the records must be found using alternate keys and the restoring the new SFID.

If I create a workflow using the basic workflow tool or the process builder, then later it becomes too complex to manage there, can I edit the workflow using Visual Workflow, even though I didn't create it there?
We have a business rule that contact roles on an account or a case must be contacts that actually belong to that account, not cross linked from some other account.  So I wrote a trigger....
trigger EditAccountContactRoleSameAccount on AccountContactRole (before insert, before update)
{
    TriggerControl__c thisTrigger = Utilities.GetTriggerControl('EditAccountContactRoleSameAccount', false, false, false);
    if (thisTrigger.Enabled__c) {
        Set<Id> theContacts = new Set<Id>();
        for (AccountContactRole acr : Trigger.new) {
        if (!theContacts.contains(acr.ContactID)) {
            theContacts.add(acr.ContactID);
        }
        Map<Id, AccountContactRole> ContactsAccounts = new Map<Id, AccountContactRole>()
        for (AccountContactRole acr : SELECT Id, ContactID, Contact__r.AccountID 
                                      FROM AccountContactRole
                                      WHERE ContactID IN : theContacts]) {
            ContactsAccounts.add(acr.Id, acr);    
        }
        for (AccountContactRole tacr : Trigger.new) {
            for (Id key : ContactsAccounts.keyset()) {
                if (ContactsAccounts.get(key).ContactID == tacr.ContactID) {
                    if (ContactsAccounts.get(key).AccountID != tacr.AccountID) {
                        if (thisTrigger.Error__c) {
                            tacr.addError('Attempt to cross-link Contact to ' + tacr.AccountID + ', belongs to ' + ContactsAccounts.get(key).AccountID);
                        }
                    }
                }
            }
        }
    }
}

You can probably guess how far I got with that...

Error    1    SObject type does not allow triggers: AccountContactRole    C:\Projects\SalesForce\Broker\Triggers\EditAccountContactRoleSameAccount.trigger    1    1    

Is there another way I can enforce this rule?

Thanks.

I have an immensely complicated VF page, with some special behavior in one section.  To get the special behavior to work, I had to litter the layout with outputpanels and actionregions (thanks to Henk Henk for his help with that).  Now it behaves correctly, but the active section has crap formatting - captions won't right justify, data fields won't line up with the rest of the form.

I've tried class and styleclass and labelstyleclass and datastyleclass and inserting spans and divs and ths - nothing will fix the formatting.  I don't dare touch the outputpanels themselves because the behavior will stop working.  Here's a portion of the page:

<apex:page showHeader="true" sidebar="true" standardController="TrialSubscription__c" extensions="NewWithTrial">
    <apex:form id="TheForm">
        <apex:actionFunction name="ChangeCloud" action="{!changeCloud}" rerender="CloudSection" status="cloudChangeStatus" />
        <apex:actionFunction name="ChangeProduct" action="{!changeProduct}" rerender="ProductSection, ConferencingSection, StorageSection, CallingSection" status="productChangeStatus" />
        <apex:actionFunction name="ChangeCalling" action="{!changeCalling}" rerender="CallingSection" status="callingChangeStatus" />
        <apex:actionfunction name="ChangeGenerate" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
        <apex:pageBlock mode="edit">
            <apex:pageBlockSection columns="2" title="Lead Information">
                <apex:inputField value="{!theLead.FirstName}" required="true" />
                <apex:inputField value="{!theLead.Phone}" required="true" />
                <apex:inputField value="{!theLead.LastName}" required="true" />
                <apex:inputField value="{!theLead.Email}" required="true" />
                <apex:inputField value="{!theLead.Company}" required="true" />
                <apex:inputField value="{!theLead.LeadSource}" />
                <apex:inputField value="{!theLead.Street}" />
                <apex:inputField value="{!theLead.nefsis_IP__c}" />
                <apex:inputField value="{!theLead.City}" />
                <apex:outputText value=" " />
                <apex:inputField value="{!theLead.State}" />
                <apex:outputText value=" " />
                <apex:inputField value="{!theLead.PostalCode}" />
                <apex:outputText value=" " />
                <apex:inputField value="{!theLead.Country}" required="true" />
            </apex:pageBlockSection>
.
.
.
            <apex:pageblockSection id="LicenseSection" columns="2" title="License Information">
                <apex:outputField value="{!theTrial.License_Status__c}" />
                <apex:outputtext value=" " />
                <apex:outputField value="{!theTrial.Starts__c}" />
                <apex:inputField value="{!theTrial.Expires__c}" required="true" />
                <apex:pageblockSectionItem >
                    <apex:outputLabel for="comment" value="Comment in XXXXXXX" />
                    <apex:inputText id="comment" value="{!comment}" style="width:100%" />
                </apex:pageblockSectionItem>
            </apex:pageblockSection>
            <apex:actionregion >
                <apex:pageblocksection columns="2" id="SecuritySection" title="Security Information">
                    <apex:outputpanel >
                        <apex:pageblocksectionitem >
                            <apex:outputlabel for="generate" value="Generate random password" styleClass="labelCol vfLabelColTextWrap first" />
                            <apex:inputcheckbox id="generate" value="{!generatePassword}" styleClass="dataCol first">
                                <apex:actionsupport event="onclick" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                                <apex:actionsupport event="onClick" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                                <apex:actionsupport event="onchange" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                                <apex:actionsupport event="onChange" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                            </apex:inputcheckbox>
                        </apex:pageblocksectionitem>
                    </apex:outputpanel>
                    <apex:outputpanel id="ForcePasswordChange" >
                        <apex:pageblocksectionitem >
                            <apex:outputlabel for="forcechangepassword" value="Must change password on first login" styleclass="labelCol vfLabelColTextWrap first" />
                            <apex:inputcheckbox id="forcechangepassword" value="{!forceChangePassword}" styleclass="dataCol first" />
                        </apex:pageblocksectionitem>
                    </apex:outputpanel>
                    <apex:outputpanel id="EnterPassword" >
                        <apex:outputpanel id="renderPasswordField" rendered="{!NOT(generatePassword)}" >
                            <apex:pageblocksectionitem >
                                <apex:outputlabel for="password" value="Use this password" styleclass="labelCol vfLabelColTextWrap last" />
                                <apex:inputsecret id="password" value="{!password}" styleclass="dataCol last" />
                            </apex:pageblocksectionitem>
                        </apex:outputpanel>
                    </apex:outputpanel>
                    <apex:actionstatus id="generateChangeStatus" starttext="Changing security options..." stoptext="" />
                </apex:pageblocksection>
            </apex:actionregion>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Create" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <apex:pagemessages ></apex:pagemessages>
    </apex:form>
</apex:page>

Here's the special behavior function from the controller:

    public PageReference changeGenerate() {
        forceChangePassword = generatePassword;
        return null;
    }

With these tags in it, it finally used the right font, but the labels and fields are still not lined up with the rest of the form, and I've run out of things to try.  Any ideas?

I have a form where I allow the user the option to randomly generate a password, or enter one.  If the user chooses to generate a random password, then I want the password entry field to disappear, and the "must change password on first login" to be checked.  If the user doesn't generate a random password, then I want the password entry field to appear, and the other checkbox to be unchecked.

Unfortunately, no combination of event names or outputpanels will actually cause the function in the controller to run; it steadfastly refuses to execute.  I've put in a deliberate "blow up" statement to make absolutely sure that the function isn't running.  What do I need to do to get this code to execute?

Here is the relevant portion of the page:

            <apex:pageBlockSection columns="2" id="SecuritySection" title="Security Information">
                <apex:pageblocksectionitem >
                    <apex:outputlabel for="generate" value="Generate random password" />
                    <apex:inputCheckbox id="generate" value="{!generatePassword}">
                        <apex:actionSupport event="onchange" action="{!changeGenerate}" reRender="forcePanel, passwordPanel" status="generateChangeStatus" />
                    </apex:inputCheckbox>
                </apex:pageblocksectionitem>
                <apex:pageblocksectionitem >
                    <apex:outputpanel id="forcePanel">
                        <apex:outputlabel for="forcechangepassword" value="Must change password on first login" />
                        <apex:inputcheckbox id="forcechangepassword" value="{!forceChangePassword}" />
                    </apex:outputpanel>
                </apex:pageblocksectionitem>
                <apex:pageblocksectionitem >
                    <apex:outputpanel id="passwordPanel" >
                        <apex:outputlabel for="password" value="Use this password" />
                        <apex:outputpanel >
                            <div class="requiredInput">
                                <div class="requiredBlock"></div>
                                <apex:inputsecret id="password" value="{!password}" required="true" />
                            </div>
                        </apex:outputpanel>
                    </apex:outputpanel>
                </apex:pageblocksectionitem>
                <apex:actionstatus id="generateChangeStatus" starttext="Changing security options..." stoptext="" />
            </apex:pageBlockSection>

And here is the controller function:

    public PageReference changeGenerate() {
        System.assertEquals(1,null);
        forceChangePassword = generatePassword;
        return null;
    }
 

I have the following code in the dev console, but it doesn't compile because it doesn't like my attempts to cast the aggregateresult into something I can evaluate (numerous other formats tried).  Because of what it's doing, I can't use "HAVING" - if an email appears only once in lead and once in contact, I need to know that also.  How can the 2 evaluation statements be changed so that they compile and execute?

Map<String, AggregateResult> LeadsByEmail = new Map<String, AggregateResult>([SELECT Email Id, Count_distinct(Id) Cnt
                                                                              FROM Lead
                                                                              WHERE IsConverted != true
                                                                              GROUP BY Email]);
Map<String, AggregateResult> ContactsByEmail = new Map<String, AggregateResult>([SELECT Email Id, Count_distinct(Id) Cnt
                                                                                 FROM Contact
                                                                                 GROUP BY Email]);
for (AggregateResult arl : LeadsByEmail) {
    if (LeadsByEmail.get(arl.Id) > (AggregateResult)'1') {
        system.debug('Duplicate email - '+ arl.Id);
    }
    if (ContactsByEmail.containsKey(arl.Id)) {
        system.debug('Duplicate email - ' + arl.Id);
    }
}
for (AggregateResult arc : ContactsByEmail) {
    if (ContactsByEmail.get(arc.Id) > (AggregateResult)'1') {
        system.debug('Duplicate email - '+ arc.Id);
    }
    if (LeadsByEmail.containsKey(arc.Id)) {
        system.debug('Duplicate email - ' + arc.Id);
    }
}
I'm trying to create a function that returns an email.  I want it to return a Salesforce field type Email, like you would put in an sObject, rather than a String.  The reason for this is that true email addresses are case sensitive before the @ and case insensitive after the @.  Here is the header of the function I'd like to change:

    webservice static ???.Email GetMainContactEmail(Id aid) {    <-- replace ??? with library name to qualify Email field type

Here is the test method that does not work because the function is using a String.

    public static testmethod void testGetMainContactEmailOnly() {
        Account testAccount = TestData.MakeAccount();
        Contact testContact = TestData.MakeContact(testAccount);
        System.assertEquals(testContact.Email, Utilities.GetMainContactEmail(testAccount.Id));
    }

The contact is created with a randomly generated mixed case email address consisting of 10 alphanumeric characters, '@', 10 alphanumeric characters, '.com'.  Here is the test result:

System.AssertException: Assertion Failed: Expected: 2BC8reZIC1@S1X422H1ou.com, Actual: 2bc8rezic1@s1x422h1ou.com

If anyone has a reliable alternative to trying to return the field type from the function, something that will still conform to the RFC requirements on case sensitivity, I would like to hear that also.

Thanks for your time and effort. 
I've created a SOQL statement designed to locate accounts for which the primary contact cannot be determined, that is, accounts where there is more than one contact, but the accountcontactroles do not specify any primary.  The SOQL won't parse, says "Unknown parsing error".  Can anyone see what's wrong with it?

SELECT Id
FROM Account
WHERE Id IN (SELECT Account FROM Contact GROUP BY Account HAVING Count(Id) > 0)
AND Id NOT IN (SELECT AccountID Id FROM AccountContactRole WHERE IsDeleted = false and IsPrimary = true)
We have a managed package (Zuora Quotes) that includes some VF pages.  I'd like to add a picklist to one of their VF pages, but populate it using a select from another sObject in Apex code, and then save it to a custom lookup field in the object behind the page, also in Apex code.  Because the page is in a managed package, I can't access either the Apex code that runs before the page loads, or the Apex code that runs after the save button is clicked.

This sounds like a job for s-controls, but s-controls are deprecated.  What would be a viable strategy for accomplishing this, assuming the vendor is not going to cooperate and provide any extra hooks or interface points, or even documentation beyond what's available to all customers?
For some reason I'm not able to create a Roll-Up Summary field n the Build a Lemonade Stand.  It's not even an option and scrolling over the help text, it says "You cannot create this type of field on this object because it is not the master in a master-detail relationship."  Not sure how this can be fixed?

We're building a package which, among other things, sends emails.  We want to use a specific OrgWideEmailAddress as the sender of the email if, and only if, the currently logged on user's profile allows him/her access to that OrgWideEmailAddress, otherwise fall back and use the user's email address as the From.

We've encountered 2 problems.

In the administration menu, you can set an OrgWideEmailAddress to allow all profiles, or only certain profiles.  But if you select 2 profiles out of the list, or all of them but one, and save, it pretends to save your input but the list of OrgWideEmailAddress object will show "No Access" for that OrgWideEmailAddress.  Only if you select a single profile and save will the list show that the selected profile now has access.

In the code, the statement "SELECT Id, DisplayName, Address FROM OrgWideEmailAddress" returns all records, whether the currently logged on user's profile is allowed to use them or not.  There is no field, array, or related record that can be queried to determine whether an OrgWideEmailAddress is usable by the current user's profile.  If you attempt to send an email using try/catch, no exception is generated, but the email is not sent, and there's no mechanism to determine whether the email was refused due to non-permitted use of orgWideEmailAddress.

Does anyone have a strategy for getting around this problem?

Created new partial copy sandbox (CS26) because old sandbox (CS4) had undeployed mods in it that kept going to production by accident.  Later refreshed CS26 and it MOVED to CS4!!!

Do I have to delete ALL sandboxes before creating one in order to be sure that sandboxes with bad code won't be used?  Why did it merge them?  Why is there no option to delete the partial copy sandbox?
 

Is there a "codeless" way to create a related list using an external ID column rather than the SFID and standard lookup?

Example: I have an object rateplan which is regularly replicated into SF from an external source, and its SFIDs change every time this is done, becuase it deletes and re-adds each record.  The rateplan object also has a UPC column in it, defined as an external ID.  I have another object specialorder, which also has a column named UPC, but it's just a plain value column with size and type the same as the external ID in rateplan.  On the rateplan page, I want to put a related list of specialorders.

My first choice would be to do this declaratively, with no code, second choice would be to create a class/controller for just the related list, and have it appear among the other related lists in the page designer.  Last choice would be to have to rewrite the entire master page.

I want to create a related list to drop onto a page, based on an indirect relationship.

Example: I have an object subscription and a second object subscriptiondetail, which has a lookup (not a master/detail) to subscription.  The subscriptiondetail also contains a lookup to the standard SF object Product.  I want to define a related list and put it on the product page, containing subscriptions that have subscriptiondetail records that relate to the product.  I don't want a related list of subscriptiondetails, the related list will need to contain fields from the subscription object, so it needs to be a related list of subscriptions, but the actual relationship is a level lower in subscriptiondetail.

Is this possible by creating a controller or class for just the related list, rather than replacing the entire parent page with a custom version?

If I create a workflow using the basic workflow tool or the process builder, then later it becomes too complex to manage there, can I edit the workflow using Visual Workflow, even though I didn't create it there?

I have an immensely complicated VF page, with some special behavior in one section.  To get the special behavior to work, I had to litter the layout with outputpanels and actionregions (thanks to Henk Henk for his help with that).  Now it behaves correctly, but the active section has crap formatting - captions won't right justify, data fields won't line up with the rest of the form.

I've tried class and styleclass and labelstyleclass and datastyleclass and inserting spans and divs and ths - nothing will fix the formatting.  I don't dare touch the outputpanels themselves because the behavior will stop working.  Here's a portion of the page:

<apex:page showHeader="true" sidebar="true" standardController="TrialSubscription__c" extensions="NewWithTrial">
    <apex:form id="TheForm">
        <apex:actionFunction name="ChangeCloud" action="{!changeCloud}" rerender="CloudSection" status="cloudChangeStatus" />
        <apex:actionFunction name="ChangeProduct" action="{!changeProduct}" rerender="ProductSection, ConferencingSection, StorageSection, CallingSection" status="productChangeStatus" />
        <apex:actionFunction name="ChangeCalling" action="{!changeCalling}" rerender="CallingSection" status="callingChangeStatus" />
        <apex:actionfunction name="ChangeGenerate" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
        <apex:pageBlock mode="edit">
            <apex:pageBlockSection columns="2" title="Lead Information">
                <apex:inputField value="{!theLead.FirstName}" required="true" />
                <apex:inputField value="{!theLead.Phone}" required="true" />
                <apex:inputField value="{!theLead.LastName}" required="true" />
                <apex:inputField value="{!theLead.Email}" required="true" />
                <apex:inputField value="{!theLead.Company}" required="true" />
                <apex:inputField value="{!theLead.LeadSource}" />
                <apex:inputField value="{!theLead.Street}" />
                <apex:inputField value="{!theLead.nefsis_IP__c}" />
                <apex:inputField value="{!theLead.City}" />
                <apex:outputText value=" " />
                <apex:inputField value="{!theLead.State}" />
                <apex:outputText value=" " />
                <apex:inputField value="{!theLead.PostalCode}" />
                <apex:outputText value=" " />
                <apex:inputField value="{!theLead.Country}" required="true" />
            </apex:pageBlockSection>
.
.
.
            <apex:pageblockSection id="LicenseSection" columns="2" title="License Information">
                <apex:outputField value="{!theTrial.License_Status__c}" />
                <apex:outputtext value=" " />
                <apex:outputField value="{!theTrial.Starts__c}" />
                <apex:inputField value="{!theTrial.Expires__c}" required="true" />
                <apex:pageblockSectionItem >
                    <apex:outputLabel for="comment" value="Comment in XXXXXXX" />
                    <apex:inputText id="comment" value="{!comment}" style="width:100%" />
                </apex:pageblockSectionItem>
            </apex:pageblockSection>
            <apex:actionregion >
                <apex:pageblocksection columns="2" id="SecuritySection" title="Security Information">
                    <apex:outputpanel >
                        <apex:pageblocksectionitem >
                            <apex:outputlabel for="generate" value="Generate random password" styleClass="labelCol vfLabelColTextWrap first" />
                            <apex:inputcheckbox id="generate" value="{!generatePassword}" styleClass="dataCol first">
                                <apex:actionsupport event="onclick" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                                <apex:actionsupport event="onClick" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                                <apex:actionsupport event="onchange" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                                <apex:actionsupport event="onChange" action="{!changeGenerate}" rerender="ForcePasswordChange, EnterPassword" status="generateChangeStatus" />
                            </apex:inputcheckbox>
                        </apex:pageblocksectionitem>
                    </apex:outputpanel>
                    <apex:outputpanel id="ForcePasswordChange" >
                        <apex:pageblocksectionitem >
                            <apex:outputlabel for="forcechangepassword" value="Must change password on first login" styleclass="labelCol vfLabelColTextWrap first" />
                            <apex:inputcheckbox id="forcechangepassword" value="{!forceChangePassword}" styleclass="dataCol first" />
                        </apex:pageblocksectionitem>
                    </apex:outputpanel>
                    <apex:outputpanel id="EnterPassword" >
                        <apex:outputpanel id="renderPasswordField" rendered="{!NOT(generatePassword)}" >
                            <apex:pageblocksectionitem >
                                <apex:outputlabel for="password" value="Use this password" styleclass="labelCol vfLabelColTextWrap last" />
                                <apex:inputsecret id="password" value="{!password}" styleclass="dataCol last" />
                            </apex:pageblocksectionitem>
                        </apex:outputpanel>
                    </apex:outputpanel>
                    <apex:actionstatus id="generateChangeStatus" starttext="Changing security options..." stoptext="" />
                </apex:pageblocksection>
            </apex:actionregion>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Create" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <apex:pagemessages ></apex:pagemessages>
    </apex:form>
</apex:page>

Here's the special behavior function from the controller:

    public PageReference changeGenerate() {
        forceChangePassword = generatePassword;
        return null;
    }

With these tags in it, it finally used the right font, but the labels and fields are still not lined up with the rest of the form, and I've run out of things to try.  Any ideas?

I have a form where I allow the user the option to randomly generate a password, or enter one.  If the user chooses to generate a random password, then I want the password entry field to disappear, and the "must change password on first login" to be checked.  If the user doesn't generate a random password, then I want the password entry field to appear, and the other checkbox to be unchecked.

Unfortunately, no combination of event names or outputpanels will actually cause the function in the controller to run; it steadfastly refuses to execute.  I've put in a deliberate "blow up" statement to make absolutely sure that the function isn't running.  What do I need to do to get this code to execute?

Here is the relevant portion of the page:

            <apex:pageBlockSection columns="2" id="SecuritySection" title="Security Information">
                <apex:pageblocksectionitem >
                    <apex:outputlabel for="generate" value="Generate random password" />
                    <apex:inputCheckbox id="generate" value="{!generatePassword}">
                        <apex:actionSupport event="onchange" action="{!changeGenerate}" reRender="forcePanel, passwordPanel" status="generateChangeStatus" />
                    </apex:inputCheckbox>
                </apex:pageblocksectionitem>
                <apex:pageblocksectionitem >
                    <apex:outputpanel id="forcePanel">
                        <apex:outputlabel for="forcechangepassword" value="Must change password on first login" />
                        <apex:inputcheckbox id="forcechangepassword" value="{!forceChangePassword}" />
                    </apex:outputpanel>
                </apex:pageblocksectionitem>
                <apex:pageblocksectionitem >
                    <apex:outputpanel id="passwordPanel" >
                        <apex:outputlabel for="password" value="Use this password" />
                        <apex:outputpanel >
                            <div class="requiredInput">
                                <div class="requiredBlock"></div>
                                <apex:inputsecret id="password" value="{!password}" required="true" />
                            </div>
                        </apex:outputpanel>
                    </apex:outputpanel>
                </apex:pageblocksectionitem>
                <apex:actionstatus id="generateChangeStatus" starttext="Changing security options..." stoptext="" />
            </apex:pageBlockSection>

And here is the controller function:

    public PageReference changeGenerate() {
        System.assertEquals(1,null);
        forceChangePassword = generatePassword;
        return null;
    }
 

I have the following code in the dev console, but it doesn't compile because it doesn't like my attempts to cast the aggregateresult into something I can evaluate (numerous other formats tried).  Because of what it's doing, I can't use "HAVING" - if an email appears only once in lead and once in contact, I need to know that also.  How can the 2 evaluation statements be changed so that they compile and execute?

Map<String, AggregateResult> LeadsByEmail = new Map<String, AggregateResult>([SELECT Email Id, Count_distinct(Id) Cnt
                                                                              FROM Lead
                                                                              WHERE IsConverted != true
                                                                              GROUP BY Email]);
Map<String, AggregateResult> ContactsByEmail = new Map<String, AggregateResult>([SELECT Email Id, Count_distinct(Id) Cnt
                                                                                 FROM Contact
                                                                                 GROUP BY Email]);
for (AggregateResult arl : LeadsByEmail) {
    if (LeadsByEmail.get(arl.Id) > (AggregateResult)'1') {
        system.debug('Duplicate email - '+ arl.Id);
    }
    if (ContactsByEmail.containsKey(arl.Id)) {
        system.debug('Duplicate email - ' + arl.Id);
    }
}
for (AggregateResult arc : ContactsByEmail) {
    if (ContactsByEmail.get(arc.Id) > (AggregateResult)'1') {
        system.debug('Duplicate email - '+ arc.Id);
    }
    if (LeadsByEmail.containsKey(arc.Id)) {
        system.debug('Duplicate email - ' + arc.Id);
    }
}
I'm trying to create a function that returns an email.  I want it to return a Salesforce field type Email, like you would put in an sObject, rather than a String.  The reason for this is that true email addresses are case sensitive before the @ and case insensitive after the @.  Here is the header of the function I'd like to change:

    webservice static ???.Email GetMainContactEmail(Id aid) {    <-- replace ??? with library name to qualify Email field type

Here is the test method that does not work because the function is using a String.

    public static testmethod void testGetMainContactEmailOnly() {
        Account testAccount = TestData.MakeAccount();
        Contact testContact = TestData.MakeContact(testAccount);
        System.assertEquals(testContact.Email, Utilities.GetMainContactEmail(testAccount.Id));
    }

The contact is created with a randomly generated mixed case email address consisting of 10 alphanumeric characters, '@', 10 alphanumeric characters, '.com'.  Here is the test result:

System.AssertException: Assertion Failed: Expected: 2BC8reZIC1@S1X422H1ou.com, Actual: 2bc8rezic1@s1x422h1ou.com

If anyone has a reliable alternative to trying to return the field type from the function, something that will still conform to the RFC requirements on case sensitivity, I would like to hear that also.

Thanks for your time and effort. 
We have a managed package (Zuora Quotes) that includes some VF pages.  I'd like to add a picklist to one of their VF pages, but populate it using a select from another sObject in Apex code, and then save it to a custom lookup field in the object behind the page, also in Apex code.  Because the page is in a managed package, I can't access either the Apex code that runs before the page loads, or the Apex code that runs after the save button is clicked.

This sounds like a job for s-controls, but s-controls are deprecated.  What would be a viable strategy for accomplishing this, assuming the vendor is not going to cooperate and provide any extra hooks or interface points, or even documentation beyond what's available to all customers?