• Mitchell McLaughlin 1
  • NEWBIE
  • 45 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 28
    Replies
Hi,

I'm trying to update a phone field conditionally, depending on what the Division is. This IF and ISPICKVAL doesn't seem to be working. Do you see an issue?
Perhaps I'm not sure when to use brackets vs parenthesis. 

Thanks!

/a3l/e?retURL=%2F{!Account.Id}&
&CF00N1h000000PTrn={!Account.Name}
&00N1h000000PTru={!Account.BillingCity}
&00N1h000000PTrr={!Account.BillingStreet}
&00N1h000000PTrx={!Account.BillingCountry}
&00N1h000000PTsi={!Account.BillingPostalCode}
&00N1h000000PTsZ={!Account.BillingStateCode}
&00N1h000000PTrt={!IF(
{!ISPICKVAL(!Account.Division__c, "Quad/Graphics Logistics"){!Account.Phone},
{!Account.Main_Phone_Text__c},
{!Account.Phone})}
&00N1h000000PTsF={!Account.Fax}
Hi -

I am trying to navigate to a visual force page, while passing parameters through the URL. Here is what it is without javascript, using the Display in existing window without sidebar or header via URL option.
/apex/QuoteRequestDetailsPage?OpportunitySegmentId={!Opportunity_Segment__c.Id}

I'd like to put this into javascript and add criteria on WHEN we allow people to navigate to this visual force page.

Here's my best try but i'm getting an error:

string url = "/apex/RFPDetailsPage?OpportunitySegmentId="+{!Opportunity_Segment__c.Id}+"&
OpportunityId="+{!Opportunity_Segment__c.Opportunity_ID__c};

window.location.href=url;

 
Hi -

I'm trying to set the Corresponding_Sales_VP__c trigger to a specific user record by using their ID. How do i do it?
 
trigger Set_Corresponding_VP on Compensation_Request__c(after insert) {
	List<Compensation_Request__c> requestsToUpdate = new List<Compensation_Request__c>();
    for(Compensation_Request__c reqs : Trigger.new){
        reqs.Corresponding_Sales_VP__c = //User Record with id 005j000000FmuFu
            requestsToUpdate.add(reqs);
    }
    update requestsToUpdate;
}

 

Hi -
I'm using soap api to call into salesforce to grab the account owner in one of my projects.
I want need to match it up with another record but the problem I'm having is that there is two different Id's and on some accounts it's sending an extended accuont owner id and on some it is sending a shorter one.
For example, one account owner sends the id as "a01j0000004rz0bAAA", which is the extended one and is exactly what it's looking for.
another account owner sends the id as "a01j000000IDetV" when it's looking for this extended ID, "a01j000000IDetVAAT"

Why is it in some cases it sends the extended and others it sends the shorter ID?

Thanks!
Mitchell
Mrmclaughli@qg.com

Hi -
I'm getting this error when I try to hard delete a Service_Staff_Assignment__c object record. 

Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger ServiceStaffAssignmentTrigger caused an unexpected exception, contact your administrator: ServiceStaffAssignmentTrigger: System.LimitException: Apex CPU time limit exceeded". 


Here's the trigger. 

trigger ServiceStaffAssignmentTrigger on Service_Staff_Assignment__c (after insert, after update, after delete) {
  if (Trigger.isAfter) {
    if (Trigger.isInsert) {
      Service_Staff_Assignment__c[] assignments = Trigger.new;
      ServiceStaffAssignmentServices.setSalesRepOnCustomerSegment(assignments);
      ServiceStaffSharing.newServiceStaffSharing(Trigger.new);
    } else if (Trigger.isUpdate) {
      Service_Staff_Assignment__c[] assignments = Trigger.new;
      ServiceStaffAssignmentServices.setSalesRepOnCustomerSegment(assignments);
    } else if (Trigger.isDelete) {
      ServiceStaffSharing.deleteServiceStaffSharing(Trigger.oldMap, Trigger.newMap);
    }
  }
}

The strange thing is I cannot replicate the problem in the Beta environment, and I cannot edit/inactivate the trigger directly in production. The only thing I can think of is to promote this trigger when it's deactivate back to production, or possibly delete the trigger some how, and then put it back into the system.

I don't think the trigger is a big issue, because it's only one record!!

Any suggestions on maybe how to hard delete directly from the database, or get around this trigger, or fix this trigger perhaps?

Thanks!

Hi, I see there a few critical updates coming up. For example, this one has 0 days remaining....
PageReference getContent() and getContentAsPDF() Methods Treated as Callouts

Is there anyway to scan through all clsses to see if we use either of these functions?

Does anyone have experience with this update breaking anything?

Thanks!
Hi everyone -

We recently implemented state/country picklists. We use an integration value for replication via Outbound Messaging. Unfortunately, this integration value is flooding our system with bad data. On an object that looks up to an account, it has a formula field named Account Country, that is set to Account__r.Country.

It is setting it to the integration value, is there a way to set it to the display name of the picklist instead of integration value?

Thanks!
Hi, 
We just started using Agile accelerator. is there a way to turn off the emails from agile? Or set preferences for what we want to get emailed on?

Thanks!
I am trying to update a role on service staff assignments... We have a trigger that is erroring out. it appears its a package of imported code that i am not able to see the actual error. The weird part is with data loader it errors out, manually updated one at a time works just fine.

How can i go about mass updating these 400 records? How can i see why it errorred out?

User-added image

it appears on google other people have this error too. but no direct responses on a fix.

User-added image

Hi - 

I'm looking for a solution to clone an opportunity in Salesforce.
I'm assuming i will need a customized clone button, which i already created and will need to tie some APEX code to it.
The difference between the standard clone and what i need to do is that i want to copy all of the fields to the new opportunity, from the old one, and also an opportunity holds "opportunity segments" which there can be multiple.
I also want to recreate these opportunity segments and tie them to my new opportunity, just like the old opportunity... but an exact copy.

My company is very against Visual Force too. Is there anyway to just add the action onto the custom button?

Any advice helps, thank you so much!

Hi - 

Using SOAP API, our API User cannot view the MediumPhotoUrl field. Apparently this is on the CollaborationGroup object and is new in summer release as of yesterday. How do i give my API user access visibility to this field? I believe i need to update the API version but how??



INVALID_FIELD: 

Market__c, Media_Solutions__c, MediumPhotoUrl, MiddleName, MobilePhone

                               ^

ERROR at Row:1:Column:866

No such column 'MediumPhotoUrl' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
I currently use my sharing settings to hide "deactivated" accounts - so I set them to private and only show the accounts where my deactivated flag = false.
Since sharing settings have contracts under the same setting as accounts, how would i go about only sharing contracts to certain people?
And in more detail, how to go about using "Account Teams" to show who to share contracts with..
I only want people under an account team to be able to see the contracts within that account.

Isn't this possible to create a list similar to related lists, with Visual Force, and use Apex code to query for only several contracts we want to see? If so, then how would we use the account team in this process?

Thank you!!
I currently use my sharing settings to hide "deactivated" accounts - so I set them to private and only show the accounts where my deactivated flag = false.
Since sharing settings have contracts under the same setting as accounts, how would i go about only sharing contracts to certain people?
And in more detail, how to go about using "Account Teams" to show who to share contracts with..
I only want people under an account team to be able to see the contracts within that account.
Thank you!!
Hello - 

Is there a way through permission sets to give a user permissions to create new fields? We are using the Agile tool for developers and we want just a Force.com user to be able to create new fields for the sprint objects.
Is this possible?

Thanks.
Hello -

Am i able to convert this visual force page action into javascript on the action button, so i can add validation by checking that some fields are not null, onClick of going to this new page?

User-added image
Hello - Here's my code for my Request Validation Button on a lead. 

I got this error 
User-added image
 
{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")} 

var leadAddress = '{!Lead.Street}'; 
var leadCity = '{!Lead.City}'; 
var leadState = '{!Lead.State}'; 
var leadCountry = '{!Lead.Country}'; 
var leadZip = '{!Lead.PostalCode}'; 

if(leadAddress == null || leadAddress == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCity == null || leadCity == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadState == null || leadState == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCountry == null || leadCountry == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadZip == null || leadZip == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else{ 
var urlStr = '/a0J/e?' 
+ 'CF00Nj00000091TUH={!Lead.FirstName &" "& Lead.LastName }' 
+ '&CF00Nj00000091TUH_lkid={!Lead.Id}' 
+ '&retURL=%2F{!Lead.Id}' 
+ '&saveURL=%2F{!Lead.Id}' 
+ '&RecordType=012j0000000pfbL' 
+ '&ent=01Ij0000001EVex' 
+ '&00Nj00000091TU6={!Lead.Company}' 
+ '&00Nj00000091TUQ=Pending'; 

window.open(urlStr,"_self") 
}


I found out that this error happens if the address is filled in as two lines, because it's a "long text" field maybe?
If the street field is filled out as "1008 W. 8th Avenue, Ste. E" It is okay. But as soon as it becomes two lines, like this
"1008 W. 8th Avenue
Ste. E" it throws this error. 

Can someone tell me what i can do about this?

Thanks!
 
Hello - I'm using this java script on my button to make sure the address is filled out... But since i started using window.open it opens this new page in a new tab.
I want it to be the same tab and just go to the new page like before. Is there a different function i should be using to open this?
 
{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")} 

var leadAddress = '{!Lead.Street}'; 
var leadCity = '{!Lead.City}'; 
var leadState = '{!Lead.State}'; 
var leadCountry = '{!Lead.Country}'; 
var leadZip = '{!Lead.PostalCode}'; 

if(leadAddress == null || leadAddress == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCity == null || leadCity == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadState == null || leadState == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCountry == null || leadCountry == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadZip == null || leadZip == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else{ 
var urlStr = '/a0J/e?' 
+ 'CF00Nj00000091TUH={!Lead.FirstName &" "& Lead.LastName }' 
+ '&CF00Nj00000091TUH_lkid={!Lead.Id}' 
+ '&retURL=%2F{!Lead.Id}' 
+ '&saveURL=%2F{!Lead.Id}' 
+ '&RecordType=012j0000000pfbL' 
+ '&ent=01Ij0000001EVex' 
+ '&00Nj00000091TU6={!Lead.Company}' 
+ '&00Nj00000091TUQ=Pending'; 

window.open(urlStr); 

}



Thanks!
Hello - I am trying to add present a different "contract number" than what is already being presented on my contract page. 
See below, i'd like to present 9721 to where 00000216 is. This custom field that shows 9721 is Contract_Number__c.
User-added image
Someone presented this code... And i created it through a new visual force page and it worked. But we already have a visual force page that we're using.
<apex:page standardController="Contract" >
<apex:detail subject="{!Contract.Id}" relatedList="false" title="true"/>
<script>
      document.getElementsByClassName('pageDescription')[0].innerHTML ='{!Contract.Contract_Number__c}';
  </script>
​</apex:page>
But it DID NOT work when i added it to my existing visual force page.
Where can i add this code in here to make this work?
 
<apex:page standardController="Contract" extensions="ContractPageController" action="{!redirectNoOverride}">

    <apex:sectionHeader title="Contract" subtitle="{!Contract.ContractNumber}" />
        <apex:pageBlock title="Contract Detail" rendered="{!AND(displayDetails, Contract.RecordType.DeveloperName == 'QGE_Order_Confirmation')}">
            <apex:form >
                <apex:inputhidden value="{!Contract.OwnerId}" />
                <apex:inputhidden value="{!Contract.Opportunity_Segment__r}" />
                <apex:inputhidden value="{!Contract.Opportunity_Segment__r.Customer_Segment__c}" /> 
                <apex:inputhidden value="{!Contract.RecordType.DeveloperName}" /> 
            </apex:form>
            <apex:pageBlockButtons >
                <apex:form >
                    <apex:commandButton action="{!edit}" value="Edit"/>
                    <apex:commandButton action="{!delete}" value="Delete"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Clone, Contract.Id)}" value="Clone"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Order_Confirmation, Contract.Id)}" value="Order Confirmation"/>
                </apex:form>
            </apex:pageBlockButtons>

            <apex:pageBlockSection title="Informacje o kontrakcie">
                <apex:outputField value="{!Contract.Order_Confirmation_Type__c}"/>
                <apex:outputField value="{!Contract.Link_to_PDF__c}"/>
                <apex:pageBlockSectionItem />
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Agreement_Format__c}"/>
                <apex:outputField value="{!Contract.Contract_Representative__c}"/>
                <apex:outputField value="{!Contract.Name}"/>
                <apex:outputField value="{!Contract.Account.Name}"/>
                <apex:outputField value="{!Contract.ContractNumber}"/>
                <apex:outputField value="{!Contract.Account_Number__c}"/>
                <apex:outputField value="{!Contract.Contract_Status__c}"/>
                <apex:outputField value="{!Contract.Background_Check__c}"/>
                <apex:outputField value="{!Contract.One_shot_Job__c}"/>
                <apex:outputField value="{!Contract.Data_Security__c}"/>
                <apex:outputField value="{!Contract.Credit_Request__c}"/>
                <apex:outputField value="{!Contract.Contract_Language__c}"/>
                <apex:outputField value="{!Contract.Payer_Name__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Payer_Street_Address__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Payer_Zip__c}"/>
                <apex:outputField value="{!Contract.Payer_Country__c}"/>
                <apex:outputField value="{!Contract.Payer_Vat__c}"/>
                <apex:outputField value="{!Contract.Payer_City__c}"/>
                <apex:outputField value="{!Contract.Price_Schedule_Number__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Print_all_legal_paragraphs__c}" />
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Dane dot. zamówienia">
                <apex:outputField value="{!Contract.Order_Account_Name__c}"/>
                <apex:outputField value="{!Contract.Files_PDF_Delivery_Date__c}"/>
                <apex:outputField value="{!Contract.Contact_Client__c}"/>
                <apex:outputField value="{!Contract.Approval_for_Printing_Date__c}"/>
                <apex:outputField value="{!Contract.Contact_Supplier__c}"/>
                <apex:outputField value="{!Contract.Delivery_Date__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Dane dot. tytułu">
                <apex:outputField value="{!Contract.Opportunity_Segment__c}"/>
                <apex:outputField value="{!Contract.Customer_Segment_Name__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Zakres prac">
                <apex:outputField value="{!Contract.Scope_of_Work__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Volume__c}"/>
                <apex:outputField value="{!Contract.Size__c}"/>
                <apex:outputField value="{!Contract.Paper_Body__c}"/>
                <apex:outputField value="{!Contract.Size_Unit__c}"/>
                <apex:outputField value="{!Contract.Paper_Cover__c}"/>
                <apex:outputField value="{!Contract.Packing__c}"/>
                <apex:outputField value="{!Contract.Colours__c}"/>
                <apex:outputField value="{!Contract.Finishing__c}"/>
                <apex:outputField value="{!Contract.Artwork__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Printing_form__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Print_run__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Finanse">
                <apex:outputField value="{!Contract.Prices_base_of_quotation__c}"/>
                <apex:outputField value="{!Contract.TOTAL_AMOUNT__c}"/> 
                <apex:outputField value="{!Contract.Standard_Payment_Term__c}"/>
                <apex:outputField value="{!Contract.MFG_value__c}"/> 
                <apex:outputField value="{!Contract.Incoterms__c}"/>
                <apex:outputField value="{!Contract.Paper_value__c}"/> 
                <apex:outputField value="{!Contract.Delivery_Terms_Additional_informations__c}"/>
                <apex:outputField value="{!Contract.Freight_Value__c}"/>
                <apex:outputField value="{!Contract.Additional_Notes__c}"/>
                <apex:outputField value="{!Contract.TOTAL_AMOUNT_1000__c}"/> 
                <apex:outputField value="{!Contract.Currency__c}"/>
                <apex:outputField value="{!Contract.MFG_Value_1000__c}"/> 
                <apex:outputField value="{!Contract.Refer_to_text__c}"/>
                <apex:outputField value="{!Contract.Paper_Value_1000__c}"/>
                <apex:outputField value="{!Contract.Refer_to__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Fakturowanie">
                <apex:outputField value="{!Contract.Other_Details__c}"/>
                <apex:outputField value="{!Contract.eInvoice_Email__c}"/>
                <apex:outputField value="{!Contract.Nomenclature__c}"/>
                <apex:outputField value="{!Contract.Agreed_to_eInvoice__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Informacja ogólna">
                <apex:outputField value="{!Contract.Competitive_Pricing__c}"/>
                <apex:outputField value="{!Contract.Specified_Plant_Location__c}"/>
                <apex:outputField value="{!Contract.Discount__c}"/>
                <apex:outputField value="{!Contract.Freight_Agreement__c}"/>
                <apex:outputField value="{!Contract.Rebate__c}"/>
                <apex:outputField value="{!Contract.Title_Transfer__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive__c}"/>
                <apex:outputField value="{!Contract.Product_Storage_Days__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive_Notes__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Paper_Supplier__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Informacje systemowe">
                <apex:outputField value="{!Contract.CreatedBy.Name}"/>
                <apex:outputField value="{!Contract.LastModifiedBy.Name}"/>
                <apex:outputField value="{!Contract.Status}"/>
                <apex:outputField value="{!Contract.RecordType.Name}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock title="Contract Detail" rendered="{!AND(displayDetails, Contract.RecordType.DeveloperName == 'QGE_Standard_Contract')}">

<!--        <apex:pageBlockButtons >
                <apex:form >
                    <apex:commandButton action="{!edit}" value="Edit"/>
                    <apex:commandButton action="{!delete}" value="Delete"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Clone, Contract.Id)}" value="Clone"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Activate, Contract.Id)}" value="Activate"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Order_Confirmation, Contract.Id)}" value="Order Confirmation"/>
                </apex:form>
            </apex:pageBlockButtons>
 -->            <apex:pageBlockSection title="Contract Information">
                <apex:outputField value="{!Contract.Agreement_Format__c}"/>
                <apex:outputField value="{!Contract.Contract_Representative__c}"/>
                <apex:outputField value="{!Contract.Name}"/>
                <apex:outputField value="{!Contract.Account.Name}"/>
                <apex:outputField value="{!Contract.ContractNumber}"/>
                <apex:outputField value="{!Contract.Account_Number__c}"/>
                <apex:outputField value="{!Contract.Contract_Status__c}"/>
                <apex:outputField value="{!Contract.Background_Check__c}"/>
                <apex:outputField value="{!Contract.Previous_Contract__c}"/>
                <apex:outputField value="{!Contract.Data_Security__c}"/>
                <apex:outputField value="{!Contract.Currency__c}"/>
                <apex:outputField value="{!Contract.Non_Compete__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.No_Solicitation__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Term and Termination">
                <apex:outputField value="{!Contract.StartDate}"/>
                <apex:outputField value="{!Contract.Overall_Term_Length__c}"/>
                <apex:outputField value="{!Contract.Current_Term_Effective__c}"/>
                <apex:outputField value="{!Contract.Contract_Extension_Term__c}"/>
                <apex:outputField value="{!Contract.Current_Term_Signature__c}"/>
                <apex:outputField value="{!Contract.Early_Signature_Interval__c}"/>
                <apex:outputField value="{!Contract.EndDate}"/>
                <apex:outputField value="{!Contract.QG_Term_for_Convenience__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Clause__c}"/>
                <apex:outputField value="{!Contract.QG_TFC_Days_Notice__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Effective__c}"/>
                <apex:outputField value="{!Contract.Customer_Term_for_Convenience__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Detail__c}"/>
                <apex:outputField value="{!Contract.Customer_TFC_Days_Notice__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Notice__c}"/>
                <apex:outputField value="{!Contract.QG_Change_of_Control__c}"/>
                <apex:outputField value="{!Contract.auto_Renew_Notice_Notes__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Extension__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Termination_Notice_Received__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Date_of_Termination__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Termination_Notice_Received_Notes__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="General Information">
                <apex:outputField value="{!Contract.Competitive_Pricing__c}"/>
                <apex:outputField value="{!Contract.Specified_Plant_Location__c}"/>
                <apex:outputField value="{!Contract.Discount__c}"/>
                <apex:outputField value="{!Contract.Comail_Terms__c}"/>
                <apex:outputField value="{!Contract.Rebate__c}"/>
                <apex:outputField value="{!Contract.Freight_Agreement__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive__c}"/>
                <apex:outputField value="{!Contract.Title_Transfer__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive_Notes__c}"/>
                <apex:outputField value="{!Contract.Product_Storage_Type__c}"/>             
                <apex:outputField value="{!Contract.Paper_Supplier__c}"/>
                <apex:outputField value="{!Contract.Product_Storage_Days__c}"/> 
                <apex:outputField value="{!Contract.Paper_Purchasing_Agreement__c}"/>
                <apex:outputField value="{!Contract.Billable_Overrun_Underrun__c}"/>
                <apex:outputField value="{!Contract.PPA_Effective_Date__c}"/>
                <apex:outputField value="{!Contract.Billable_Overrun_Underrun_Notes__c}"/>
                <apex:outputField value="{!Contract.PPA_Expiration_Date__c}"/>
                <apex:outputField value="{!Contract.Most_Favored_Nations__c}"/>
                <apex:outputField value="{!Contract.Paper_Reconciliation__c}"/>
                <apex:outputField value="{!Contract.Financial_Audit__c}"/>
                <apex:outputField value="{!Contract.Paper_Requirement_Adjustment__c}"/>
                <apex:outputField value="{!Contract.Other_Audit__c}"/>
                <apex:outputField value="{!Contract.Paper_Storage__c}"/>
                <apex:pageBlockSectionItem />
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Current Price List Dates">
                <apex:outputField value="{!Contract.Price_Schedule_Number__c}"/>
                <apex:outputField value="{!Contract.Other_Pricing__c}"/>
                <apex:outputField value="{!Contract.Prep__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.List__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Labor Escalation Detail">
                <apex:outputField value="{!Contract.Section_Reference__c}"/>
                <apex:outputField value="{!Contract.Escalation_Effective_Month__c}"/>
                <apex:outputField value="{!Contract.Escalation_Notice_Due__c}"/>
                <apex:outputField value="{!Contract.Escalation_Frequency__c}"/>
                <apex:outputField value="{!Contract.Escalation_Structure__c}"/>
                <apex:outputField value="{!Contract.Percent_of_Index_Allowed__c}"/>
                <apex:outputField value="{!Contract.Escalation_Notes__c}"/>
                <apex:outputField value="{!Contract.Referenced_Index_Month__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Referenced_Index_Title__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Cap_on_Increase__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Allowance__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Ink & Materials Escalation Detail">
                <apex:outputField value="{!Contract.Ink_Escalation__c}"/>
                <apex:outputField value="{!Contract.Material_Escalation__c}"/>
                <apex:outputField value="{!Contract.Ink_Notice_Due__c}"/>
                <apex:outputField value="{!Contract.Material_Notice_Due__c}"/>
                <apex:outputField value="{!Contract.Ink_Escalation_Notes__c}"/>
                <apex:outputField value="{!Contract.Material_Escalation_Notes__c}"/>
                <apex:outputField value="{!Contract.Ink_Escalation_Notes_Notes__c}"/>
                <apex:outputField value="{!Contract.Material_Escalation_Notes_Notes__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Workflow Solutions">
                <apex:outputField value="{!Contract.Workflow_Contract_Type__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Annual_Value__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Billing_Month__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Billing_Frequency__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Software__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Number_of_Licenses__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="System Information">
                <apex:outputField value="{!Contract.CreatedBy.Name}"/>
                <apex:outputField value="{!Contract.LastModifiedBy.Name}"/>
                <apex:outputField value="{!Contract.Pricebook2}"/>
                <apex:outputField value="{!Contract.Status}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    <apex:relatedlist list="Contracted_Customer_Segments__r" rendered="{!AND(contractedCustSegAccess, displayDetails)}" />
    <apex:relatedlist list="Agreement_Escalation_History__r" rendered="{!AND(agreementEscalationHistoryAccess,displayDetails)}" />
    <apex:relatedlist list="CombinedAttachments" rendered="{!AND(displayDetails, OR(Contract.RecordType.DeveloperName == 'QGE_Order_Confirmation',Contract.RecordType.DeveloperName == 'QGE_Standard_Contract'))}" />

</apex:page>



Thanks!
 
Hello - 

Is there anyway to override the generated contract number with the new custom text field we are using, labeled as "Contract Number"?
So in this case, I'd want 00000218 to be replaced with 9723. User-added image
Hello -
I'm trying to switch this URL action on the button to a javascript action. Before, whatever was in window.open (see below) was alone and it was set to the URL behavior.
I'm still getting an illegal token error. I don't see what is going wrong.


{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")} 

var leadAddress = '{!Lead.Address}'; 
var leadCity = '{!Lead.City}'; 
var leadState = '{!Lead.State}'; 
var leadCountry = '{!Lead.Country}'; 


if(leadAddress == null || leadAddress == ''){ 
alert('Please enter Address before clicking on this button'); 

else if(leadCity == null || leadCity == ''){ 
alert('Please enter City before clicking on this button'); 

else if(leadState == null || leadState == ''){ 
alert('Please enter State before clicking on this button'); 

else if(leadCountry == null || leadCountry == ''){ 
alert('Please enter Country before clicking on this button'); 

else{ 
window.open(' 
/a0J/e? 
CF00Nj00000091TUH={!Lead.FirstName &" "& Lead.LastName } 
&CF00Nj00000091TUH_lkid={!Lead.Id} 
&retURL=%2F{!Lead.Id} 
&saveURL=%2F{!Lead.Id} 
&RecordType=012j0000000pfbL 
&ent=01Ij0000001EVex 
&00Nj00000091TU6={!Lead.Company} 
&00Nj00000091TUQ=Pending'); 
}
Hello - 

Is there a way through permission sets to give a user permissions to create new fields? We are using the Agile tool for developers and we want just a Force.com user to be able to create new fields for the sprint objects.
Is this possible?

Thanks.
Hi -

I am trying to navigate to a visual force page, while passing parameters through the URL. Here is what it is without javascript, using the Display in existing window without sidebar or header via URL option.
/apex/QuoteRequestDetailsPage?OpportunitySegmentId={!Opportunity_Segment__c.Id}

I'd like to put this into javascript and add criteria on WHEN we allow people to navigate to this visual force page.

Here's my best try but i'm getting an error:

string url = "/apex/RFPDetailsPage?OpportunitySegmentId="+{!Opportunity_Segment__c.Id}+"&
OpportunityId="+{!Opportunity_Segment__c.Opportunity_ID__c};

window.location.href=url;

 

Hi -
I'm using soap api to call into salesforce to grab the account owner in one of my projects.
I want need to match it up with another record but the problem I'm having is that there is two different Id's and on some accounts it's sending an extended accuont owner id and on some it is sending a shorter one.
For example, one account owner sends the id as "a01j0000004rz0bAAA", which is the extended one and is exactly what it's looking for.
another account owner sends the id as "a01j000000IDetV" when it's looking for this extended ID, "a01j000000IDetVAAT"

Why is it in some cases it sends the extended and others it sends the shorter ID?

Thanks!
Mitchell
Mrmclaughli@qg.com

Hi -
I'm getting this error when I try to hard delete a Service_Staff_Assignment__c object record. 

Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger ServiceStaffAssignmentTrigger caused an unexpected exception, contact your administrator: ServiceStaffAssignmentTrigger: System.LimitException: Apex CPU time limit exceeded". 


Here's the trigger. 

trigger ServiceStaffAssignmentTrigger on Service_Staff_Assignment__c (after insert, after update, after delete) {
  if (Trigger.isAfter) {
    if (Trigger.isInsert) {
      Service_Staff_Assignment__c[] assignments = Trigger.new;
      ServiceStaffAssignmentServices.setSalesRepOnCustomerSegment(assignments);
      ServiceStaffSharing.newServiceStaffSharing(Trigger.new);
    } else if (Trigger.isUpdate) {
      Service_Staff_Assignment__c[] assignments = Trigger.new;
      ServiceStaffAssignmentServices.setSalesRepOnCustomerSegment(assignments);
    } else if (Trigger.isDelete) {
      ServiceStaffSharing.deleteServiceStaffSharing(Trigger.oldMap, Trigger.newMap);
    }
  }
}

The strange thing is I cannot replicate the problem in the Beta environment, and I cannot edit/inactivate the trigger directly in production. The only thing I can think of is to promote this trigger when it's deactivate back to production, or possibly delete the trigger some how, and then put it back into the system.

I don't think the trigger is a big issue, because it's only one record!!

Any suggestions on maybe how to hard delete directly from the database, or get around this trigger, or fix this trigger perhaps?

Thanks!

Hi - 

I'm looking for a solution to clone an opportunity in Salesforce.
I'm assuming i will need a customized clone button, which i already created and will need to tie some APEX code to it.
The difference between the standard clone and what i need to do is that i want to copy all of the fields to the new opportunity, from the old one, and also an opportunity holds "opportunity segments" which there can be multiple.
I also want to recreate these opportunity segments and tie them to my new opportunity, just like the old opportunity... but an exact copy.

My company is very against Visual Force too. Is there anyway to just add the action onto the custom button?

Any advice helps, thank you so much!

Hi - 

Using SOAP API, our API User cannot view the MediumPhotoUrl field. Apparently this is on the CollaborationGroup object and is new in summer release as of yesterday. How do i give my API user access visibility to this field? I believe i need to update the API version but how??



INVALID_FIELD: 

Market__c, Media_Solutions__c, MediumPhotoUrl, MiddleName, MobilePhone

                               ^

ERROR at Row:1:Column:866

No such column 'MediumPhotoUrl' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Hello -

Am i able to convert this visual force page action into javascript on the action button, so i can add validation by checking that some fields are not null, onClick of going to this new page?

User-added image
Hello - Here's my code for my Request Validation Button on a lead. 

I got this error 
User-added image
 
{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")} 

var leadAddress = '{!Lead.Street}'; 
var leadCity = '{!Lead.City}'; 
var leadState = '{!Lead.State}'; 
var leadCountry = '{!Lead.Country}'; 
var leadZip = '{!Lead.PostalCode}'; 

if(leadAddress == null || leadAddress == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCity == null || leadCity == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadState == null || leadState == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCountry == null || leadCountry == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadZip == null || leadZip == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else{ 
var urlStr = '/a0J/e?' 
+ 'CF00Nj00000091TUH={!Lead.FirstName &" "& Lead.LastName }' 
+ '&CF00Nj00000091TUH_lkid={!Lead.Id}' 
+ '&retURL=%2F{!Lead.Id}' 
+ '&saveURL=%2F{!Lead.Id}' 
+ '&RecordType=012j0000000pfbL' 
+ '&ent=01Ij0000001EVex' 
+ '&00Nj00000091TU6={!Lead.Company}' 
+ '&00Nj00000091TUQ=Pending'; 

window.open(urlStr,"_self") 
}


I found out that this error happens if the address is filled in as two lines, because it's a "long text" field maybe?
If the street field is filled out as "1008 W. 8th Avenue, Ste. E" It is okay. But as soon as it becomes two lines, like this
"1008 W. 8th Avenue
Ste. E" it throws this error. 

Can someone tell me what i can do about this?

Thanks!
 
Hello - I'm using this java script on my button to make sure the address is filled out... But since i started using window.open it opens this new page in a new tab.
I want it to be the same tab and just go to the new page like before. Is there a different function i should be using to open this?
 
{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")} 

var leadAddress = '{!Lead.Street}'; 
var leadCity = '{!Lead.City}'; 
var leadState = '{!Lead.State}'; 
var leadCountry = '{!Lead.Country}'; 
var leadZip = '{!Lead.PostalCode}'; 

if(leadAddress == null || leadAddress == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCity == null || leadCity == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadState == null || leadState == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadCountry == null || leadCountry == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else if(leadZip == null || leadZip == ''){ 
alert('Please enter a valid Street Address along with the City, State/Province, Zip/Postal Code and Country before clicking on this button.'); 
} 
else{ 
var urlStr = '/a0J/e?' 
+ 'CF00Nj00000091TUH={!Lead.FirstName &" "& Lead.LastName }' 
+ '&CF00Nj00000091TUH_lkid={!Lead.Id}' 
+ '&retURL=%2F{!Lead.Id}' 
+ '&saveURL=%2F{!Lead.Id}' 
+ '&RecordType=012j0000000pfbL' 
+ '&ent=01Ij0000001EVex' 
+ '&00Nj00000091TU6={!Lead.Company}' 
+ '&00Nj00000091TUQ=Pending'; 

window.open(urlStr); 

}



Thanks!
Hello - I am trying to add present a different "contract number" than what is already being presented on my contract page. 
See below, i'd like to present 9721 to where 00000216 is. This custom field that shows 9721 is Contract_Number__c.
User-added image
Someone presented this code... And i created it through a new visual force page and it worked. But we already have a visual force page that we're using.
<apex:page standardController="Contract" >
<apex:detail subject="{!Contract.Id}" relatedList="false" title="true"/>
<script>
      document.getElementsByClassName('pageDescription')[0].innerHTML ='{!Contract.Contract_Number__c}';
  </script>
​</apex:page>
But it DID NOT work when i added it to my existing visual force page.
Where can i add this code in here to make this work?
 
<apex:page standardController="Contract" extensions="ContractPageController" action="{!redirectNoOverride}">

    <apex:sectionHeader title="Contract" subtitle="{!Contract.ContractNumber}" />
        <apex:pageBlock title="Contract Detail" rendered="{!AND(displayDetails, Contract.RecordType.DeveloperName == 'QGE_Order_Confirmation')}">
            <apex:form >
                <apex:inputhidden value="{!Contract.OwnerId}" />
                <apex:inputhidden value="{!Contract.Opportunity_Segment__r}" />
                <apex:inputhidden value="{!Contract.Opportunity_Segment__r.Customer_Segment__c}" /> 
                <apex:inputhidden value="{!Contract.RecordType.DeveloperName}" /> 
            </apex:form>
            <apex:pageBlockButtons >
                <apex:form >
                    <apex:commandButton action="{!edit}" value="Edit"/>
                    <apex:commandButton action="{!delete}" value="Delete"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Clone, Contract.Id)}" value="Clone"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Order_Confirmation, Contract.Id)}" value="Order Confirmation"/>
                </apex:form>
            </apex:pageBlockButtons>

            <apex:pageBlockSection title="Informacje o kontrakcie">
                <apex:outputField value="{!Contract.Order_Confirmation_Type__c}"/>
                <apex:outputField value="{!Contract.Link_to_PDF__c}"/>
                <apex:pageBlockSectionItem />
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Agreement_Format__c}"/>
                <apex:outputField value="{!Contract.Contract_Representative__c}"/>
                <apex:outputField value="{!Contract.Name}"/>
                <apex:outputField value="{!Contract.Account.Name}"/>
                <apex:outputField value="{!Contract.ContractNumber}"/>
                <apex:outputField value="{!Contract.Account_Number__c}"/>
                <apex:outputField value="{!Contract.Contract_Status__c}"/>
                <apex:outputField value="{!Contract.Background_Check__c}"/>
                <apex:outputField value="{!Contract.One_shot_Job__c}"/>
                <apex:outputField value="{!Contract.Data_Security__c}"/>
                <apex:outputField value="{!Contract.Credit_Request__c}"/>
                <apex:outputField value="{!Contract.Contract_Language__c}"/>
                <apex:outputField value="{!Contract.Payer_Name__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Payer_Street_Address__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Payer_Zip__c}"/>
                <apex:outputField value="{!Contract.Payer_Country__c}"/>
                <apex:outputField value="{!Contract.Payer_Vat__c}"/>
                <apex:outputField value="{!Contract.Payer_City__c}"/>
                <apex:outputField value="{!Contract.Price_Schedule_Number__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Print_all_legal_paragraphs__c}" />
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Dane dot. zamówienia">
                <apex:outputField value="{!Contract.Order_Account_Name__c}"/>
                <apex:outputField value="{!Contract.Files_PDF_Delivery_Date__c}"/>
                <apex:outputField value="{!Contract.Contact_Client__c}"/>
                <apex:outputField value="{!Contract.Approval_for_Printing_Date__c}"/>
                <apex:outputField value="{!Contract.Contact_Supplier__c}"/>
                <apex:outputField value="{!Contract.Delivery_Date__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Dane dot. tytułu">
                <apex:outputField value="{!Contract.Opportunity_Segment__c}"/>
                <apex:outputField value="{!Contract.Customer_Segment_Name__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Zakres prac">
                <apex:outputField value="{!Contract.Scope_of_Work__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Volume__c}"/>
                <apex:outputField value="{!Contract.Size__c}"/>
                <apex:outputField value="{!Contract.Paper_Body__c}"/>
                <apex:outputField value="{!Contract.Size_Unit__c}"/>
                <apex:outputField value="{!Contract.Paper_Cover__c}"/>
                <apex:outputField value="{!Contract.Packing__c}"/>
                <apex:outputField value="{!Contract.Colours__c}"/>
                <apex:outputField value="{!Contract.Finishing__c}"/>
                <apex:outputField value="{!Contract.Artwork__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Printing_form__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Print_run__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Finanse">
                <apex:outputField value="{!Contract.Prices_base_of_quotation__c}"/>
                <apex:outputField value="{!Contract.TOTAL_AMOUNT__c}"/> 
                <apex:outputField value="{!Contract.Standard_Payment_Term__c}"/>
                <apex:outputField value="{!Contract.MFG_value__c}"/> 
                <apex:outputField value="{!Contract.Incoterms__c}"/>
                <apex:outputField value="{!Contract.Paper_value__c}"/> 
                <apex:outputField value="{!Contract.Delivery_Terms_Additional_informations__c}"/>
                <apex:outputField value="{!Contract.Freight_Value__c}"/>
                <apex:outputField value="{!Contract.Additional_Notes__c}"/>
                <apex:outputField value="{!Contract.TOTAL_AMOUNT_1000__c}"/> 
                <apex:outputField value="{!Contract.Currency__c}"/>
                <apex:outputField value="{!Contract.MFG_Value_1000__c}"/> 
                <apex:outputField value="{!Contract.Refer_to_text__c}"/>
                <apex:outputField value="{!Contract.Paper_Value_1000__c}"/>
                <apex:outputField value="{!Contract.Refer_to__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Fakturowanie">
                <apex:outputField value="{!Contract.Other_Details__c}"/>
                <apex:outputField value="{!Contract.eInvoice_Email__c}"/>
                <apex:outputField value="{!Contract.Nomenclature__c}"/>
                <apex:outputField value="{!Contract.Agreed_to_eInvoice__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Informacja ogólna">
                <apex:outputField value="{!Contract.Competitive_Pricing__c}"/>
                <apex:outputField value="{!Contract.Specified_Plant_Location__c}"/>
                <apex:outputField value="{!Contract.Discount__c}"/>
                <apex:outputField value="{!Contract.Freight_Agreement__c}"/>
                <apex:outputField value="{!Contract.Rebate__c}"/>
                <apex:outputField value="{!Contract.Title_Transfer__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive__c}"/>
                <apex:outputField value="{!Contract.Product_Storage_Days__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive_Notes__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Paper_Supplier__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Informacje systemowe">
                <apex:outputField value="{!Contract.CreatedBy.Name}"/>
                <apex:outputField value="{!Contract.LastModifiedBy.Name}"/>
                <apex:outputField value="{!Contract.Status}"/>
                <apex:outputField value="{!Contract.RecordType.Name}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock title="Contract Detail" rendered="{!AND(displayDetails, Contract.RecordType.DeveloperName == 'QGE_Standard_Contract')}">

<!--        <apex:pageBlockButtons >
                <apex:form >
                    <apex:commandButton action="{!edit}" value="Edit"/>
                    <apex:commandButton action="{!delete}" value="Delete"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Clone, Contract.Id)}" value="Clone"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Activate, Contract.Id)}" value="Activate"/>
                    <apex:commandButton action="{!URLFOR($Action.Contract.Order_Confirmation, Contract.Id)}" value="Order Confirmation"/>
                </apex:form>
            </apex:pageBlockButtons>
 -->            <apex:pageBlockSection title="Contract Information">
                <apex:outputField value="{!Contract.Agreement_Format__c}"/>
                <apex:outputField value="{!Contract.Contract_Representative__c}"/>
                <apex:outputField value="{!Contract.Name}"/>
                <apex:outputField value="{!Contract.Account.Name}"/>
                <apex:outputField value="{!Contract.ContractNumber}"/>
                <apex:outputField value="{!Contract.Account_Number__c}"/>
                <apex:outputField value="{!Contract.Contract_Status__c}"/>
                <apex:outputField value="{!Contract.Background_Check__c}"/>
                <apex:outputField value="{!Contract.Previous_Contract__c}"/>
                <apex:outputField value="{!Contract.Data_Security__c}"/>
                <apex:outputField value="{!Contract.Currency__c}"/>
                <apex:outputField value="{!Contract.Non_Compete__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.No_Solicitation__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Term and Termination">
                <apex:outputField value="{!Contract.StartDate}"/>
                <apex:outputField value="{!Contract.Overall_Term_Length__c}"/>
                <apex:outputField value="{!Contract.Current_Term_Effective__c}"/>
                <apex:outputField value="{!Contract.Contract_Extension_Term__c}"/>
                <apex:outputField value="{!Contract.Current_Term_Signature__c}"/>
                <apex:outputField value="{!Contract.Early_Signature_Interval__c}"/>
                <apex:outputField value="{!Contract.EndDate}"/>
                <apex:outputField value="{!Contract.QG_Term_for_Convenience__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Clause__c}"/>
                <apex:outputField value="{!Contract.QG_TFC_Days_Notice__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Effective__c}"/>
                <apex:outputField value="{!Contract.Customer_Term_for_Convenience__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Detail__c}"/>
                <apex:outputField value="{!Contract.Customer_TFC_Days_Notice__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Notice__c}"/>
                <apex:outputField value="{!Contract.QG_Change_of_Control__c}"/>
                <apex:outputField value="{!Contract.auto_Renew_Notice_Notes__c}"/>
                <apex:outputField value="{!Contract.Auto_Renew_Extension__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Termination_Notice_Received__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Date_of_Termination__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Termination_Notice_Received_Notes__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="General Information">
                <apex:outputField value="{!Contract.Competitive_Pricing__c}"/>
                <apex:outputField value="{!Contract.Specified_Plant_Location__c}"/>
                <apex:outputField value="{!Contract.Discount__c}"/>
                <apex:outputField value="{!Contract.Comail_Terms__c}"/>
                <apex:outputField value="{!Contract.Rebate__c}"/>
                <apex:outputField value="{!Contract.Freight_Agreement__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive__c}"/>
                <apex:outputField value="{!Contract.Title_Transfer__c}"/>
                <apex:outputField value="{!Contract.Other_Incentive_Notes__c}"/>
                <apex:outputField value="{!Contract.Product_Storage_Type__c}"/>             
                <apex:outputField value="{!Contract.Paper_Supplier__c}"/>
                <apex:outputField value="{!Contract.Product_Storage_Days__c}"/> 
                <apex:outputField value="{!Contract.Paper_Purchasing_Agreement__c}"/>
                <apex:outputField value="{!Contract.Billable_Overrun_Underrun__c}"/>
                <apex:outputField value="{!Contract.PPA_Effective_Date__c}"/>
                <apex:outputField value="{!Contract.Billable_Overrun_Underrun_Notes__c}"/>
                <apex:outputField value="{!Contract.PPA_Expiration_Date__c}"/>
                <apex:outputField value="{!Contract.Most_Favored_Nations__c}"/>
                <apex:outputField value="{!Contract.Paper_Reconciliation__c}"/>
                <apex:outputField value="{!Contract.Financial_Audit__c}"/>
                <apex:outputField value="{!Contract.Paper_Requirement_Adjustment__c}"/>
                <apex:outputField value="{!Contract.Other_Audit__c}"/>
                <apex:outputField value="{!Contract.Paper_Storage__c}"/>
                <apex:pageBlockSectionItem />
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Current Price List Dates">
                <apex:outputField value="{!Contract.Price_Schedule_Number__c}"/>
                <apex:outputField value="{!Contract.Other_Pricing__c}"/>
                <apex:outputField value="{!Contract.Prep__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.List__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Labor Escalation Detail">
                <apex:outputField value="{!Contract.Section_Reference__c}"/>
                <apex:outputField value="{!Contract.Escalation_Effective_Month__c}"/>
                <apex:outputField value="{!Contract.Escalation_Notice_Due__c}"/>
                <apex:outputField value="{!Contract.Escalation_Frequency__c}"/>
                <apex:outputField value="{!Contract.Escalation_Structure__c}"/>
                <apex:outputField value="{!Contract.Percent_of_Index_Allowed__c}"/>
                <apex:outputField value="{!Contract.Escalation_Notes__c}"/>
                <apex:outputField value="{!Contract.Referenced_Index_Month__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Referenced_Index_Title__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Cap_on_Increase__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Allowance__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Ink & Materials Escalation Detail">
                <apex:outputField value="{!Contract.Ink_Escalation__c}"/>
                <apex:outputField value="{!Contract.Material_Escalation__c}"/>
                <apex:outputField value="{!Contract.Ink_Notice_Due__c}"/>
                <apex:outputField value="{!Contract.Material_Notice_Due__c}"/>
                <apex:outputField value="{!Contract.Ink_Escalation_Notes__c}"/>
                <apex:outputField value="{!Contract.Material_Escalation_Notes__c}"/>
                <apex:outputField value="{!Contract.Ink_Escalation_Notes_Notes__c}"/>
                <apex:outputField value="{!Contract.Material_Escalation_Notes_Notes__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Workflow Solutions">
                <apex:outputField value="{!Contract.Workflow_Contract_Type__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Annual_Value__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Billing_Month__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Billing_Frequency__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Software__c}"/>
                <apex:pageBlockSectionItem />
                <apex:outputField value="{!Contract.Number_of_Licenses__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="System Information">
                <apex:outputField value="{!Contract.CreatedBy.Name}"/>
                <apex:outputField value="{!Contract.LastModifiedBy.Name}"/>
                <apex:outputField value="{!Contract.Pricebook2}"/>
                <apex:outputField value="{!Contract.Status}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    <apex:relatedlist list="Contracted_Customer_Segments__r" rendered="{!AND(contractedCustSegAccess, displayDetails)}" />
    <apex:relatedlist list="Agreement_Escalation_History__r" rendered="{!AND(agreementEscalationHistoryAccess,displayDetails)}" />
    <apex:relatedlist list="CombinedAttachments" rendered="{!AND(displayDetails, OR(Contract.RecordType.DeveloperName == 'QGE_Order_Confirmation',Contract.RecordType.DeveloperName == 'QGE_Standard_Contract'))}" />

</apex:page>



Thanks!
 
Hello - 

Is there anyway to override the generated contract number with the new custom text field we are using, labeled as "Contract Number"?
So in this case, I'd want 00000218 to be replaced with 9723. User-added image
Hello -
I'm trying to switch this URL action on the button to a javascript action. Before, whatever was in window.open (see below) was alone and it was set to the URL behavior.
I'm still getting an illegal token error. I don't see what is going wrong.


{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")} 

var leadAddress = '{!Lead.Address}'; 
var leadCity = '{!Lead.City}'; 
var leadState = '{!Lead.State}'; 
var leadCountry = '{!Lead.Country}'; 


if(leadAddress == null || leadAddress == ''){ 
alert('Please enter Address before clicking on this button'); 

else if(leadCity == null || leadCity == ''){ 
alert('Please enter City before clicking on this button'); 

else if(leadState == null || leadState == ''){ 
alert('Please enter State before clicking on this button'); 

else if(leadCountry == null || leadCountry == ''){ 
alert('Please enter Country before clicking on this button'); 

else{ 
window.open(' 
/a0J/e? 
CF00Nj00000091TUH={!Lead.FirstName &" "& Lead.LastName } 
&CF00Nj00000091TUH_lkid={!Lead.Id} 
&retURL=%2F{!Lead.Id} 
&saveURL=%2F{!Lead.Id} 
&RecordType=012j0000000pfbL 
&ent=01Ij0000001EVex 
&00Nj00000091TU6={!Lead.Company} 
&00Nj00000091TUQ=Pending'); 
}