-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
11Questions
-
11Replies
keep getting a compilation error when trying to define enum
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
- guyr1981
- May 13, 2010
- Like
- 0
- Continue reading or reply
Dash Boards
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
- guyr1981
- May 12, 2010
- Like
- 0
- Continue reading or reply
user edits inputfields of an sObject but DB not updated
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?
- guyr1981
- May 09, 2010
- Like
- 0
- Continue reading or reply
how to set records from dataTable on a custom controller extension
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="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
- guyr1981
- May 09, 2010
- Like
- 0
- Continue reading or reply
refresh a dataTable
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
- guyr1981
- May 07, 2010
- Like
- 0
- Continue reading or reply
Error: Unknown constructor 'MyController.MyController(ApexPages.StandardSetController controller)'
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:
// 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
- guyr1981
- May 06, 2010
- Like
- 1
- Continue reading or reply
Filtering a custom object instances screen from user choices
Hi,
- guyr1981
- May 04, 2010
- Like
- 0
- Continue reading or reply
Filter choice of object
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
- guyr1981
- May 03, 2010
- Like
- 0
- Continue reading or reply
I want to validate a text entered is only digits and no letters, how can I do that?
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
- guyr1981
- May 02, 2010
- Like
- 0
- Continue reading or reply
Free Developer Edition VS. Developer Edition Organization
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
- guyr1981
- May 01, 2010
- Like
- 0
- Continue reading or reply
how to create a visualforce page that looks like other pages?
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
- guyr1981
- April 29, 2010
- Like
- 0
- Continue reading or reply
Error: Unknown constructor 'MyController.MyController(ApexPages.StandardSetController controller)'
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:
// 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
- guyr1981
- May 06, 2010
- Like
- 1
- Continue reading or reply
user edits inputfields of an sObject but DB not updated
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?
- guyr1981
- May 09, 2010
- Like
- 0
- Continue reading or reply
how to set records from dataTable on a custom controller extension
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="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
- guyr1981
- May 09, 2010
- Like
- 0
- Continue reading or reply
refresh a dataTable
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
- guyr1981
- May 07, 2010
- Like
- 0
- Continue reading or reply
Filter choice of object
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
- guyr1981
- May 03, 2010
- Like
- 0
- Continue reading or reply
I want to validate a text entered is only digits and no letters, how can I do that?
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
- guyr1981
- May 02, 2010
- Like
- 0
- Continue reading or reply
how to create a visualforce page that looks like other pages?
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
- guyr1981
- April 29, 2010
- Like
- 0
- Continue reading or reply