• mikeafter6
  • NEWBIE
  • 55 Points
  • Member since 2008

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

Basically I need to override a page layout and have to check if the Record Owner is logged in and GLB_Privacy_Opt_Out__c = true.

 

so I have right now

 

<apex:page action="{!if( !Account.GLB_Privacy_Opt_Out__c == true
    , null
    , urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}"
    standardController="Account"
    recordSetVar="accounts"
    tabStyle="Account">
  <h1>GLB Opt Out Account</h1>

This page will only show the Account Name if you are not the owner and GLB_Opt_Out__c = 'true'
</apex:page>

Is there a way to check both values like

<apex:page action="{!if( !Account.GLB_Privacy_Opt_Out__c == true && &Profile.Name = !Account.OwnerID
    , null
    , urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}"
    standardController="Account"
    recordSetVar="accounts"
    tabStyle="Account">
  <h1>GLB Opt Out Account</h1>
  This page will only show the Account Name if you are not the owner and GLB_Opt_Out__c = 'true'

</apex:page>

I keep getting syntax errors.

I have 2 validation rules set up.  #1 for first name.   #2 for last name.    Assume that both fields have validation errors when I click the 'save' action.

 

Both errors appear on the same page when I use a standard controller.  However, my custom controller only returns the first DMLException error.  So, when both errors occur, only the error for the first-name field displays. If I fix the  first-name field and press 'save', then the last-name error appears.

 

 

public class catchMultipleDMLExceptionErrors {

public Person__c p { get; set; }

public catchMultipleDMLExceptionErrors () {
this.p = [Select id, first_name__c, last_name__c from person__c limit 1];
}

public PageReference save() {
try {
update p;
} catch (DMLException dmle) {
ApexPages.addMessages(dmle);
return null;
}
return null;
}
}

 

In other languages, the exception can be an array of exceptions (so in this case both the first-name & last-names are represented by the variable dmle.) 

 

I'm expecting both errors to be there, but they aren't.  How do I grab all the validation errors at the same time?

Thanks.

-Mike

 

I get the following error when trying to create a hierarchy of exception classes.

 

Save error: NoPersonLinkException: Non-virtual and non-abstract type cannot be extended: InvalidUserUserException
 

Samples in docs don't use virtual or abstract keywords when extending exception classes.  

Please advise on syntax.

 

//FIRST CLASS:
public class InvalidUserException extends Exception{}

//SECOND CLASS:
public class NoPersonLinkException extends InvalidUserException{}

 

 

 

 

I have a picklist called 'Relationship'.  Formula editor doesn't return a value.  I get the error 'use ISPICKLIST or CASE to work with picklists'.

 

I'm forced to use CASE and hard-code the choices.  Is there an easier way?

 

 

CASE(Relationship__c
, 'Aunt', 'Aunt'
, 'Best Friend', 'Best Friend'
, 'Boyfriend', 'Boyfriend'
, 'Daughter', 'Daughter'

, '< value missing >'
)

 

 

 

I'm trying to create a link to the list-view for a custom object using URLFOR. I keep getting an 'Invalid paramater for function' error. (I've successfully been able to get this to work for .view & .edit.)

What am I doing wrong? Thanks!


ERROR: Invalid parameter for function URLFOR

VF CODE: Here is the failing code: I ommitted the beginning '
_apexpage>
_apexoutputLink value="{!URLFOR($Action.PersonTaskMessage__c.List,null,null,true)}">
click here.
_/apexoutputLink>
_/apexpage>

NOTE: '_' takes place of '


VARIATIONS ATTEMPTED:
1. value="{!URLFOR($Action.PersonTaskMessage__c.List,null)}
2. value="{!URLFOR($Action.PersonTaskMessage__c.List)}
3. attempted an apex:commandlink tag within an apex:form block, too.

Message Edited by mikeafter6 on 12-23-2008 08:20 AM

Message Edited by mikeafter6 on 12-23-2008 08:22 AM
We're attempting a native force.com app that needs to call web services on another ORG.  (aka ORG to ORG web service call.)
 
I understand how to consume an ORG's web service using an S-Control, .NET, Java, PHP, Ajax-Toolkit. 
 
How do I consume a web service using APEX code? 
 
NOTE:  The ORG with the web service method stores standardized custom objects (DAAS) that will be used by other ORG's that we create.
 
Please advise if possible.  What are the best ways to login() and work with sessions using apex?
 
Thanks.
- ISV

Hi,

I am trying to create a tree structure on a visualforce page. Is it possible to nest one datatable into another datatable. Is there and expample for such a thing.

Thanks

KD 

  • June 17, 2009
  • Like
  • 0

I am using the inputtext to get a value and pass the same to my controller. Though those functions are all working as it should, when using the title attribute on the same to display the text, it does not show it in the page. I am using the inputtext with a pageblock section.

 

I have noticed this when using with the commandbuttons too. I there any specific reason that the value give under title is not displayed.

 

Thanks

KD

  • May 27, 2009
  • Like
  • 0

I have the following code --

 

Date ad = this.event.Start_Date_vod__c;
Date bd = this.event.End_Date_vod__c;
Integer di = ad.daysBetween(bd);
cm.avai0 = ad+' booyaaa '+bd;

 Edited to add -- both Start_Date_vod__c and End_Date_vod__c are declared as datatype Date in the SObject.

 

 that throws the error --

 

java.lang.String cannot be cast to java.util.Date

 

 When I comment out this line --

 

Integer di = ad.daysBetween(bd);

 

The error goes away and the code continues to run. I'm not sure what I'm doing wrong. I'm comparing the days between two date objects. I tried using comparison operators such as > and < but that throws the String cannot be cast as Date error as well.

 

Any help is appreciated.

 

 

 

 

Message Edited by tsailingw on 05-09-2009 12:54 PM
Message Edited by tsailingw on 05-09-2009 12:54 PM

Basically I need to override a page layout and have to check if the Record Owner is logged in and GLB_Privacy_Opt_Out__c = true.

 

so I have right now

 

<apex:page action="{!if( !Account.GLB_Privacy_Opt_Out__c == true
    , null
    , urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}"
    standardController="Account"
    recordSetVar="accounts"
    tabStyle="Account">
  <h1>GLB Opt Out Account</h1>

This page will only show the Account Name if you are not the owner and GLB_Opt_Out__c = 'true'
</apex:page>

Is there a way to check both values like

<apex:page action="{!if( !Account.GLB_Privacy_Opt_Out__c == true && &Profile.Name = !Account.OwnerID
    , null
    , urlFor($Action.Account.Tab, $ObjectType.Account, null, true))}"
    standardController="Account"
    recordSetVar="accounts"
    tabStyle="Account">
  <h1>GLB Opt Out Account</h1>
  This page will only show the Account Name if you are not the owner and GLB_Opt_Out__c = 'true'

</apex:page>

I keep getting syntax errors.

I'm trying to allow the user to click a button in a pageBlockTable to launch a new URL.

 

Here is the page code:

 

<apex:column style="text-align: left;vertical-align:middle;">
           <apex:facet name="header">Action</apex:facet>
                    <apex:commandButton value="Log Time" action="{!LogTime}">
                            <apex:param name="selectedJob" value="{!job.Id}"/>
                    </apex:commandButton>
</apex:column>

 

..and here is the controller function:

 

public PageReference LogTime() {
        selectedJobID = System.currentPageReference().getParameters().get('selectedJob');
        PageReference ref = new PageReference('/' + selectedJobId);
        ref.setRedirect(true);
        return ref;   
    }

 

What am I doing wrong?

  • April 17, 2009
  • Like
  • 0

Hello again!!

 

Now I have the value !Status, It could be 1, 2 or 3. I want to put 1,2 or 3 inside of the commandButton but I don't know what kind of data should I put in the Value of the commandButton. As I know I can write nothing but text!!

 

 

 

 

 <apex:page standardController="Data__c" extensions="functions">

    <apex:form >
        <apex:pageBlock id="result" title="Stuff">
                     <apex:commandButton action="{!buttons}" value="¿¿??" id="addButton1" />
        </apex:pageBlock>  
     </apex:form>       
</apex:page>

 

 

 

Thank you in advance

 Problem: CRUD Permissions are not available for this entity : Product2

 

I'm deploying a profile object and I'm getting this error. I can't actually find reference to product2 in the file.

 

Does anyone have a more detailed explanation?

 

thanks

 

dan

I'm trying to create a link to the list-view for a custom object using URLFOR. I keep getting an 'Invalid paramater for function' error. (I've successfully been able to get this to work for .view & .edit.)

What am I doing wrong? Thanks!


ERROR: Invalid parameter for function URLFOR

VF CODE: Here is the failing code: I ommitted the beginning '
_apexpage>
_apexoutputLink value="{!URLFOR($Action.PersonTaskMessage__c.List,null,null,true)}">
click here.
_/apexoutputLink>
_/apexpage>

NOTE: '_' takes place of '


VARIATIONS ATTEMPTED:
1. value="{!URLFOR($Action.PersonTaskMessage__c.List,null)}
2. value="{!URLFOR($Action.PersonTaskMessage__c.List)}
3. attempted an apex:commandlink tag within an apex:form block, too.

Message Edited by mikeafter6 on 12-23-2008 08:20 AM

Message Edited by mikeafter6 on 12-23-2008 08:22 AM
We're attempting a native force.com app that needs to call web services on another ORG.  (aka ORG to ORG web service call.)
 
I understand how to consume an ORG's web service using an S-Control, .NET, Java, PHP, Ajax-Toolkit. 
 
How do I consume a web service using APEX code? 
 
NOTE:  The ORG with the web service method stores standardized custom objects (DAAS) that will be used by other ORG's that we create.
 
Please advise if possible.  What are the best ways to login() and work with sessions using apex?
 
Thanks.
- ISV