• RatherGeeky
  • NEWBIE
  • 165 Points
  • Member since 2008
  • System Admin


  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 70
    Replies

Hi guys

 

I have developed a custom object. However, I would not like it to appear as a tab but would still like to let users add records to it.

 

How can users add records to a custom object when there's no tab attached to that object.

 

Thanks

Mark

I have several legacy classes (around 20 of them) and triggers (about 5) that are no longer being used and I need to delete from our Salesforce org. However, our code coverage is currently 74% (needs to be at least 75%) because of issues with the code/test classes in those very same classes.

I've tried modifying the xml in Eclipse to set them to inactive/deleted but when I try to validate deploying those changes, I get errors on the test classes of the code that I am trying to remove. I've also attempted to follow these instructions to temporarily boost test class coverage just in order to remove those classes that are unnecessary. But again, the errors on the test classes won't allow me to continue deployment.

It seems that I have to first improve the test classes (note: I am not a programer and this code was written by someone no longer at my company) so that coverage improves in order to then delete them. 

I've tried combing through the errors... if I can make a change that will bump us up even by 1% that would resolve the issue I think... but I've got very minimal understanding of how the code functions and don't even know where to start.

Any suggestions?



 

I've got a visualforce page rendering as a PDF that is pulling in some contact details from a junction object, including Email address.

 

It looks like this:

 

screen capture

 

I'd like to strip the formatting of the text - no hyperlink, no 'Gmail' text.

 

My code looks like this:

 

          <apex:column >

              <apex:facet name="header">Email</apex:facet>
              <apex:outputField value="{!c.role.Contact_Name__r.Email}" />

          </apex:column>

 

 

Any tips?

I'm trying to modify the code in the awesome Campaign Membership Manager app in order to add a button that updates the status of all selected members to a specific option (which I want to hard code).

 

The existing button allows the user to remove the selected members.

 

I, uh, added the button. But as far as developing the functionality, I'm a dum dum.

 

 

This is my button: 

<apex:commandButton value="Update to Hand Deliver" action="{!updateSelectedStatusMail}" rendered="{!NOT(ISNULL(CampaignMembers))}" />

 

And here's the code:

 

/**
*  CMM Campaign Membership Manager
*  Copyright (c) 2009, Marcel Will, Sales Engineering, Salesforce.com Inc.
*  All rights reserved.
*
*  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
*  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*  Neither the name of the salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
*  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
*  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
*  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
*  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
*  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public with sharing class cmmCampaignMembershipManagerController{
    
    private List<myCampaignMember>  campaignMemberList { get; set; }   
    private List<myCampaignMember>  CampaignMembers;            
    private List<myCampaignMember>  pageCampaignMemberList;          
    private List<CampaignMember>    deleteCampaignMembers;      
    private Map<Id, CampaignMember> selectedCampaignMembersMap;
    
    private String  selectedCampaign;
    private String  CampaignDescription;
    private String  userName;
    private String  userLanguage;
    private Integer pageNumber;
    private Integer pageSize;
    private integer totalPageNumber;
    private Integer selectedRows; 
    
    public Boolean selectAllCheckbox        { get; set; }
    public String  messageTitle             { get; set; }
    public String  messageDetail            { get; set; }
    public String  messageSeverity          { get; set; }
    transient public Boolean messageShow    { get; set; }
    
    /**
    * constructor
    */
    public cmmCampaignMembershipManagerController(){
        
        this.CampaignMembers            = new List<myCampaignMember>{};
        this.pageCampaignMemberList     = new List<myCampaignMember>{}; 
        this.deleteCampaignMembers      = new List<CampaignMember>();
        this.selectedCampaignMembersMap = new Map<Id, CampaignMember>();
        
        this.userName       = UserInfo.getUserId();
        this.userLanguage   = UserInfo.getLanguage();
        
        this.pageNumber         = 0;
        this.totalPageNumber    = 0;
        this.selectedRows       = 0;
        this.pageSize           = 10;
    }
    
    /**
    * Getter method to retrieve the user language
    * @return userLanguage
    */
    public String getUserLanguage(){
        return userLanguage.Substring( 0, 2 );
    }
    
    /**
    * Getter Method to retrieve the current page number
    * @return pageNumber
    */
    public Integer getPageNumber(){
        return pageNumber;
    }
    
    /**
    * Getter method to retrieve the page size
    * @return pageSize
    */
    public Integer getPageSize(){
        return pageSize;
    }
    
    /**
    * Getter method to enable previous button
    * @return Boolean
    */
    public Boolean getPreviousButtonEnabled(){
        return !( pageNumber > 1 );
    }
    
    /**
    * Getter method to enable Next button
    * @return Boolean
    */
    public Boolean getNextButtonEnabled(){
        if( campaignMemberList == null ){
            return true;
        }else{
            return ( ( pageNumber * pageSize ) >= campaignMemberList.size() );
        }
    }
    
    /**
    * Getter method to retrieve total page number
    * @return totalPageNumber
    */
    public Integer getTotalPageNumber(){
        
        totalPageNumber = campaignMemberList.size() / pageSize;
        Integer mod     = campaignMemberList.size() - ( totalPageNumber * pageSize );
        
        if( mod > 0 ){
            totalPageNumber++;
        }
        
        return totalPageNumber;
    }
    
    /**
    * Getter method to retrieve Campaign member list
    * @return List<myCampaignMember>
    */
    public List<myCampaignMember> getCampaignMembers(){
        
        if( pageCampaignMemberList.Size() > 0 ){
            return pageCampaignMemberList;
        }else{
            return null;
        }
    }   
    
    /**
    * Getter to retrieve the number of selected rows
    * @return selectedRows
    */
    public Integer getSelectedRows(){
        return this.selectedRows;
    }
    
    /**
    * Recalculate Number of selected items in Grid
    * @return null
    */
    public Integer recalculateSelected(){
        selectedRows = selectedCampaignMembersMap.size();
        return null;
    }
    
    /**
    * Bind data to paged list for displaying on VF page
    * @param newPageIndex
    */
    private void BindData( Integer newPageIndex ){
        
        try{

            Transient Integer counter   = 0;
            Transient Integer min       = 0;
            Transient Integer max       = 0;
            
            if( newPageIndex > PageNumber ){
                min = pageNumber * pageSize;
                max = newPageIndex * pageSize;
            }else{
                max = newPageIndex * pageSize;
                min = max - pageSize;
            }
            
            CampaignMembers.clear();
            pageCampaignMemberList.clear();
            
            for( myCampaignMember cm: CampaignMemberList ){
                counter++;
                if( counter > min && counter <= max ){
                    pageCampaignMemberList.add( cm );
                }
            }
            pageNumber = newPageIndex;
            if( pageCampaignMemberList == null || pageCampaignMemberList.size() <= 0 ){
                messageTitle        = 'CMM_No_data';
                messageDetail       = 'CMM_No_data_available';
                messageSeverity     = 'info';
                messageShow         = true;
            }
        }catch( Exception ex ){
            messageTitle    = ex.getMessage();
            messageDetail   = ex.getMessage();
            messageSeverity = 'fatal';
            messageShow     = true;
        }
    }
    
    /**
    * Search for all Campaign Members of a selected campaign and put them into a list of <myCamapaignMember>
    * @return PageReference
    */
    public PageReference DoSearch(){
        
        this.campaignMemberList = new List<myCampaignMember>();
        this.pageCampaignMemberList.clear();
        
        for( CampaignMember cm: [ Select Id, LeadId, Lead.Company, Lead.Email, Lead.FirstName, Lead.LastName, Lead.OwnerId, Lead.City, ContactId, 
                                    Contact.Account.Name, Contact.Email, Contact.FirstName, Contact.LastName, Contact.OwnerId, Contact.MailingCity, Status 
                                    from CampaignMember 
                                    WHERE CampaignId =: selectedCampaign AND ( Contact.OwnerID =: userName OR Lead.OwnerID =: userName ) 
                                    ORDER BY Lead.LastName, Contact.LastName ] ){
                                        
            this.campaignMemberList.add( new MyCampaignMember( cm ) );
        }
        
        this.BindData( 1 );
        this.selectedRows = 0;
        
        return null;
    }   
    
    /**
    * Action method on next button
    * @return PageReference
    */
    public PageReference nextBtnClick(){
        
        clearMessage();
        updateSelectedList();       
        BindData( pageNumber + 1 );
        
        return null;
    }
    
    /**
    * Action method on previous button
    * @return PageReference
    */
    public PageReference previousBtnClick(){
        
        clearMessage();
        updateSelectedList();       
        BindData( pageNumber -1 );
        
        return null;
    }
    
    /**
    * This method clears the message on the visual force page.
    * @return PageReference
    */
    public pageReference clearMessage(){
        this.messageShow = false;
        return null;
    }
    
    /**
    * Get Campaign Description for selected Campaign to show on VF page     
    * @return CampaignDescription
    */                
    public String getCampaignDescription(){
        
        CampaignDescription = 'CMM_Select_Campaign';
        
        if( selectedCampaign != null ){
            Campaign myCampaign = [ select id, description from Campaign where id =: selectedCampaign ];
            CampaignDescription = myCampaign.Description;
        }
        
        return CampaignDescription;
    }

    /**
    * Update list of selected records for processing 
    */ 
    public void updateSelectedList(){
        List<myCampaignMember> members = this.getCampaignMembers();
        if( members != null ){
            for( myCampaignMember mcMember : getCampaignMembers() ){
                if( mcMember.selected == true ){
                    selectedCampaignMembersMap.put( mcMember.campmem.id, mcMember.campmem );
                }else{
                    selectedCampaignMembersMap.remove( mcMember.campmem.id );
                }
            }
            
            selectedRows = selectedCampaignMembersMap.size();
        }
    }

    /**
    * Delete selected campaign members
    * @return PageReference
    */
    public PageReference updateSelectedStatusMail(){
        
        updateSelectedList();
        deleteCampaignMembers.clear();
        deleteCampaignMembers = selectedCampaignMembersMap.values();
        
        try{
            if( deleteCampaignMembers.size() > 0 ){
                delete deleteCampaignMembers;
                messageTitle    = 'CMM_Successful';
                messageDetail   = deleteCampaignMembers.size() + ' ' + 'CMM_Successfully_removed';
                messageSeverity = 'confirm';
                messageShow = true;
            }
            else{
                messageTitle    = 'CMM_Error';
                messageDetail   = 'Please select at least one member';
                messageSeverity = 'fatal';
                messageShow = true;
            }
        }catch( DmlException e ){
            messageTitle    = 'CMM_Error';
            messageDetail   = e.getMessage();
            messageSeverity = 'fatal';
        }finally{
            messageShow = true;
        }
        
        campaignMemberList.clear();
        selectedCampaignMembersMap.clear();
        selectedRows = 0;
        DoSearch(); 
        
        return null;
    }
    
    
        /**
    * Update Status of Campaign Members to 'Hand Deliver'
    * Customization added October 18, 2011
    * @return PageReference
    */
    public PageReference processSelected(){
        
        updateSelectedList();

        
        campaignMemberList.clear();
        selectedCampaignMembersMap.clear();
        selectedRows = 0;
        DoSearch(); 
        
        return null;
    }

    /**
    * Get list of all Campaigns with Status equals to "Planned" and with Active equals to "true"
    * @return List<SelectOption>
    */
    public List<SelectOption> getCampaigns(){
        
        List<SelectOption> options  = new List<SelectOption>();
        List<Campaign> cList        = new List<Campaign>();
        
        try {
            cList = [ SELECT Id, Name, Description FROM Campaign WHERE Status = 'Planned' AND IsActive = true ORDER BY Name ];
            for( Campaign c: cList ){
                options.add( new SelectOption( c.Id, c.Name ) );
            }
            
            if( cList == null || cList.size() <= 0 ){
                // Show Info Message that no records have been found
                messageTitle    = 'CMM_No_data';
                messageDetail   = 'CMM_No_Campaign';
                messageSeverity = 'info';
                messageShow     = true;
                
                return null;    
            }else{
                return options;
            }        
        }catch( Exception ex ){
           // Show error Message with severity FATAL
           // messageTitle  = 'CMM_Error';
           // messageDetail     = ex.getMessage();
           //messageSeverity = 'fatal';
           //messageShow    = true;
           return null;
        } 
    }
    
    /**
    * Getter method to retreieve the selected campaing
    * @return selectedCampaign
    */
    public String getSelectedCampaign(){
        return this.selectedCampaign;
    }
    
    /**
    * Setter method to set te selected Campaign
    * @param selectedCampaign
    */
    public void setSelectedCampaign( String selectedCampaign ){
        this.selectedCampaign = selectedCampaign;
    }     
    
    /**
    * Inner Class 
    * myCampaignMember to extend CampaignMember object with selected field (checkbox, boolean)
    */
    public class myCampaignMember{
        
        public CampaignMember campmem   { get; set; }
        public Boolean selected         { get; set; }
        
        /**
        * Constructor
        */
        public myCampaignMember( CampaignMember cm ){
            this.campmem    = cm;
            this.selected   = false;
        }
    } 
}

 

I'm using the Campaign Membership Manager 1.0 app by Force.com Labs. Unfortunately, it seems that having mutli-currency enabled is causing a problem with the code. 

 

Invalid field CurrencyIsoCode for SObject CampaignMember 

 

I attempted to resolve this problem myself by updating the query in the app controller by adding the CurrencyIsoCode to both the CampaignMember and Campaign queries. But, I get this error when I try to save in Eclipse:

 

No such column 'CurrencyIsoCode' on entity 'CampaignMember'.

 

I have double checked the spelling and actually copied the api name from the Setup > Campaign Members field listing. So, I know that it exists on the CampaignMember object. I'm just confused as to why it won't let me include that field.

 

It's pretty pointless because we aren't using the Multi-Currency field. We enabled it in the past because a consultant told us to but we are only using dollars.

 

Here is the query that I am updating:

 

 

        for( CampaignMember cm: [ Select Id, CurrencyIsoCode, LeadId, Lead.Company, Lead.Email, Lead.FirstName, Lead.LastName, Lead.OwnerId, Lead.City, ContactId, 
        							Contact.Account.Name, Contact.Email, Contact.FirstName, Contact.LastName, Contact.OwnerId, Contact.MailingCity, Status
        							from CampaignMember 
        							WHERE CampaignId =: selectedCampaign AND ( Contact.OwnerID =: userName OR Lead.OwnerID =: userName ) 
        							ORDER BY Lead.LastName, Contact.LastName ] ){
        								
            this.campaignMemberList.add( new MyCampaignMember( cm ) );
        }
        

 

Any tips as to why this may be happening or how I can reformat the query?

 

The ID for custom fields in salesforce begins with a number. When using Internet Explorer, when we use web-to-lead & try to pass information from a form into salesforce, the custom field information does not get passed. Other information (oid, first name, last name) gets passed fine. And when using Firefox, Chrome or Safari, all information passes through correctly (although in these browsers, we are using ajax/javascript to submit the forms, as opposed to using the standard form action method=POST in IE).


In our HTML <form>, we use <input> elements (type=hidden), where the name & id attributes are equal to the salesforce custom field ID. However, starting an id or name attribute with a number is improper HTML (according to the w3c).
We have also tried using the custom field name in salesforce, but that did not work in IE either.

What's weird is that some of the fields are passing through (oid, first name, etc.), and the lead is being created, but we are still missing a few of our custom fields.

Is there a way to change the custom field IDs in salesforce to begin with a letter instead of a number? We'd like to try that.

Or if you have other/better suggestions, we'd really appreciate it.

 

I'm trying to build my first actual visualforce page on my own (well, borrowing heavily from examples). And this is what I get for being too uppity. I'm stuck.

My Goal:
Create a custom list on Contracts that shows all related Opportunities (where Contract__c on the Opportunity = the currently viewed Contract Id) on the Contract page layout. Eventually, I want to create a total of the Amounts and use this to compare to the total contract value. (We have a data model where many opps can be related to one contract.)

What I Was Thinking:

I created a Contract controller extension, borrowing from this other post and following the directions here.

public class ContractExtension { public List<Opportunity> ChildOpportunities = new Opportunity[]{}; public List<Opportunity> getContractOpps() { ChildOpportunities = [SELECT o.Contract__r.Id, Amount, Id, StageName, CloseDate FROM Opportunity o WHERE o.Contract__r.Id = :System.currentPageReference().getParameters().get('id') ]; return ChildOpportunities; } }

But, when I include the reference to the extension on my visualforce page, I get an error. "Unknown constructor 'ContractExtension.ContractExtension(Apex.Pages.StandardController controlller)'

Here's my page:

<apex:page standardController="Contract" extensions="ContractExtension"> <apex:detail id="ChildOpps_v1" relatedList="true"> <apex:relatedList id="ChildOpportunities" list="Opportunities" title="Child Opportunities" subject="{!ContractOpps}"> </apex:relatedList> </apex:detail> </apex:page>

 Any helpful tips for a vf newbie?


 

 

Goal: use a trigger to update a custom field on the Task (OppNumber) with a field on the Opportunity that is selected in the WhatID field (if an Opp is selected)

 

I thought this would be easy to do using a lookup and just passing the value, but you apparently cannot create a lookup on the Activity/Task object. 

 

I know I can pull in the record ID for the opp related via the WhatID field, but how can I refer to a specific field on that record? (Such as the Opportunity Number).

 

Open to suggestions.

 

 

Here's the scenario: I have a custom object ('project') that is created via apex when an Opportunity is closed. I am trying to establish a 1:1 relationship (at least from the user's perspective), so I want the newly created project to be passed back to a lookup on the Opportunity.

Basically, I'm seeking to populate the Opportunity Project lookup with the id of the newly created project record so that they are linked both ways (instead of just linking one way, the project back to the opportunity).

I assume this can be done in an afterinsert trigger on the project object. But, I have been unable to update a related object via my trigger.

Something like this: thisOpp.Parent_Opportunity__r.Project_Profile__c = Project_Profile__c.Id;

I'm offering $65 via paypal to the first person that can provide me a working answer (this would include an apex trigger and the basic structure of a test class or an alternative solution).

Contact me with questions. (I will be working over the weekend.)

Message Edited by J Baze on 09-04-2009 05:21 PM

I have a visualforce page that, when the user clicks a button, creates a new record (profile) based on the current record (opportunity).

 

I want to link the new profile to the existing opportunity via a lookup on the existing record (essentially creating a 1:1 relationship).

 

At what point in my code and how can I edit the existing opportunity profile field to update it to the newly created profile id?

 

I have tried the following, but it does not work:

 

 

// Create the project
try {
res = sforce.connection.create([project]);
} catch (err) {
alert(err);
}
if (res[0].getBoolean("success")) {
ret = res[0].id;

sourceOpp.Project_Profile__c = project.Id;

}

return (ret);
}

 

 Note: this page is written in javascript.

 

 

 

I'm working on a trigger that would pull in the owner's name from the owner of a lead/contact associated with a task (aka: whoId).

 

I'm planning on using this to compare users that are logging tasks for any leads or contacts that actually don't belong to them.

 

Task > WhoId > Owner > First Name & Last Name

 

How do I retrieve the owner? Do I have to conditionally determine if the WhoId refers to a contact or lead before attempting to grab the owner id? Or can I use a more general method?

I want to allow users to click on the account name (or have a link in a fourth column that says 'View this Account') and be directed to the record.

 

Have searched and it's probably right in front of me, but I can't figure it out. 

 

Source of vf page template: http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_methods.htm

 

<apex:page controller="SearchBeforeAddingController">
<apex:form >
<apex:pageBlock mode="edit" id="block">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel for="searchText">Search for:</apex:outputLabel>
<apex:panelGroup >
<apex:inputText id="searchText" value="{!searchText}"/>
<apex:commandButton value="Go!" action="{!doSearch}"
rerender="block" status="status"/>
</apex:panelGroup>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:actionStatus id="status" startText="searching existing accounts... please wait..."/>
<apex:pageBlockSection title="These Accounts Potentially Match:" id="results" columns="1">
<apex:pageBlockTable value="{!results}" var="a"
rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.site}"/>
<apex:column value="{!a.AKA__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


 

I want to automatically run a save action when the user clicks
on the "Close Opportunity" button on this visualforce page.

 

Existing code:

<input class="btn" type="button" title="Close Opportunity" name="close" value=" Close Opportunity " onClick="onClickClose()"/> <apex:commandButton action="{!cancel}" value="Cancel" id="cancelButton"/> <apex:outputText value="" id="status"/>

 

How can I add this functionality to the existing button? or to the
onClickClose function?

I don't want the save function to send the user back to the record,
but to the location as determined inthe onClickClose function.

 

Likely a simple answer, but I'm struggling.

Thanks to anyone willing to help!


 

I have a custom button on a list view of contacts that allows users to check off as many as they want and then click the button. The button will check off a custom field on each contact's record.

 

Limited success. This works, but only when I choose 1 or 2 contacts. Any more than that and I get a "sforce is not defined" error.

 

Any insight as to why this is happening?

 

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")} var connection = sforce.connection; var contactid = {!GETRECORDIDS( $ObjectType.Contact)}; // Make sure at least one Contact is selected if (!contactid.length) { alert("Please select at least one contact to enroll."); } else { var contact_to_update = new Array(); for (var i = 0; i < contactid.length; i++) { var callList = new sforce.SObject("Contact"); // Since we'll be using the update call, we must set the id // on the new job application record. callList.Id = contactid[i]; callList.Spring_Flying_Campaign__c="TRUE"; contact_to_update.push(callList); // Now make the update API call in a try statement so we can // catch any errors. Save the resulting array so we can also // check for problems with individual records. // var callCompleted = false; try { var result = sforce.connection.update(contact_to_update); callCompleted = true; } catch(error) { alert("Failed to update Field with error: " + error); } // Now check for problems with individual records. // if (callCompleted) { for (var i = 0; i < result.length; i++) { if (!result[i].getBoolean("success")) { alert("Contact (id='" + contactid[i] + "') could not be updated with error: " + result[i].errors); } } // Finally, refresh the browser to provide confirmation // to the user that the job applications were rejected. // window.location.reload(true); } } }

 

Note: Modified code from several other users but have forgotten who. So, thanks to those who shared their code!

 

Am a newbie trying to add an inputfield to a visualforce page that allows the user to change the Opp'ty Close Date. (I've only pasted the part of my code that is problematic.)

 

var changeCloseDate = document.getElementById("{!$Component.f.pb.pbs.si4.closeDate}");


oppToClose.CloseDate changeCloseDate;

<apex:pageBlockSectionItem id="si4">
<apex:outputLabel value="Close Date"/>
<apex:inputField id="closeDate" value="{!Opportunity.CloseDate}"/>
</apex:pageBlockSectionItem>

Getting error: {faultcode:'soapenv:Client',faultstring:"4/1/2009' is not a valid value for the type xsd:date',}

 

Do I have to format the date a different way?

Tried a few changes, but then started getting error: {faultcode:'soapenv:Client',faultstring:"[object HTMLInputElement]" is not a valid value for the type xsd:date',}

Suggestions welcome!

 

 

I am using a trigger to update an associated record whenever the first record is modified. I am only testing this on one field at the moment.

 

On the first record, I make a change to the data, then when I click save, I expect it to update the related record (but not necessarily inform me that it did so).

 

I'm getting this error:

Error:Apex trigger Updated_Associated_Project caused an unexpected exception, contact your administrator: Updated_Associated_Project: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Updated_Associated_Project: line 49, column 43

 

Any suggestions as to the cause?

 

Here's my code:

 

trigger Updated_Associated_Project on Opportunity (after update) { // The purpose of this trigger is to pass values from the Opportunity to the Project so that // users don't have to manually update both when changes are made. // This trigger will pass all related values to the associated Project. // Future idea: Inform user of number of fields that were updated? // Should this just mass update all of them, or review each field to see if it's different // and then update? // ----------------------------------------------------------------------- // Locate project that has this Opportunity as its parent // ------------ code recycled from sf code cookbook------------ // The map allows us to keep track of the Opportunities that have // changes to update the Projects with Map<Id, Opportunity> OppsThatHaveBeenUpdated = new Map<Id, Opportunity>(); // Trigger.new is a list of the Opportunities that will be updated // This loop iterates over the list, and adds any that have had // changes to the OppsThatHaveBeenUpdated map. for (Integer i = 0; i < Trigger.new.size(); i++) { if ( (Trigger.old[i].Acquisition_Specifications__c != Trigger.new[i].Acquisition_Specifications__c)) { OppsThatHaveBeenUpdated.put(Trigger.old[i].id, Trigger.new[i]); } } List<Summary__c> updatedProjects = new List<Summary__c>(); for (Summary__c s : [SELECT Id, Acquisition_Specifications__c FROM Summary__c WHERE Opportunity__c in :OppsThatHaveBeenUpdated.keySet()]) { Opportunity parentOpportunity = OppsThatHaveBeenUpdated.get(s.Id); s.Acquisition_Specifications__c = parentOpportunity.Acquisition_Specifications__c; // Add projects to list and bulk update updatedProjects.add(s); } update updatedProjects; }

 

 

 

 

 

I am very new to writing triggers. I've been reading the cookbook and scouring the community for similar newbie posts. I know this is a simple concept, but I'm unsure of how to proceed. Any guidance would be appreciated.

What I Want to Do: Populate a custom field on the Task object with a custom picklist value on the User object. (If a lookup to the user object was possible, this would solve all my problems!)

My Method: So far, this is what I've got. Pretty pathetic. 

I created a class like this:

 

public class DetermineUserRegion { // This class should automatically set the Region field to the assigned user's region User currentUserRegion = [Select region__c From User Where User.Id = Task.OwnerId ]; Task.User_Region__c = currentUserRegion; }

And then I was going to call that from the trigger. 

But, no success as of yet. Perhaps that isn't even the best method.

Any advice for a newbie?

 

Hi. Apparently long text fields are not supported in list views or formulas.
Error: You referenced an unsupported field type called "Long Text Area" using the following field: Description
I'm trying to develop a formula that will display the first sentence from a long text field.
I thought that I could use a FIND function to locate the first period, then return the text before that.
But, the long text field that I'm looking for is not shown as a field that I can insert. (I want to use Lead > Description) So, I just typed it in.

Some of my users have leads that are the same except for the description, and I'm trying to figure out a better way for distinguishing them from a list view. Otherwise they look like dupes. I don't want to add an extra custom text field that they have to enter.

Thoughts on how to resolve? Alternatives? Thanks in advance.
I read a tutorial about migrating custom objects, pages, etc., but I'm not sure if custom fiscal years can be transferred, and how that can be done. So, basic question: Is there a method for transferring custom fiscal years to production from a sandbox? (Typically, I keep track of and redo my sandbox modifications in the production environment, which is not the most effective way to 'transfer' changes. In fact, it's rather ridiculous.)

Please note, I don't have a whole lot of experience with Eclipse, if that is involved in the solution.

Kindly advise if you have any suggestions for better methods.

Thanks!
We currently have a fairly open data model, but I have restricted deletions to standard and custom objects for most profiles. However, users should be able to delete records that they own (such as when they realize that they have created a duplicate and need to delete one).

What is the most effective way to allow users under a certain profile to only delete records that they own?

Regards.
I have several legacy classes (around 20 of them) and triggers (about 5) that are no longer being used and I need to delete from our Salesforce org. However, our code coverage is currently 74% (needs to be at least 75%) because of issues with the code/test classes in those very same classes.

I've tried modifying the xml in Eclipse to set them to inactive/deleted but when I try to validate deploying those changes, I get errors on the test classes of the code that I am trying to remove. I've also attempted to follow these instructions to temporarily boost test class coverage just in order to remove those classes that are unnecessary. But again, the errors on the test classes won't allow me to continue deployment.

It seems that I have to first improve the test classes (note: I am not a programer and this code was written by someone no longer at my company) so that coverage improves in order to then delete them. 

I've tried combing through the errors... if I can make a change that will bump us up even by 1% that would resolve the issue I think... but I've got very minimal understanding of how the code functions and don't even know where to start.

Any suggestions?



 

I've got a visualforce page rendering as a PDF that is pulling in some contact details from a junction object, including Email address.

 

It looks like this:

 

screen capture

 

I'd like to strip the formatting of the text - no hyperlink, no 'Gmail' text.

 

My code looks like this:

 

          <apex:column >

              <apex:facet name="header">Email</apex:facet>
              <apex:outputField value="{!c.role.Contact_Name__r.Email}" />

          </apex:column>

 

 

Any tips?

I'm trying to modify the code in the awesome Campaign Membership Manager app in order to add a button that updates the status of all selected members to a specific option (which I want to hard code).

 

The existing button allows the user to remove the selected members.

 

I, uh, added the button. But as far as developing the functionality, I'm a dum dum.

 

 

This is my button: 

<apex:commandButton value="Update to Hand Deliver" action="{!updateSelectedStatusMail}" rendered="{!NOT(ISNULL(CampaignMembers))}" />

 

And here's the code:

 

/**
*  CMM Campaign Membership Manager
*  Copyright (c) 2009, Marcel Will, Sales Engineering, Salesforce.com Inc.
*  All rights reserved.
*
*  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
*  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*  Neither the name of the salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
*  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
*  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
*  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
*  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
*  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public with sharing class cmmCampaignMembershipManagerController{
    
    private List<myCampaignMember>  campaignMemberList { get; set; }   
    private List<myCampaignMember>  CampaignMembers;            
    private List<myCampaignMember>  pageCampaignMemberList;          
    private List<CampaignMember>    deleteCampaignMembers;      
    private Map<Id, CampaignMember> selectedCampaignMembersMap;
    
    private String  selectedCampaign;
    private String  CampaignDescription;
    private String  userName;
    private String  userLanguage;
    private Integer pageNumber;
    private Integer pageSize;
    private integer totalPageNumber;
    private Integer selectedRows; 
    
    public Boolean selectAllCheckbox        { get; set; }
    public String  messageTitle             { get; set; }
    public String  messageDetail            { get; set; }
    public String  messageSeverity          { get; set; }
    transient public Boolean messageShow    { get; set; }
    
    /**
    * constructor
    */
    public cmmCampaignMembershipManagerController(){
        
        this.CampaignMembers            = new List<myCampaignMember>{};
        this.pageCampaignMemberList     = new List<myCampaignMember>{}; 
        this.deleteCampaignMembers      = new List<CampaignMember>();
        this.selectedCampaignMembersMap = new Map<Id, CampaignMember>();
        
        this.userName       = UserInfo.getUserId();
        this.userLanguage   = UserInfo.getLanguage();
        
        this.pageNumber         = 0;
        this.totalPageNumber    = 0;
        this.selectedRows       = 0;
        this.pageSize           = 10;
    }
    
    /**
    * Getter method to retrieve the user language
    * @return userLanguage
    */
    public String getUserLanguage(){
        return userLanguage.Substring( 0, 2 );
    }
    
    /**
    * Getter Method to retrieve the current page number
    * @return pageNumber
    */
    public Integer getPageNumber(){
        return pageNumber;
    }
    
    /**
    * Getter method to retrieve the page size
    * @return pageSize
    */
    public Integer getPageSize(){
        return pageSize;
    }
    
    /**
    * Getter method to enable previous button
    * @return Boolean
    */
    public Boolean getPreviousButtonEnabled(){
        return !( pageNumber > 1 );
    }
    
    /**
    * Getter method to enable Next button
    * @return Boolean
    */
    public Boolean getNextButtonEnabled(){
        if( campaignMemberList == null ){
            return true;
        }else{
            return ( ( pageNumber * pageSize ) >= campaignMemberList.size() );
        }
    }
    
    /**
    * Getter method to retrieve total page number
    * @return totalPageNumber
    */
    public Integer getTotalPageNumber(){
        
        totalPageNumber = campaignMemberList.size() / pageSize;
        Integer mod     = campaignMemberList.size() - ( totalPageNumber * pageSize );
        
        if( mod > 0 ){
            totalPageNumber++;
        }
        
        return totalPageNumber;
    }
    
    /**
    * Getter method to retrieve Campaign member list
    * @return List<myCampaignMember>
    */
    public List<myCampaignMember> getCampaignMembers(){
        
        if( pageCampaignMemberList.Size() > 0 ){
            return pageCampaignMemberList;
        }else{
            return null;
        }
    }   
    
    /**
    * Getter to retrieve the number of selected rows
    * @return selectedRows
    */
    public Integer getSelectedRows(){
        return this.selectedRows;
    }
    
    /**
    * Recalculate Number of selected items in Grid
    * @return null
    */
    public Integer recalculateSelected(){
        selectedRows = selectedCampaignMembersMap.size();
        return null;
    }
    
    /**
    * Bind data to paged list for displaying on VF page
    * @param newPageIndex
    */
    private void BindData( Integer newPageIndex ){
        
        try{

            Transient Integer counter   = 0;
            Transient Integer min       = 0;
            Transient Integer max       = 0;
            
            if( newPageIndex > PageNumber ){
                min = pageNumber * pageSize;
                max = newPageIndex * pageSize;
            }else{
                max = newPageIndex * pageSize;
                min = max - pageSize;
            }
            
            CampaignMembers.clear();
            pageCampaignMemberList.clear();
            
            for( myCampaignMember cm: CampaignMemberList ){
                counter++;
                if( counter > min && counter <= max ){
                    pageCampaignMemberList.add( cm );
                }
            }
            pageNumber = newPageIndex;
            if( pageCampaignMemberList == null || pageCampaignMemberList.size() <= 0 ){
                messageTitle        = 'CMM_No_data';
                messageDetail       = 'CMM_No_data_available';
                messageSeverity     = 'info';
                messageShow         = true;
            }
        }catch( Exception ex ){
            messageTitle    = ex.getMessage();
            messageDetail   = ex.getMessage();
            messageSeverity = 'fatal';
            messageShow     = true;
        }
    }
    
    /**
    * Search for all Campaign Members of a selected campaign and put them into a list of <myCamapaignMember>
    * @return PageReference
    */
    public PageReference DoSearch(){
        
        this.campaignMemberList = new List<myCampaignMember>();
        this.pageCampaignMemberList.clear();
        
        for( CampaignMember cm: [ Select Id, LeadId, Lead.Company, Lead.Email, Lead.FirstName, Lead.LastName, Lead.OwnerId, Lead.City, ContactId, 
                                    Contact.Account.Name, Contact.Email, Contact.FirstName, Contact.LastName, Contact.OwnerId, Contact.MailingCity, Status 
                                    from CampaignMember 
                                    WHERE CampaignId =: selectedCampaign AND ( Contact.OwnerID =: userName OR Lead.OwnerID =: userName ) 
                                    ORDER BY Lead.LastName, Contact.LastName ] ){
                                        
            this.campaignMemberList.add( new MyCampaignMember( cm ) );
        }
        
        this.BindData( 1 );
        this.selectedRows = 0;
        
        return null;
    }   
    
    /**
    * Action method on next button
    * @return PageReference
    */
    public PageReference nextBtnClick(){
        
        clearMessage();
        updateSelectedList();       
        BindData( pageNumber + 1 );
        
        return null;
    }
    
    /**
    * Action method on previous button
    * @return PageReference
    */
    public PageReference previousBtnClick(){
        
        clearMessage();
        updateSelectedList();       
        BindData( pageNumber -1 );
        
        return null;
    }
    
    /**
    * This method clears the message on the visual force page.
    * @return PageReference
    */
    public pageReference clearMessage(){
        this.messageShow = false;
        return null;
    }
    
    /**
    * Get Campaign Description for selected Campaign to show on VF page     
    * @return CampaignDescription
    */                
    public String getCampaignDescription(){
        
        CampaignDescription = 'CMM_Select_Campaign';
        
        if( selectedCampaign != null ){
            Campaign myCampaign = [ select id, description from Campaign where id =: selectedCampaign ];
            CampaignDescription = myCampaign.Description;
        }
        
        return CampaignDescription;
    }

    /**
    * Update list of selected records for processing 
    */ 
    public void updateSelectedList(){
        List<myCampaignMember> members = this.getCampaignMembers();
        if( members != null ){
            for( myCampaignMember mcMember : getCampaignMembers() ){
                if( mcMember.selected == true ){
                    selectedCampaignMembersMap.put( mcMember.campmem.id, mcMember.campmem );
                }else{
                    selectedCampaignMembersMap.remove( mcMember.campmem.id );
                }
            }
            
            selectedRows = selectedCampaignMembersMap.size();
        }
    }

    /**
    * Delete selected campaign members
    * @return PageReference
    */
    public PageReference updateSelectedStatusMail(){
        
        updateSelectedList();
        deleteCampaignMembers.clear();
        deleteCampaignMembers = selectedCampaignMembersMap.values();
        
        try{
            if( deleteCampaignMembers.size() > 0 ){
                delete deleteCampaignMembers;
                messageTitle    = 'CMM_Successful';
                messageDetail   = deleteCampaignMembers.size() + ' ' + 'CMM_Successfully_removed';
                messageSeverity = 'confirm';
                messageShow = true;
            }
            else{
                messageTitle    = 'CMM_Error';
                messageDetail   = 'Please select at least one member';
                messageSeverity = 'fatal';
                messageShow = true;
            }
        }catch( DmlException e ){
            messageTitle    = 'CMM_Error';
            messageDetail   = e.getMessage();
            messageSeverity = 'fatal';
        }finally{
            messageShow = true;
        }
        
        campaignMemberList.clear();
        selectedCampaignMembersMap.clear();
        selectedRows = 0;
        DoSearch(); 
        
        return null;
    }
    
    
        /**
    * Update Status of Campaign Members to 'Hand Deliver'
    * Customization added October 18, 2011
    * @return PageReference
    */
    public PageReference processSelected(){
        
        updateSelectedList();

        
        campaignMemberList.clear();
        selectedCampaignMembersMap.clear();
        selectedRows = 0;
        DoSearch(); 
        
        return null;
    }

    /**
    * Get list of all Campaigns with Status equals to "Planned" and with Active equals to "true"
    * @return List<SelectOption>
    */
    public List<SelectOption> getCampaigns(){
        
        List<SelectOption> options  = new List<SelectOption>();
        List<Campaign> cList        = new List<Campaign>();
        
        try {
            cList = [ SELECT Id, Name, Description FROM Campaign WHERE Status = 'Planned' AND IsActive = true ORDER BY Name ];
            for( Campaign c: cList ){
                options.add( new SelectOption( c.Id, c.Name ) );
            }
            
            if( cList == null || cList.size() <= 0 ){
                // Show Info Message that no records have been found
                messageTitle    = 'CMM_No_data';
                messageDetail   = 'CMM_No_Campaign';
                messageSeverity = 'info';
                messageShow     = true;
                
                return null;    
            }else{
                return options;
            }        
        }catch( Exception ex ){
           // Show error Message with severity FATAL
           // messageTitle  = 'CMM_Error';
           // messageDetail     = ex.getMessage();
           //messageSeverity = 'fatal';
           //messageShow    = true;
           return null;
        } 
    }
    
    /**
    * Getter method to retreieve the selected campaing
    * @return selectedCampaign
    */
    public String getSelectedCampaign(){
        return this.selectedCampaign;
    }
    
    /**
    * Setter method to set te selected Campaign
    * @param selectedCampaign
    */
    public void setSelectedCampaign( String selectedCampaign ){
        this.selectedCampaign = selectedCampaign;
    }     
    
    /**
    * Inner Class 
    * myCampaignMember to extend CampaignMember object with selected field (checkbox, boolean)
    */
    public class myCampaignMember{
        
        public CampaignMember campmem   { get; set; }
        public Boolean selected         { get; set; }
        
        /**
        * Constructor
        */
        public myCampaignMember( CampaignMember cm ){
            this.campmem    = cm;
            this.selected   = false;
        }
    } 
}

 

I'm using the Campaign Membership Manager 1.0 app by Force.com Labs. Unfortunately, it seems that having mutli-currency enabled is causing a problem with the code. 

 

Invalid field CurrencyIsoCode for SObject CampaignMember 

 

I attempted to resolve this problem myself by updating the query in the app controller by adding the CurrencyIsoCode to both the CampaignMember and Campaign queries. But, I get this error when I try to save in Eclipse:

 

No such column 'CurrencyIsoCode' on entity 'CampaignMember'.

 

I have double checked the spelling and actually copied the api name from the Setup > Campaign Members field listing. So, I know that it exists on the CampaignMember object. I'm just confused as to why it won't let me include that field.

 

It's pretty pointless because we aren't using the Multi-Currency field. We enabled it in the past because a consultant told us to but we are only using dollars.

 

Here is the query that I am updating:

 

 

        for( CampaignMember cm: [ Select Id, CurrencyIsoCode, LeadId, Lead.Company, Lead.Email, Lead.FirstName, Lead.LastName, Lead.OwnerId, Lead.City, ContactId, 
        							Contact.Account.Name, Contact.Email, Contact.FirstName, Contact.LastName, Contact.OwnerId, Contact.MailingCity, Status
        							from CampaignMember 
        							WHERE CampaignId =: selectedCampaign AND ( Contact.OwnerID =: userName OR Lead.OwnerID =: userName ) 
        							ORDER BY Lead.LastName, Contact.LastName ] ){
        								
            this.campaignMemberList.add( new MyCampaignMember( cm ) );
        }
        

 

Any tips as to why this may be happening or how I can reformat the query?

 

The ID for custom fields in salesforce begins with a number. When using Internet Explorer, when we use web-to-lead & try to pass information from a form into salesforce, the custom field information does not get passed. Other information (oid, first name, last name) gets passed fine. And when using Firefox, Chrome or Safari, all information passes through correctly (although in these browsers, we are using ajax/javascript to submit the forms, as opposed to using the standard form action method=POST in IE).


In our HTML <form>, we use <input> elements (type=hidden), where the name & id attributes are equal to the salesforce custom field ID. However, starting an id or name attribute with a number is improper HTML (according to the w3c).
We have also tried using the custom field name in salesforce, but that did not work in IE either.

What's weird is that some of the fields are passing through (oid, first name, etc.), and the lead is being created, but we are still missing a few of our custom fields.

Is there a way to change the custom field IDs in salesforce to begin with a letter instead of a number? We'd like to try that.

Or if you have other/better suggestions, we'd really appreciate it.

 

I'm trying to build my first actual visualforce page on my own (well, borrowing heavily from examples). And this is what I get for being too uppity. I'm stuck.

My Goal:
Create a custom list on Contracts that shows all related Opportunities (where Contract__c on the Opportunity = the currently viewed Contract Id) on the Contract page layout. Eventually, I want to create a total of the Amounts and use this to compare to the total contract value. (We have a data model where many opps can be related to one contract.)

What I Was Thinking:

I created a Contract controller extension, borrowing from this other post and following the directions here.

public class ContractExtension { public List<Opportunity> ChildOpportunities = new Opportunity[]{}; public List<Opportunity> getContractOpps() { ChildOpportunities = [SELECT o.Contract__r.Id, Amount, Id, StageName, CloseDate FROM Opportunity o WHERE o.Contract__r.Id = :System.currentPageReference().getParameters().get('id') ]; return ChildOpportunities; } }

But, when I include the reference to the extension on my visualforce page, I get an error. "Unknown constructor 'ContractExtension.ContractExtension(Apex.Pages.StandardController controlller)'

Here's my page:

<apex:page standardController="Contract" extensions="ContractExtension"> <apex:detail id="ChildOpps_v1" relatedList="true"> <apex:relatedList id="ChildOpportunities" list="Opportunities" title="Child Opportunities" subject="{!ContractOpps}"> </apex:relatedList> </apex:detail> </apex:page>

 Any helpful tips for a vf newbie?


 

 

Goal: use a trigger to update a custom field on the Task (OppNumber) with a field on the Opportunity that is selected in the WhatID field (if an Opp is selected)

 

I thought this would be easy to do using a lookup and just passing the value, but you apparently cannot create a lookup on the Activity/Task object. 

 

I know I can pull in the record ID for the opp related via the WhatID field, but how can I refer to a specific field on that record? (Such as the Opportunity Number).

 

Open to suggestions.

 

 

I have a custom formula field (text)

 

Formula is: HYPERLINK("/"& WhatId, "Detail Link")

 

It appears as this clickable link which takes you to the account detail page.

Detail Link

 

Does anyone know if and how I can update the formula so that instead of the static name "Detail Link", it can dynamically update to the Account Name value?


Thanks

  • September 11, 2009
  • Like
  • 0
Is there any way to simply add some descriptive text to a layout?  I'm creating a page layout for a custom object and I'd like some instructions on the page for my users...

I have a object called Insertion Order which have child objects Flights. The Flights have a Look Up relationship to the Insertion Order object.

 

I want to lock down the Insertion Order object and it's children Flights when it is reviewed by the finance team. I set up an approval process and change the Insertion Order object's record type to "Reviewed". I also changed the RecordType of the Flight to "Reviewed" also.

 

The issue is how do I remove the "Edit","Delete" links from the related list  of Flights which show up on the Insertion Order?

 

 

Why can I not put the standard Task/Event "Type" field on a custom report type that includes activities?  It seems like a no brainer that the Type field should be on there for filtering purposes.  I would use the standard report types for activities but I want to filter by contact id and that field is not available to me in the standard reports just the contact name.  When I say the standard reports I mean that ones that are called "Activities with Custom Object".  So my tasks are "Related To" the custom object and the "Who" is the contact id.  I can get all of the information I need with a custom report type except for the "Type" field it will not allow me to put that field on the report layout.  Any ideas? 
  • November 17, 2008
  • Like
  • 0
Here is part of the subroutine:

        my $self       = shift;
        my $changelist = shift;
        my $sObject_type = 'ADM_Work__c';

        if( $self->{_p4status} eq $GUS::OPEN_ONCE ) {

            print "\n\n ----------------------------------------------------------------------\n";
            print "$sObject_type, id => " . $self->{_id} . ", Perforce_Status__c => $GUS::NONE)";
            print "\n\n ----------------------------------------------------------------------\n";

            my $result = $self->{_sfdc}->update(type => $sObject_type, id => $self->{_id}, Perforce_Status__c => $GUS::NONE);
           
            if ($result->valueof("//updateResponse/result/success") ne 'true') {
                # log problem here
                print "unable to update p4 status";
            } else {
                $self->{_p4status} = $GUS::NONE;
            }
       
Here is the output:
 ----------------------------------------------------------------------
ADM_Work__c, id => a0HT0000000KIZbMAO, Perforce_Status__c => --None--)

 ----------------------------------------------------------------------

Type looks to be getting set from the print statement output??