• guyr1981
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi,

 

I have a controller for one of my visual force pages and I'm trying to define an enumaration,

but keep getting the following error on compilation:

Error: Compile Error: expecting right curly bracket, found 'Payment' at line 7 column 9

 

This is my class:

 

public class MyController {  

 

 //    public Table_Account__c acct;

    public List<Table_Account__c> TabAccount = new List<Table_Account__c>();         

 

    public enum Account_Types {My Payment, Company Account, General Account}

 

.......

.......

 

Thanks,

Guy

 

Hi,

 

Don't understand dashboards at all and can't find documantation that allows me to do what I need.

 

I have my own custom object, that is built on a visualforce page from data retrieve from different objects choosen by the user on the inputfields on my visualforce screen.

I want to add a dashboard, preferebly to the same visualForce screen (if possible) or on a new screen.

The dashboard should show records that represent data from specific months and years choose by the user.

and the objects should be displayed by the different month and the amount hold in each sum.

(Meaning I need a pie dashboard with the each month in a different color and the sum of that month taking the apropriate portion of the pie).

 

The best answer I can hope for is just a refernce to a guide that deals with how to build a dashboard of the type I'm trying to build, because I've found very little documentation and it is mostly about building the regular dashboards.

(The other option is just some directions that would help me deal with my problems)

 

Now for the problems:

1. How if at all can I add a dashbord to my visualforce page, should I build it regularly and then somehow refernce it in the VF page attributes or for what I need should the dashboard be created with VF from the start? if sow, how?

2. I understand that for a dashboard I first need to get a report but when trying to build a custom report it does not give me all the custom objects that I own as options for that report? how can I make my custom object the type of object that will show on my rerports.

3. for the sobject it does show for reporting it only allows the report to be on specific fields like Creation Date, name, status (a custom field) but not on the fields that I wany.

4. It only allows the user to choose specific date types for the records presented (for example the user can choose to present only records that were created between this date to another, but since all of my objects were created now, by the user, it doesn't help, I need it to show records between the date field in my object (the object that holds data from different object will hold the information on when the original data was created and that is the date I want the user to have a choice which to present and which not.

 

Thanks,

Guy

 

 

 

 

Hi,

 

Getting really frustrated trying to solve a problem that is not allowing me to proceed for 2 days now.

If anyone can help, please do...

 

 

Have an Object Table_Account__c which has a few fields (lets say for simplicity):

test1__c

test2__c

test3__c

total__c

 

Also have a dataTable that presents instances of this object as inputFields on the table.

 

This is my getter for the table that is displayed later:

 

    public List<Table_Account__c> getTabAccounts() {

        this.TabAccount = [SELECT name, id, account_name__c, test1__c, test2__c, test3__c,

         Total__c from Table_Account__c];

        System.debug(Logginglevel.DEBUG, '##### I am in Get ##############################################');

        return this.TabAccount;

    }

 

The dataTable attribute creation code is:

 

<apex:page standardStylesheets="false" sidebar="false" Controller="MyController" tabStyle="Account">

....
....
....

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

     <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Test1">

          <apex:inputField value="{!pitem.test1__c}" style="width: 80px"/>

           </apex:column>

          <apex:column headerValue="Test2">

          <apex:inputField value="{!pitem.test2__c}" style="width: 80px"/>

          </apex:column>

 <apex:column headerValue="Test3">

          <apex:inputField value="{!pitem.test3__c}" style="width: 80px"/>

          </apex:column>

 

  <apex:column headerValue="Total">

          <apex:inputField value="{!pitem.total__c}" style="width: 80px"/>

          </apex:column>

 

...

...

...

 

after user is changing the values in some of the dataTable input boxes and press a button which is connected to {!quicksave}.

The dataTable updates back to the original values instead of the new ones just saved.

 

Does anyone has an explanation.

 

The only explanation that I might have is that maybe my getter is called before the setter so it updates the table back with the DB values, then the setter is called after the values are already the old ones hence no change in the DB and then the quicksave. later when the getter rebuilds the dataTable again it builds it with the DB values which are the same as the old values.      Could that be it?

(I can see in the Debug that the getter is called twice, one of which is before the quicksave but is it also before the setter updates the DB?)

If that is the case, what can I do?

 

Hi,

 

I have the following dataTable:

 

 

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">
          <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">
          <apex:column headerValue="Account" >
          <apex:outputText value="{!pitem.name}" style="width: 80px"/> 
          </apex:column>
          <apex:column headerValue="Jan">
          <apex:inputField value="{!pitem.Jan__c}" style="width: 80px"/> 
          </apex:column>
          <apex:column headerValue="Feb">
          <apex:inputField value="{!pitem.Feb__c}" style="width: 80px"/>
          </apex:column>

 

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

     <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Test1">

          <apex:inputField value="{!pitem.test1__c}" style="width: 80px"/>

           </apex:column>

          <apex:column headerValue="Test2">

          <apex:inputField value="{!pitem.test2__c}" style="width: 80px"/>

          </apex:column>

..........

..........

..........

 

          <apex:column headerValue="Test10">

          <apex:inputField value="{!pitem.test10__c}" style="width: 80px"/>

          </apex:column>

..........

..........

..........

 

 

On the controller I have the getTabAccounts that returns a list of my Table_Account__c objects (from which the dataTable is being built).

 

When the user changes the values on the dataTable input fields I would like to have a "set" API that would recive the changes made by the user.

 

I tried writing a setTabAccounts API but it was not called upon user changes.

Also tried writing a setPitem API but, had the same result.

 

What "set" API should I write to get the user changes?

 

Thanks,

Guy

 

 

 

 

 

 

 

 

Hi,

 

I have a few seelct lists that the user selects from and then press a commandButton that calls my API that save a list of objects in the DB.

On the bottom part of the screen I have a dataTable that presents all the object instances on the list that was just built.

 

The problem is: The dataTable doesn't refresh, I can change the selections and press go again and the DB changes, but my table that was already built and presented on the screen won't refresh.

 

I tried rebuilding it by using reRended on the action botton, but it didn't work (also tried wrapping the dataTable with outputPannel and tried to use it in the reRender, but it does nothing to the table, any suggestions?

 

Here is the relavent sections of the code:

 

....

....

....

<apex:commandButton action="{!refresh}" value="Go"  reRender="ThePageBlockWrapper"/>

 

 

<apex:outputPanel id="ThePageBlockWrapper">

      <apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

          <apex:dataTable value="{!acc}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Account" >

          <apex:outputText value="{!pitem.name}" /> 

          </apex:column>

....
....
....

 

 

Thanks,

Guy

 

 

 

Hi,

 

I have a custom controller called: MyController, I did 

Error: Unknown constructor 'MyController.MyController(ApexPages.StandardSetController controller)'.

 

On my controller code I have the following implementation of a simple constructor:

 

public class MyController {
    public Plan_Table__c table;
    public List <Table_Account__c> table_acc;
    public MyController() {
        table = null;
        table_acc = null;
    }

 

 

// some get and set APIs ....

...

...

...

}

 

Why do I keep getting this error when saving my tag file:

<apex:page standardStylesheets="false" sidebar="false" StandardController="Table_Account__c" Extensions="MyController" tabStyle="Account" recordSetVar="acc">

 

...

...

...

 

 

Thanks,

Guy

Hi,

 

I have a few questions and I know it is a bit a lot but...
if you can help me with even just one I would really appreciate it.
I have my custom object (Employee) and I would like to make a screen that allows the user to choose a Company (custom object), a department (custom object) and a year.
And then create a table with all the employees that work in this company in this department.
Problems: (and again, any problem answered would be great).
1. If I use an <apex:inputField...> on company__c it is not allowed because  <apex:inputField...> can only be used on sObject Fields, and if I use it on company__c.name, it doesn't give the user the choices of existing companies to choose, only a plain empty input text box.
How can I make the input be a choice between already existing company instances?
(One way would be to create a custon object ("Choice__c") that holds lookup fields of type company__c and department__c and then use <apex:inputField...> on value= {!Choice__c.company} and {!Choice__c.department} but is that not a "dirty code", because I don't need to save any instances of Choice__c in my data base, just use them to display later the employees that matches the chice on the screen and that's it.
2. After choosing the company from the list of existing company instances, I would like to allow the user to choose the department in the same way, but also, I want only the departments that belong to this company choosen to appear as choice options (my department custom object has Master detail relationship with company__c and every department instance is pointing to a specific company).
How can I filter only that department to show as choice options?
3. Lets say I have an object "Choice__c" that holds the company and department and I want to go over the employees and find the ones that are related to the choosen company and department and present them on a table on the VF page.
so I make a refresh action API that goes on all the employees and checks if:
employee.Company__c.name == choice.Company__c.name
(Employee__c employee & Choice__c choice - were defined).
but keep getting this error message:
Error: Compile Error: Invalid foreign key relationship: Choice__c.Company__c at line 43 column 19
What does it mean and how should I correct my code?
Thanks,
Guy

 

Hi,

 

I have an object of custom type: Company

I have anohter object called: Department which has a Master-Detail field -> Company

My third and last object is Employee and it has 2 Master detail relationships ->Company & ->Department

 

Now, I have a few companies and a few departments (each of the departments belong to a specific company).

 

When I open a new Employee I need to choose a company on the company field and a Department on the department field of the Employee.

 

Problem:

After choosing a company that the employee belongs to, I want the option list for choosing the department to only hold departments that belong to the company I choose.

 

How can I do that?

If someone know, I could really use the help,

Thanks,

Guy

Hi,

 

I have an object and I want one of its fields (product code) to be a number.

if I choose the field type as number it displays: 1,234,567 instead of 1234567

so I want it to be text: but I want to validate no letters were entered, how do I do that?

 

Would really appreciate the answer.

 

Thanks,

Guy 

Hello,

 

I have the free developer edition but in order to develope apex code I need to use a sandbox,

(don't have on setup->develope->apex the button "new" for adding new apex code).

 

I was wondering, is that normal? do I need a "developer edition organization" in order to code in apex without a sandbox?

or is actually "Free Developer Edition" == "Developer Edition Organization" and apex coding is always done on a sandbox?

 

Thanks,

Guy

 

 

Hi,

 

I've used as stylesheet value -> 'styles.css'
in one of the tutorials, the table looks great, but the salesforce environment on that page looks different then other tabs.

 

I've tried using different styleslike:    'allCustom.css' or 'Theme3.css' and got the regular fill and look of salesforce but my data table looks really bad.

 

Is there a ready style that would allow my data table to look great while keeping the look and fill of other salesforce pages?

 

Guy

Hi,

 

I have a custom controller called: MyController, I did 

Error: Unknown constructor 'MyController.MyController(ApexPages.StandardSetController controller)'.

 

On my controller code I have the following implementation of a simple constructor:

 

public class MyController {
    public Plan_Table__c table;
    public List <Table_Account__c> table_acc;
    public MyController() {
        table = null;
        table_acc = null;
    }

 

 

// some get and set APIs ....

...

...

...

}

 

Why do I keep getting this error when saving my tag file:

<apex:page standardStylesheets="false" sidebar="false" StandardController="Table_Account__c" Extensions="MyController" tabStyle="Account" recordSetVar="acc">

 

...

...

...

 

 

Thanks,

Guy

Hi,

 

Getting really frustrated trying to solve a problem that is not allowing me to proceed for 2 days now.

If anyone can help, please do...

 

 

Have an Object Table_Account__c which has a few fields (lets say for simplicity):

test1__c

test2__c

test3__c

total__c

 

Also have a dataTable that presents instances of this object as inputFields on the table.

 

This is my getter for the table that is displayed later:

 

    public List<Table_Account__c> getTabAccounts() {

        this.TabAccount = [SELECT name, id, account_name__c, test1__c, test2__c, test3__c,

         Total__c from Table_Account__c];

        System.debug(Logginglevel.DEBUG, '##### I am in Get ##############################################');

        return this.TabAccount;

    }

 

The dataTable attribute creation code is:

 

<apex:page standardStylesheets="false" sidebar="false" Controller="MyController" tabStyle="Account">

....
....
....

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

     <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Test1">

          <apex:inputField value="{!pitem.test1__c}" style="width: 80px"/>

           </apex:column>

          <apex:column headerValue="Test2">

          <apex:inputField value="{!pitem.test2__c}" style="width: 80px"/>

          </apex:column>

 <apex:column headerValue="Test3">

          <apex:inputField value="{!pitem.test3__c}" style="width: 80px"/>

          </apex:column>

 

  <apex:column headerValue="Total">

          <apex:inputField value="{!pitem.total__c}" style="width: 80px"/>

          </apex:column>

 

...

...

...

 

after user is changing the values in some of the dataTable input boxes and press a button which is connected to {!quicksave}.

The dataTable updates back to the original values instead of the new ones just saved.

 

Does anyone has an explanation.

 

The only explanation that I might have is that maybe my getter is called before the setter so it updates the table back with the DB values, then the setter is called after the values are already the old ones hence no change in the DB and then the quicksave. later when the getter rebuilds the dataTable again it builds it with the DB values which are the same as the old values.      Could that be it?

(I can see in the Debug that the getter is called twice, one of which is before the quicksave but is it also before the setter updates the DB?)

If that is the case, what can I do?

 

Hi,

 

I have the following dataTable:

 

 

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">
          <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">
          <apex:column headerValue="Account" >
          <apex:outputText value="{!pitem.name}" style="width: 80px"/> 
          </apex:column>
          <apex:column headerValue="Jan">
          <apex:inputField value="{!pitem.Jan__c}" style="width: 80px"/> 
          </apex:column>
          <apex:column headerValue="Feb">
          <apex:inputField value="{!pitem.Feb__c}" style="width: 80px"/>
          </apex:column>

 

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

     <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Test1">

          <apex:inputField value="{!pitem.test1__c}" style="width: 80px"/>

           </apex:column>

          <apex:column headerValue="Test2">

          <apex:inputField value="{!pitem.test2__c}" style="width: 80px"/>

          </apex:column>

..........

..........

..........

 

          <apex:column headerValue="Test10">

          <apex:inputField value="{!pitem.test10__c}" style="width: 80px"/>

          </apex:column>

..........

..........

..........

 

 

On the controller I have the getTabAccounts that returns a list of my Table_Account__c objects (from which the dataTable is being built).

 

When the user changes the values on the dataTable input fields I would like to have a "set" API that would recive the changes made by the user.

 

I tried writing a setTabAccounts API but it was not called upon user changes.

Also tried writing a setPitem API but, had the same result.

 

What "set" API should I write to get the user changes?

 

Thanks,

Guy

 

 

 

 

 

 

 

 

Hi,

 

I have a few seelct lists that the user selects from and then press a commandButton that calls my API that save a list of objects in the DB.

On the bottom part of the screen I have a dataTable that presents all the object instances on the list that was just built.

 

The problem is: The dataTable doesn't refresh, I can change the selections and press go again and the DB changes, but my table that was already built and presented on the screen won't refresh.

 

I tried rebuilding it by using reRended on the action botton, but it didn't work (also tried wrapping the dataTable with outputPannel and tried to use it in the reRender, but it does nothing to the table, any suggestions?

 

Here is the relavent sections of the code:

 

....

....

....

<apex:commandButton action="{!refresh}" value="Go"  reRender="ThePageBlockWrapper"/>

 

 

<apex:outputPanel id="ThePageBlockWrapper">

      <apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

          <apex:dataTable value="{!acc}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Account" >

          <apex:outputText value="{!pitem.name}" /> 

          </apex:column>

....
....
....

 

 

Thanks,

Guy

 

 

 

Hi,

 

I have an object of custom type: Company

I have anohter object called: Department which has a Master-Detail field -> Company

My third and last object is Employee and it has 2 Master detail relationships ->Company & ->Department

 

Now, I have a few companies and a few departments (each of the departments belong to a specific company).

 

When I open a new Employee I need to choose a company on the company field and a Department on the department field of the Employee.

 

Problem:

After choosing a company that the employee belongs to, I want the option list for choosing the department to only hold departments that belong to the company I choose.

 

How can I do that?

If someone know, I could really use the help,

Thanks,

Guy

Hi,

 

I have an object and I want one of its fields (product code) to be a number.

if I choose the field type as number it displays: 1,234,567 instead of 1234567

so I want it to be text: but I want to validate no letters were entered, how do I do that?

 

Would really appreciate the answer.

 

Thanks,

Guy 

Hi,

 

I've used as stylesheet value -> 'styles.css'
in one of the tutorials, the table looks great, but the salesforce environment on that page looks different then other tabs.

 

I've tried using different styleslike:    'allCustom.css' or 'Theme3.css' and got the regular fill and look of salesforce but my data table looks really bad.

 

Is there a ready style that would allow my data table to look great while keeping the look and fill of other salesforce pages?

 

Guy