• carramrod
  • NEWBIE
  • 0 Points
  • Member since 2008

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

As many, I'm excited to deploy inline edits for Visualforce page, and while inline editing works, it's broken my google maps "related list".

This page was previously on api version 15.0. Prior to today, i've ran this form without <apex:form> tags. In enabling inline editing for VF, I've been forced to upgrade this page to API 21, and add <apex:form> tags as inline editing has to descend from this tag. Inline editing works! Google Maps breaks :(.

By viewing the errors in IE, i can break it down to this statement in the source:
<script  type="text/javascript">document.forms['echoScontrolForm_066700000004hqK'].submit()</script>

IE Mesage: 'document.forms.echoScontrolForm_066700000004hqK' is null or not an object

Please correct me if I'm wrong, but this seems to have broken because I have to explicitly define an <apex: form>! If i remove inline editing, and then subsequently the <apex:form> tags, it magically works again. Please see my very simple VF page below and let me know if I am doing something wrong, if there is an easier way to attain my goals, and how I can resolve this issue!

<apex:page standardController="Account" showHeader="true" title="Account: {!Account.Name}">
<apex:form id="theform">
        <apex:variable var="renderDistributor" value="{!if($User.ProfileId = '00e70000000viCR',false,true)}" />
        <apex:variable var="sentToInterface" value="{!if(Account.Sent_To_Interface__c = true,true,false)}" />
        <apex:variable var="sentToInterfaceTime" value="{!Account.Sent_To_Interface_Time__c}" />
    <apex:pageBlock rendered="{!AND(renderDistributor,sentToInterface)}" title="Information" >   
    
               <table border="0.5" width="100%">

                <tr>
                    <td bgcolor="pink">
                        <center>
                        <font color="red" face="arial">
                            <b>This customer was last queued for the interface on:&nbsp;<apex:outputfield value="{!Account.Sent_To_Interface_Time__c}"/></b>
                        </font>
                        </center>                
   <apex:detail relatedList="true" inlineEdit="true">
    </apex:detail>
    </apex:form>  
</apex:page>

 






 

 

 I'm trying to pass the current value of the inputfield id TechCenter to my apex controller, but my code below passes in null (which i assume because the field hasn't been assigned yet. I want to pass the value in this field, not the previous value to my apex class. This is an actionsupport rerender on a panel, so it's a partial page update.

 

<apex:pageblockSectionItem >
<apex:outputLabel value="Tech Center" for="TechCenter"></apex:outputLabel>
<apex:actionRegion >
<apex:inputField id="TechCenter" value="{!bc.Technical_Center__c}" required="true">
<apex:actionSupport event="onchange" rerender="AddressPanel" status="status1">
<apex:param id="tc" value="{!bc.Technical_Center__c}"/>
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:pageblockSectionItem>

 

 

 

In visualforce i'm using a picklist for the user to select an office location.

When a user changes the value in the picklist, i'd like it to populate a textbox with a default address.

 

I've done this before in ASP.net and javascript but don't know how to approach it in apex/vf.

If possible i'd like to not store the values in the custom controller, but in the apex code itself, the reason being if there's a change in address, it's as easy as changing the visualforce page.

thanks in advance.

 

I'm trying to get the value of a field used in a lookuplink (User) on a VF page.

I know in other areas of salesforce you can use Parent.Child.FieldName format, but i'm getting an error when i try the following:

 

{!CustomObject.RequestedName__c.FirstName} 

RequestedName__c is the API name of the lookup link on the user object.

it gives the following error: Error: Unknown property 'String.FirstName'

If i take off FirstName it just provides the User ID for the User selected in the lookup link.

 

any help would be greatly appreciated.

My goal in this page is to be able to rename the standard related list "Notes And Attachments" to something else. Since this is a standard related list, it cannot be changed without Visualforce (AFAIK).

 

I have successfullly created a visualforce page to display the Account object, and was able to manually add all the related lists (and rename the notes and attachments related list), but my problem is that i have some custom objects that are hidden from many users. By adding them manually, these users will get errors in viewing the page if it's overriden. Is there a way to render the <apex:Detail relatedlist="false">, add the Notes And Attachment related list (renamed of course), and then have all the rest of the generated lists <apex:detail relatedlist="true"> ??

 

I tried to do it here, but obviously it adds the AccountDetail twice.:

 

 

<apex:page standardController="Account"> <apex:detail relatedList="false"/> <apex:relatedList list="NotesAndAttachments" title="Notes And Attachments (Topic Memo)"/> <apex:detail relatedList="true" /> </apex:page>

 

 

 

getting a null reference exception on the line in bold, I don't understand why...
Am I passing the wrong kind of trigger parameter (Trigger.new)?

System.NullPointerException: Attempt to de-reference a null object

Trigger:
trigger tAccountRecordDeleteBefore on Account (before delete) {
    cAccountRecordDeleteBefore.TrackDelIntegrationAccount(Trigger.new);
}

Called Class:
public class cAccountRecordDeleteBefore {
    public static void TrackDelIntegrationAccount(Account[] accs){
        List<Deleted_Accounts__c> delList = new List<Deleted_Accounts__c>();
        Deleted_Accounts__c acct = new Deleted_Accounts__c();
        for(Account a:accs){
                if(a.Sent_To__c == true){
                    acct = new Deleted_Accounts__c();
                    acct.Name = a.ID;
                    acct.Last_Sent_Time__c = a.Sent_Time__c;
                    delList.add(acct);
                }//end if
        }//end for
        if(delList.size()>0){
            insert delList;
        }
    }
}



Message Edited by carramrod on 12-18-2008 11:22 AM

Message Edited by carramrod on 12-18-2008 11:25 AM
    This is fired by an after insert/update/delete trigger on Account: getting collection is read-only error on the line updateMap.remove(a.ID);

Code:
 public static void runChildObjectUpdates(Account[] accs,Map<Id,Account> mNewAccountsMap){
Long datediff;
Map<Id,Account> updateMap = new Map<Id,Account>();
updateMap = mNewAccountsMap;
for(Account a:accs){
datediff = System.now().getTime() - a.Sent_To_Japan_Time__c.getTime();
//run update if the difference is <= 1 minute, 60000 milliseconds
if((a.Sent_To_Japan__c == true && datediff <= 60000) == false){
updateMap.remove(a.ID);
}
}//end for
if(mNewAccountsMap.size() > 0){
cFireChildUpdatesFromParent.fireUpdatesOnChildObjects(updateMap);
}
}

 



Message Edited by carramrod on 11-12-2008 02:27 PM
i've got a trigger calling this, but it bombs everytime an account has over 20 contacts. I want to incorporate some custom objects similarly too, but i'm hitting limits.
I'm using this for an integration and need to fire an update on every child record (contact, custom object, etc..) when an account is saved. If i daisy chain the updates to other objects to other triggers, can i get around this limitation?
for instance: assuming what i have below can be fixed and i can update more than 20 contacts in one call, account trigger modifies contacts, contacts trigger modifies custom object a, custom object a modifies custom object b.

    public static void fireUpdatesOnChildObjects(Account[] accs){
        for (Account a:accs){
            //change status of this object.
            if (a.Toggle_Update__c == true){
                a.Toggle_Update__c = false;
            }   
            else{
                a.Toggle_Update__c = true;   
            }
            //fire updates on contacts
            Contact[] contacts = [SELECT ID,Toggle_Update__c FROM CONTACT WHERE AccountID =:a.ID];
            for (Contact c:contacts){
                if(c.Toggle_Update__c == true){
                    c.Toggle_Update__c = false;   
                }   
                else{
                    c.toggle_update__c = true;   
                }
                update c;
            }
            //fire updates on Trip Logs
            /*Trip_Log__c[] triplogs= [SELECT ID,Toggle_Update__c FROM Trip_Log__c WHERE Account__c =:a.ID];
            for (Trip_Log__c t:triplogs){
                if(t.Toggle_Update__c == true){
                    t.Toggle_Update__c = false;   
                }   
                else{
                    t.toggle_update__c = true;   
                }
                update t;
            }*/
        }
       
           
    }
I'm trying to do a field update to proper case, and since there isn't any propercase function in the formula editor, i'm kind of at a loss.
I want to take 123 EASY sT. suite 203 = 123 Easy St. Suite 203
Any help is appreciated.

 

 I'm trying to pass the current value of the inputfield id TechCenter to my apex controller, but my code below passes in null (which i assume because the field hasn't been assigned yet. I want to pass the value in this field, not the previous value to my apex class. This is an actionsupport rerender on a panel, so it's a partial page update.

 

<apex:pageblockSectionItem >
<apex:outputLabel value="Tech Center" for="TechCenter"></apex:outputLabel>
<apex:actionRegion >
<apex:inputField id="TechCenter" value="{!bc.Technical_Center__c}" required="true">
<apex:actionSupport event="onchange" rerender="AddressPanel" status="status1">
<apex:param id="tc" value="{!bc.Technical_Center__c}"/>
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:pageblockSectionItem>

 

 

 

My goal in this page is to be able to rename the standard related list "Notes And Attachments" to something else. Since this is a standard related list, it cannot be changed without Visualforce (AFAIK).

 

I have successfullly created a visualforce page to display the Account object, and was able to manually add all the related lists (and rename the notes and attachments related list), but my problem is that i have some custom objects that are hidden from many users. By adding them manually, these users will get errors in viewing the page if it's overriden. Is there a way to render the <apex:Detail relatedlist="false">, add the Notes And Attachment related list (renamed of course), and then have all the rest of the generated lists <apex:detail relatedlist="true"> ??

 

I tried to do it here, but obviously it adds the AccountDetail twice.:

 

 

<apex:page standardController="Account"> <apex:detail relatedList="false"/> <apex:relatedList list="NotesAndAttachments" title="Notes And Attachments (Topic Memo)"/> <apex:detail relatedList="true" /> </apex:page>

 

 

 

getting a null reference exception on the line in bold, I don't understand why...
Am I passing the wrong kind of trigger parameter (Trigger.new)?

System.NullPointerException: Attempt to de-reference a null object

Trigger:
trigger tAccountRecordDeleteBefore on Account (before delete) {
    cAccountRecordDeleteBefore.TrackDelIntegrationAccount(Trigger.new);
}

Called Class:
public class cAccountRecordDeleteBefore {
    public static void TrackDelIntegrationAccount(Account[] accs){
        List<Deleted_Accounts__c> delList = new List<Deleted_Accounts__c>();
        Deleted_Accounts__c acct = new Deleted_Accounts__c();
        for(Account a:accs){
                if(a.Sent_To__c == true){
                    acct = new Deleted_Accounts__c();
                    acct.Name = a.ID;
                    acct.Last_Sent_Time__c = a.Sent_Time__c;
                    delList.add(acct);
                }//end if
        }//end for
        if(delList.size()>0){
            insert delList;
        }
    }
}



Message Edited by carramrod on 12-18-2008 11:22 AM

Message Edited by carramrod on 12-18-2008 11:25 AM