• DennoP
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 7
    Replies

I have a custom object (Score__c) that is a child of CASE.  I have workflow that updates a field on CASE when a new score__c record is created for reporting purposes.  

 

I have a visualforce page setup as a site to allow customers to create a score__c record.

 

Problem:

The problem is that the when the workflow is turned on that updates the CASE I get the error "Authorization Required".  

 

I don't get this error when the workflow is switched off and through the online profile I don't seem to be able to amend the CASE access permission to anything other than 'READ' & 'CREATE' (which I think may be the issue).  I have tried 'public without sharing class CaseNPSCardController{}' on the controller without any luck.

 

Any ideas how to work around this??

 

Any help or advice is appretiated.

 

Thanks,

  • October 13, 2013
  • Like
  • 0

I have a VF page with 5 radio buttons on.  For the answer I use a radio button (see page item below).  

 

My question is how do I test this because when I run my test class it doesn't touch this part of the the controllers List<SelectOption> part of the code?

 

Page item :

<apex:selectradio value="{!question1}" > 
         <apex:selectOptions value="{!QuestionItem}" /> 
</apex:selectRadio>

 

Controller item :

 

// Question radio buttons
public List<SelectOption> getQuestionItem() {
List<SelectOption> options = new List<SelectOption>(); 
options.add(new SelectOption('0','0')); 
options.add(new SelectOption('1','1')); 
options.add(new SelectOption('2','2')); 

return options; 
}

 

Test Class :

// Test 1

MyController controller1 = new MyController();
controller1.question1 = 1;

controller1.save();

 

Any help is appretiated.  If I need to add more info just let me know as this is not all of the code just the bits I thought relevant.

  • October 05, 2013
  • Like
  • 0

I have a VF page with 5 radio buttons on.  For the answer I use a radio button (see page item below).  

 

My question is how do I test this because when I run my test class it doesn't touch this part of the the controllers List<SelectOption> part of the code?

 

Page item :

<apex:selectradio value="{!question1}" >
         <apex:selectOptions value="{!QuestionItem}" />
</apex:selectRadio>

 

Controller item :

 

// Question radio buttons
public List<SelectOption> getQuestionItem() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('0','0'));
options.add(new SelectOption('1','1'));
options.add(new SelectOption('2','2'));

return options;
}

 

Test Class :

// Test 1

MyController controller1 = new MyController();
controller1.question1 = 1;

controller1.save();

 

Any help is appretiated.  If I need to add more info just let me know as this is not all of the code just the bits I thought relevant.

 

  • October 05, 2013
  • Like
  • 0

I have created a VF page to show part of the 'user' screenThe idea was to allow some none 'Admin' users to update some aspects of user accountsWhen none Admin users attempt to use this new screen they get an error message saying 'Insufficient privilege' and the screen does not display.

 

Is there anyway to override this constraint and allow users that are have a none admin profile to use my VF page to update user accounts?

I have added a custom button to a custom object (employee__c).  The button takes to user to a visualforce page based on a URL and userid field held in one of the fields on the employee__c record.

 

 

I would like to know how I can make sure that if the field is blank the user is not taken anywhere by the custom button, or even better the custom button gives a usefull message e.g. "The user field is blank".

 

Does anyone have any idea how this sort of valiation can be added on the button.

 

Any help is appretiated  :smileyhappy:

  • April 22, 2009
  • Like
  • 0
I am trying to use the code below to assign the value from an inputfield into a variable within my controller to then use that value in a query.  Please could someone tell me what I need to enter to assign that data

Page
<apex:inputField value="{!emp2.Paynumber__c}" id="PaySearch" /> <p/> 

Controller
public class EmployeeList {

String PayN = '15154';

    public PageReference update1() {
        PayN = {!$component.PaySearch);
        return null;
    }
  • December 30, 2009
  • Like
  • 0
I have a visualforce page which shows a date in a long format, I want to know if there is a way to show part of the text.  I was to show the short date and may in the future want to only show part of a text string.

How can this be done?

The code I use at the moment is:
{!eVisit.Visit_Date__c}

which displays:
Fri Oct 31 00:00:00 GMT 2008

Any help is appretiated.
  • October 18, 2008
  • Like
  • 0
I have two objects, appointment__c and contact.  appointment__c has a field called who__c which is a contact id.

Is there any way to link the two tables in an SOQL so that I can use the output in a datatable?  as I want to show the contact name against the appointment instead of the contact id which is who__c. i.e. {!eVisit.cont.name} in my page layout.

I have been using the following SQL which works OK until I try and add a second table to view the contact name and I get the error message "Compile Error: unexpected token: cont.id at line 24 column 33".

public List<Appointment__c> getVisits(){
Visits = [SELECT app.id, cont.name, app.Name, app.Assigned_To__c, app.Who__c, app.Time_Band__c, app.Visit_Date__c, app.Visit_Type__c
            FROM Appointment__c app, Contact cont
            WHERE  app.Status__c = 'Appointed'
            AND    app.who__c = cont.id
            AND    app.Visit_Date__c > :tmp
            AND    app.Assigned_To__c = :ApexPages.currentPage().getParameters().get('id')
            Order by app.Visit_Date__c
            limit 200];
    return Visits;
    }
  • October 05, 2008
  • Like
  • 0
While I am trying to display a list of records in a data table I get the following message:

Inline query has too many rows for direct assignment, use FOR loop.

Can anyone tell me how could I amend the controller below to use the FOR loop to handle the result.

public List<Appointment__c> getVisits(){
   
   
    return [SELECT id, Assigned_To__c, Time_Band__c, Visit_Date__c, Visit_Type__c
            FROM Appointment__c
            WHERE Assigned_To__c = 'a0AR0000000UJBI'];
 }

Any help is appretiated.
  • October 04, 2008
  • Like
  • 0
I have a customer oject called 'Employee_c' and I want to display some of the fields within that object on my visualforce page sucha as 'Name'.  Every time I try to add this object to by custom controller I get the following error.  Am I using the wrong syntax for custom ojects? The API name for my custom object is Employee_c.

Code example:
Employee_c Emp1;

Error:
Error: Compile Error: Invalid type: Employee_c at line 4 column 1

I was to be able to do the same as I do with account or other standard objects on a visualforce page.

The standard oject code work fine?
Account account;

public Account getAccount() {
        if (account == null)
            account =[select id, name from Account
                     where id = '001R0000008SVv7'];
            return account;
    }

Please help!

  • October 02, 2008
  • Like
  • 0

I have a custom object (Score__c) that is a child of CASE.  I have workflow that updates a field on CASE when a new score__c record is created for reporting purposes.  

 

I have a visualforce page setup as a site to allow customers to create a score__c record.

 

Problem:

The problem is that the when the workflow is turned on that updates the CASE I get the error "Authorization Required".  

 

I don't get this error when the workflow is switched off and through the online profile I don't seem to be able to amend the CASE access permission to anything other than 'READ' & 'CREATE' (which I think may be the issue).  I have tried 'public without sharing class CaseNPSCardController{}' on the controller without any luck.

 

Any ideas how to work around this??

 

Any help or advice is appretiated.

 

Thanks,

  • October 13, 2013
  • Like
  • 0

I have a VF page with 5 radio buttons on.  For the answer I use a radio button (see page item below).  

 

My question is how do I test this because when I run my test class it doesn't touch this part of the the controllers List<SelectOption> part of the code?

 

Page item :

<apex:selectradio value="{!question1}" >
         <apex:selectOptions value="{!QuestionItem}" />
</apex:selectRadio>

 

Controller item :

 

// Question radio buttons
public List<SelectOption> getQuestionItem() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('0','0'));
options.add(new SelectOption('1','1'));
options.add(new SelectOption('2','2'));

return options;
}

 

Test Class :

// Test 1

MyController controller1 = new MyController();
controller1.question1 = 1;

controller1.save();

 

Any help is appretiated.  If I need to add more info just let me know as this is not all of the code just the bits I thought relevant.

 

  • October 05, 2013
  • Like
  • 0

I've enabled Contact History on Contacts.

 

Adding the related list to a page layout works fine, and I can see the field tracking.

 

But when I try to call Contact History in my VF page, I keep getting the error

 

'ContactHistory' is not a valid child relationship name for entity Contact'

 

I've downloaded my WSDL, and sure enough, it looks like ContactHistory is its own object.  No matter what I try, I can't get this to work.  

 

Running the code by itself works -- it's only when you run the page against an actual Contact that it blows up.

 

Here's the code.  Any help would be appreciated.

<apex:page standardController="Contact" showHeader="true" tabStyle="contact" > <style> .activeTab {background-color: #56458c; color:white; background-image:none; font-family: Verdana; font-size: 11px;} .inactiveTab { background-color: lightgrey; color:black; background-image:none font-family: Verdana; font-size: 11px;} .fontSize {font-size: 12px;) </style> <apex:detail relatedList="true" title="true"/> <apex:tabPanel switchType="client" selectedTab="tabdetails" id="ContactTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" contentClass="fontSize"> <apex:tab label="Activity History" name="ActivityHistory" id="tabActHist"> <apex:relatedList subject="{!contact}" list="ActivityHistories" /> </apex:tab> <apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct"> <apex:relatedList subject="{!contact}" list="OpenActivities" /> </apex:tab> <apex:tab label="Opportunities" name="Opportunities" id="tabOpp"> <apex:relatedList subject="{!contact}" list="Opportunities" /> </apex:tab> <apex:tab label="Notes and Attachments" name="NotesAndAttachments" id="tabNoteAtt"> <apex:relatedList subject="{!contact}" list="NotesAndAttachments" /> </apex:tab> <apex:tab label="Contact History" name="ContactHistory" id="tabContactHist"> <apex:relatedList subject="{!contact.histories}" list="ContactHistory" /> </apex:tab> </apex:tabPanel> </apex:page>

 


 

I have created a VF page to show part of the 'user' screenThe idea was to allow some none 'Admin' users to update some aspects of user accountsWhen none Admin users attempt to use this new screen they get an error message saying 'Insufficient privilege' and the screen does not display.

 

Is there anyway to override this constraint and allow users that are have a none admin profile to use my VF page to update user accounts?

I have added a custom button to a custom object (employee__c).  The button takes to user to a visualforce page based on a URL and userid field held in one of the fields on the employee__c record.

 

 

I would like to know how I can make sure that if the field is blank the user is not taken anywhere by the custom button, or even better the custom button gives a usefull message e.g. "The user field is blank".

 

Does anyone have any idea how this sort of valiation can be added on the button.

 

Any help is appretiated  :smileyhappy:

  • April 22, 2009
  • Like
  • 0
While I am trying to display a list of records in a data table I get the following message:

Inline query has too many rows for direct assignment, use FOR loop.

Can anyone tell me how could I amend the controller below to use the FOR loop to handle the result.

public List<Appointment__c> getVisits(){
   
   
    return [SELECT id, Assigned_To__c, Time_Band__c, Visit_Date__c, Visit_Type__c
            FROM Appointment__c
            WHERE Assigned_To__c = 'a0AR0000000UJBI'];
 }

Any help is appretiated.
  • October 04, 2008
  • Like
  • 0
I have a customer oject called 'Employee_c' and I want to display some of the fields within that object on my visualforce page sucha as 'Name'.  Every time I try to add this object to by custom controller I get the following error.  Am I using the wrong syntax for custom ojects? The API name for my custom object is Employee_c.

Code example:
Employee_c Emp1;

Error:
Error: Compile Error: Invalid type: Employee_c at line 4 column 1

I was to be able to do the same as I do with account or other standard objects on a visualforce page.

The standard oject code work fine?
Account account;

public Account getAccount() {
        if (account == null)
            account =[select id, name from Account
                     where id = '001R0000008SVv7'];
            return account;
    }

Please help!

  • October 02, 2008
  • Like
  • 0