• JPlayEHR
  • NEWBIE
  • 49 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 23
    Replies
Hey guys, Can you provide a hyperlink or a link to a URL through a Error message displayed as part of a Trigger? For example, instead of hardcoding the URL as shown below, use a markup to make it a link: c.addError('ERROR TRM100: There is already an identical record: Record Number '+cs.Number+' (https://na8.salesforce.com/'+cs.Id+')'); This currently reads as: Error: Invalid Data. Review all error messages below to correct your data. ERROR TRM100: There is already an identical record: Record Number 60311 (https://na8.salesforce.com/500M0000000mJJ9IAM) It would be great if I could make the "Record Number 60311" a hyperlink. Any idea is greatly appreciated. Thanks,
  • May 26, 2011
  • Like
  • 0

Hi All,

 

I need to display an custom validation error message for an 'inputText' field.

For Example:

Here, I need to display an error message if the inputText for 'Name' is null or empty.

 

<div style="position:absolute; top: 145px; left: 30px;" class="cnt_popup">
Name: 
</div>
<div style="position:absolute; top: 140px; left: 105px; height:20px; width:200px;" >
     <apex:inputText id="name" value="{!Name}" styleClass="textarea" required="true">                                    
     </apex:inputText>  
</div>

 Please let me know if you have any idea about how to display an custom validation error message.

 

Hi All,

 

Can anyone spot why this would not be showing the inline / hover over help text?

 

The page is valid

 

Thanks

 

 

<apex:page standardController="Vacancy__c"  extensions="ExternalVacancyControllerExtension" title="Client Vacancy " showHeader="false" standardStylesheets="true">

  <apex:form > 
   <apex:pageMessages />
    <apex:messages />
      <apex:pageBlock title="" mode="edit">
        
        <apex:pageBlockButtons location="bottom" >
           <apex:commandButton value="Confirm" action="{!ConfirmUpdate}"/>
           <apex:commandButton value="Cancel" action="{!Cancel}"/>
        </apex:pageBlockButtons>
        
        <apex:pageBlockSection title="Vacancy Information" collapsible="false" columns="2">
            
            
               <apex:pageBlockSectionItem helpText="{!$ObjectType.Vacancy__c.Fields.Client_Contact_Hiring_Manager__c.inlineHelpText}" >
                    <apex:outputLabel value="Client Hiring Manager" for="Client_Contact_Hiring_Manager__c"/>
                    <apex:inputText value="{!Vacancy__c.Client_Contact_Hiring_Manager__c}" id="hiremgr"/> 
                </apex:pageBlockSectionItem>
            
            

        
                    
        </apex:pageBlockSection>
            
       </apex:pageBlock>
       
       
       
      </apex:form>
</apex:page>

 

 

Hi All,


I am getting this calendar (as shown below) in my VF page even though I have not written a code for this.

 

JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
2010201120122013201420152016
SunMonTueWedThuFriSat
Today


Please let me know about this or its solution if anyone had come across this same problem.


Thank You.

  • January 03, 2011
  • Like
  • 0

Hi,

 

I'm creating a date / time formula field in which I would like to keep te time of another date time field and subtract five hours from it.

 

For example, in field A I would have "11/23/2010 9:03 PM" and in field B (the formula one I should see "11/23/2010 4:03 PM"

 

 

Is this possible?

 

Thanks

 

Tzuvy

  • November 25, 2010
  • Like
  • 0

Hi

 

I have a VF page where in I am using case standard controller.

The first time when the page is displayed 2 input fields (eg.) are there i.e. Name and Email. which are static. Another 2 fields are their like Vendor Name and Vendor Contact No. which are dynamic.

 

Now, I want to implement the functionality wherein if a user clicks on Add Row button,  1more row will appear to enter a value in both  the fields(Vendor name and Vendor Contact No.). So, if he clicks the button 5 times, 5 rows shud appear with thses two columns.

After providing the inputs, he will click on "Save " button, and the record should be saved wherein the inputs provided in multiple rows should be saved into the related list of the Case detail page (Case details page will contain the information like Name and Email). Request you to please forward me the code for the above mentioned functionality. Since its a n urgent requirement. An early reply will be highly appreciated. Thanks.

  • May 07, 2010
  • Like
  • 0

I have a Visualforce page rendering as PDF. I have two problems:

 

1) One of the pages has text that fits completely on the page, but for whatever reason the page wraps to a new blank page. How can I make the pdf stop after that last element.

 

<table width="100%" cellspacing="0" cellpadding="0" class="signaturebox1">
<tr>
<td colspan="2" width="46%" class="signatureheading1">
Authorized Agent for LetterLogic, Inc.:<br /><br />
</td>
<td>&nbsp;</td>
<td colspan="2" width="46%" class="signatureheading1">
Authorized Agent for {!opportunity.account.name}:<br /><br />
</td>
</tr>
<tr>
<td class="signatureline1">Signature<br /><br /></td>
<td class="signatureline1">Date<br /><br /></td>
<td>&nbsp;</td>
<td class="signatureline1">Signature<br /><br /></td>
<td class="signatureline1">Date<br /><br /></td>
</tr>
<tr>
<td class="signatureline1bot">Name</td>
<td class="signatureline1bot">Title</td>
<td>&nbsp;</td>
<td class="signatureline1bot">Name</td>
<td class="signatureline1bot">Title</td>
</tr>
</table>
</apex:page>

 

2) I would like to reduce the margins of at least that page to be more like 0.25 inches or 0.50 inches. Seems like the default is 0.75 inches. The PDF is cutting off the text.

 

Thank you!

I keep getting this error when I try to validate a deployment. The classes in question are not schedule classes or related to scheduling in any way. Once is a controller for a VF page, then tests for that controller, and a utility class with some static methods.

I have a completely seperate and unrelated scheduled job but it was not running when I got this error.

 

 

BUILD FAILED
C:\Documents and Settings\venable\Desktop\deploy\build.xml:7: Failures:
classes/configAddProductsVF.cls(1,8):Schedulable class has jobs pending or in progress
classes/configAddProductsVFTEST.cls(1,8):Schedulable class has jobs pending or in progress
classes/utility.cls(1,8):Schedulable class has jobs pending or in progress

Anyone seen this before?

Thanks,
Jason

  • December 22, 2009
  • Like
  • 0

Hi,

 

I'm getting some strange behaviour using Eclipse with a SOQL query in a class.  I'm using the schema section to test the query out and just for sanity, building the query using the checkboxes to ensure the relationships are correct.

 

I'm trying to query the Lead object and show the Lead Owner's Division.

 

To do this, you join with User.  The field "Division" is a standard Salesforce.com field, as is Username, Lastname,Firstname, Fullname, Street, City, State, Email, Phone, and so on.

 

The following example queries work:

 

Select l.Owner.Name, l.OwnerId, l.Company From Lead l

Select l.Owner.Username, l.OwnerId, l.Company From Lead l

Select l.Owner.Phone, l.OwnerId, l.Company From Lead l

Select l.Owner.Email, l.OwnerId, l.Company From Lead l

Select l.Owner.ProfileId, l.OwnerId, l.Company From Lead l

 

 

These are some that don't work:

 

Select l.Owner.Division, l.OwnerId, l.Company From Lead l

Select l.Owner.Country, l.OwnerId, l.Company From Lead l

Select l.Owner.City, l.OwnerId, l.Company From Lead l

Select l.Owner.Department, l.OwnerId, l.Company From Lead l

 

 

The error message:   

 

Unable to open Schema Browser. Reason: INVALID_FIELD - Select l.Owner.Division,l.OwnerId,l.Company from Lead l ^ ERROR at Row:1:Column:8 No such column 'Division' on entity 'Name'. 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.

 

 

If they're all non-custom fields on a non-custom object, the relationship name should work? 

 

Is there anything I'm missing?

 

 

 

I have recruited a developer to implement Apex-based functionality on a Salesforce.com instance, and my experience so far is that although the creation of objects/fields/validation/reports/search is VERY fast compared to the likes of ASP.NET, when it comes to creating Visualforce pages and add-on functionality not supported by the primary platform it is very slow. 

 

As an example, recently my dev quoted several times the amount of time required to implement a specific feature than I know would be required to implement it in an ASP.NET app. He put this down to the cloud-based environment (yes, he's using Eclipse) and the fact that it's necessary to continually upload the code with all the tests on a regular basis.

 

It's a small app so we're not using the sandbox, instead deploying direct to production, the reasoning for that is the risks of this are quite tolerable, and overall it saves time.

 

I'm interested to hear if others generally find Apex development to be slower than other platforms.

 

 I am using the <apex:selectlist> visualforce Tag and wish to replicate the behaviour of the standard tag for validation <apex:InputField>. My SelectList is a required field in filling out the form.

 

The moment the validation error that is returned reads the following: 

"j_id0:StdOXCEITemplate:j_id9:j_id37:j_id49:j_id50:smileysurprised:rg: Validation Error: Value is required."

 

1. My first task will be to create a customise this message to read "You must input a value for thie picklist field division"
2. Will be to replicate the css to make sure the selectList value is displayed with the red left border to show it is required.

3. Will be to make sure that the field is highlited in red in the sameway as it does for the inputfield  with the error message next to field specifying that it is required.

 

Unfortunatly the only one I have any idea on how to implement is the 2nd bullet. Can anyone advise on how this is done?

 

 

<apex:pageBlockSectionItem >
<apex:outputLabel value="Organisation" for="org"></apex:outputLabel>
<apex:selectList value="{!picklistValue}" required="true" multiselect="1" size="1" id="org">
<apex:SelectOptions value="{!OrganisationNames}"></apex:SelectOptions>
<apex:actionSupport event="onchange" rerender="thePageBlock"/>
</apex:selectList>
</apex:pageBlockSectionItem>

I've got two fields side by side, both picklists.  One is a regular Salesforce picklist field, the second is a picklist I'm explicitly tagging so that I can restrict further the values that will eventually be placed in the underlying field on this particular page.

 

I want them to behave exactly the same:  both have a title, both be required, both default to "-None-" option (which errors when left on -None-).  All of this happens with the first field, and none of it with the second: no title, no red mark for required, no enforcement of the required propertly.

 

I've put this:

 

<apex: pageBlockSection id="Section1" columns="2">

 

  <apex:inputField value="{!PSCase.Route_To__c}" required="true"/>

 

 

  <apex:selectList size="1" title="Setup Type" value="{!PSCase.Reason}" required="true"

     <apex:selectOption itemLabel="-None-"/>

     <apex:selectOption itemValue="Trial Setup" itemLabel="Trial"/>

     <apex:selectOption itemValue="Subscription Setup" itemLabel="Subscription"/>

  </apex:selectList>

 

</apex: pageBlockSection>

Message Edited by RDN_LHR on 02-26-2009 05:05 AM
I have a visual force page that gets select options from a controller.
I have required="true" for the selectList.
No red bar shows on the page when it is displayed.
If I don't select a value and submit the form.
I do not get a message on the field 'You must enter a value' like I do on other fields required in the same way, but do get informed in  apex:pageMessages mentioning

thePage:theForm:j_id1:j_id5:0: Validation Error: Value is required.

The field is a multiselect picklist which I am showing on the VF page as a selectList size 1 only when the user has not previously selected values for that field.

Code:
<apex:page standardController="Opportunity" recordSetVar="opportunities" sidebar="false" showHeader="true" extensions="OpptyMultiEdit_CTE" id="thePage">
......
<apex:pageBlockTable value="{!OpptyList}" var="oppty" cellpadding="4" headerClass="TH_Class">
......
<apex:selectList required="true" size="1" value="{!oppty.Competitors__c}">
<apex:selectOptions value="{!CompetitorsPicklist}"/>
</apex:selectList>



Opportunity[] Opptys;
public List<Opportunity> getOpptyList()
{
return Opptys;
}

public List<SelectOption> getCompetitorsPicklist()
{
List<SelectOption> options = new List<SelectOption>();
Schema.DescribeFieldResult f = Opportunity.Competitors__c.getDescribe();
String defValue = '';
options.add( new SelectOption( '', '--None--'));
for(Schema.PicklistEntry pe : f.getPicklistValues())
{
if ( pe.getValue() != Competitors )
{
options.add( new SelectOption( pe.getValue(), pe.getLabel() ));
}
}
return options;
}

Ideas on
-why the red bar not showing?
-why is the field not being Highlighted and marked with 'Error: You must enter a value' when I submit the form?





  • December 08, 2008
  • Like
  • 0
Hi,

I don't think this is possible but I might be missing something. What I would like to do is override the New button but only for a specific Record Type.

The normal functionality is that if you have more than one record type, clicking new will take you to a first step where you select the record type and then clicking next takes you to the layout for the record type selected.

I want to keep the first step, and for all but one record type keep the standard creation pages. For the one recordtype I want to display a visualforce page when it's selected in the first step. I'm hoping I don't have to rewrite the first wizard step, any ideas?

Thanks!
Hi,

I have issue when query "select Id from asset", program keep error "QUERY_TIMEOUT: Your query request was running for too long." . But, when I try query from Apex Explorer, I can get the result in >30secs with >220+ records. Anyway to make this work?
FYI:
- sometimes, my program can running, but the chance very low <10-20%.
- windows a .Net application
- binding.Timeout = 120000
- WSDL version 11.0

Anyone can help me? Thx a lot.

sq
Our triggers add great new functionality but as of now none are system critial. So for each trigger I have try/catch statements that catch standard exceptions and adds it to a custom built exception log I've created. http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=978\

The problem I've run into is covering the catch code with test coverage.  It seems like a Catch 22. If my test throws an exception it fails, but I somehow need it to throw an exception to cover the catch statement. Even with the catch code not covered we still have 90% code coverage but I'd like to cover as much as possible.

-Thanks
Jason
  • September 05, 2007
  • Like
  • 0