-
ChatterFeed
-
3Best Answers
-
0Likes Received
-
0Likes Given
-
8Questions
-
28Replies
help needed on Two Checkbox columns !!!
Hello
My requirement is to displayed a table with two chexbox columns and allow the user to select only one checkbox in each column.
The below code is working fine for only one column. first when i select first checkbox in mastercolumn and then select 2nd checkbox in the same mastercolumn then it is automatically deselecting the first and selecting the 2nd using the below code.
But when i select any checkbox in the duplicatecolumn then the checkbox selected in the mastercolumn is getting deselected.
Does anyone have any idea on how to resolve this issue?..please advise.....Thanks in advance
Master |
Duplicate |
Name |
Owner |
|
|
Acme1 |
john |
|
|
Acme2 |
jim |
|
|
Acme |
john |
<apex:page tabStyle="Account" controller="Account_controller" action="{!init}">
<script>
var selectedChkbox;
function deSelectOthers(chkBox)
{
if (chkBox.checked)
{
if ((chkBox != selectedChkbox) && (selectedChkbox != null))
{
selectedChkbox.checked = false;
}
selectedChkbox = chkBox;
}
}
</script>
<apex:form >
<apex:pageBlock>
<apex:panelGrid id="AccountDetail" columns="1" width="150%">
<apex:pageBlock id="page1">
<apex:pageBlockButtons location="Bottom">
<apex:commandButton action="{!continue1}" value="Continue"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Select Master and Dupe records">
<apex:pageBlockTable value="{!AccountResults}" var="acc" rules="all" width="150%">
<apex:column headerValue="Master">
<apex:outputPanel id="op1">
<apex:inputCheckBox value="{!Mstchk}" id="master_Checkbox" disabled="{!Mstchk}" onclick="deSelectOthers(this)">
</apex:inputCheckBox>
</apex:outputPanel>
<script>
if ("{!Mstchk}" == "true")
{
var idForSelectedBox = "$component.master_Checkbox";
selectedChkbox = document.getElementById(idForSelectedBox);
}
</script>
</apex:column>
<apex:column headerValue="Duplicate">
<apex:outputPanel id="op2">
<apex:inputCheckBox value="{!Dupchk}" id="duplicate_Checkbox" disabled="{!Dupchk}" onclick="deSelectOthers(this)">
</apex:inputCheckBox>
</apex:outputPanel>
<script>
if ("{!Dupchk}" == "true")
{
var idForSelectedBox = "$component.duplicate_Checkbox";
selectedChkbox = document.getElementById(idForSelectedBox);
}
</script>
</apex:column>
<apex:column headerValue="Name" value="{!acc.Name}">
</apex:column>
<apex:column headerValue="Owner" value="{!acc.Owner.Name}">
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:panelGrid>
</apex:form>
</apex:page>
public class Account_controller
{
private String searchText;
private Boolean Dupchk;
private Boolean Mstchk;
public string AName;
Id AcctId =ApexPages.currentPage().getparameters().get('id');
public Account acctName;
List<Account> AccountResults=null;
public List<Account> getAccountResults()
{
return AccountResults;
}
public Boolean getDupChk()
{
return Dupchk;
}
public void setDupChk (Boolean Dupchk)
{
this.Dupchk = Dupchk;
}
public Boolean getMstChk()
{
return Mstchk;
}
public void setMstChk (Boolean Mstchk)
{
this.Mstchk = Mstchk;
}
public string getSearchText()
{
return AName;
}
public void setSearchText (String searchText)
{
this.searchText = searchText;
}
public PageReference continue1()
{
return null;
}
public PageReference init()
{
acctName=[Select Name from Account where id=:AcctId];
AName=acctName.Name;
return null;
}
public void search()
{
try
{
AccountResults= (List<Account>)[select Id, Name, Type, BillingStreet,Billingcity,BillingState,BillingPostalCode,Owner.Name from Account where Name like: searchText+'%'];
}
catch (Exception e)
{
AccountResults = (List<Account>)null;
System.Debug('Error in search criteria.');
}
}
public Class AccountResults
{
public Account Acc
{
get;
set;
}
public Boolean selected
{
get;
set;
}
public AccountResults(Account a)
{
Acc=a;
selected=false;
}
}
}
-
- renuami
- July 17, 2009
- Like
- 0
- Continue reading or reply
WSDL2APEX: Generate from WSDL button unavailable
I am trying to perform an Apex callout to our .Net webserivce. I would like to use the WSDL2APEX however, the button is not available when I go to Setup | Develop | Apex Classes. Is this only available on certain licenses (our license is currently Platform)? I did not see any documentation stating this. Am I missing something?
Worst case, I guess I will use HTTP services.
-
- valMoto
- March 26, 2009
- Like
- 0
- Continue reading or reply
Query for possible values for Picklist or Multiple picklist
I would like to query the possible values for a picklist to put up a mutli-select field on my page. Is there a way to query for the possible values for a simple picklist?
Also, I'd like to do the same for a multi-select picklist. I know this was asked before and it wasn't possible in the past. Is there any way to do it now?
-
- Ken_Koellner
- March 25, 2009
- Like
- 0
- Continue reading or reply
Access Salesforce API from .NET compact framework
Hi all,
I created a .NET app which does a simple SOQL call to Salesforce, works fine in standard .NET 3.5. When I ported it to WM 6.0 smart device app, running on top of compact framework 3.5, it throws a NotImplementedException error.
Does anyone have a working C# example for compact framework?
Cheers,
Ian
-
- AltiumForce
- August 24, 2009
- Like
- 0
- Continue reading or reply
Visualforce pages in SelfService portal
Hi all,
I am being asked to create a customized SelfService portal using Visualforce page.
Visualforce page is not supported in SelfService portal according to this post:
http://salesforce.lithium.com/sforce/board/message?board.id=general_development&message.id=25305
Can anyone give me some ideas?
Thanks very much
Ian
-
- AltiumForce
- July 20, 2009
- Like
- 0
- Continue reading or reply
How to find out what pricebooks the current user can use?
Hi,
I am working on an Visualforce page for opportunity object, I need to ask user to select a pricebook for the opportunity.
It is straight forward for standard users - just show all active pricebooks, but parter users can only access the pricebooks defined in pricebook sharing.
How do I find out what pricebooks the current user can use in Apex code?
Thanks,
Ian
-
- AltiumForce
- March 26, 2009
- Like
- 0
- Continue reading or reply
Anyone deployed Apex code with Unicode characters successfully in Eclipse?
Has anyone deployed Apex code with Unicode characters successfully in Eclipse?
It seems it's the area no one has touched?
-
- AltiumForce
- October 14, 2007
- Like
- 0
- Continue reading or reply
CompileAndTest Apex code in .NET app
Here is part of my code:
ApexService sfdc = new ApexService(); sfdc.SessionHeaderValue = new SessionHeader(); sfdc.SessionHeaderValue.sessionId = CreateSession(txtUsername.Text, txtPassword.Text).SessionHeaderValue.sessionId; sfdc.Timeout = 60 * 1000; sfdc.RequestEncoding = Encoding.UTF8; CompileClassResult testResult = sfdc.compileClasses(new string[] { txtSourceCode.Lines.ToString() })[0]; if (!testResult.success) txtResult.Text += testResult.problem;
When I passed in a simple empty class: public class TestClass { }, I was getting an error says: unexpected token: System.String
-
- AltiumForce
- October 12, 2007
- Like
- 0
- Continue reading or reply
Eclipse Apex Unicode Save/Deploy problem
-
- AltiumForce
- September 04, 2007
- Like
- 0
- Continue reading or reply
AJAX 8.0 session management issue
Just curious if I do not call a s-control directly but use it in an URL (/servlet/servlet.Integration?lid=xxxxx),
how do I set the session id then?
-
- AltiumForce
- January 24, 2007
- Like
- 0
- Continue reading or reply
AJAX 8.0 error: Attribute "xmlns" was already specified for element...
faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to namespaces "http://www.w3.org/2000/xmlns/" was already specified for element "query"'
Code is simple:Code:
try { var oppRes = sforce.connection.query("SELECT id,Name, Pricebook2Id FROM opportunity WHERE id = '{!SFDC_520_Quote_Opportunity_ID}'"); } catch(error) { alert('Error: ' = error) ; }
It seems the same namespace prefix was added twice, and it is done inside connection.js.
This does not happen to all s-controls, I tried but couldn't find the pattern.
Anyone has a clue? Thanks!
-
- AltiumForce
- January 22, 2007
- Like
- 0
- Continue reading or reply
Visualforce pages in SelfService portal
Hi all,
I am being asked to create a customized SelfService portal using Visualforce page.
Visualforce page is not supported in SelfService portal according to this post:
http://salesforce.lithium.com/sforce/board/message?board.id=general_development&message.id=25305
Can anyone give me some ideas?
Thanks very much
Ian
- AltiumForce
- July 20, 2009
- Like
- 0
- Continue reading or reply
help needed on Two Checkbox columns !!!
Hello
My requirement is to displayed a table with two chexbox columns and allow the user to select only one checkbox in each column.
The below code is working fine for only one column. first when i select first checkbox in mastercolumn and then select 2nd checkbox in the same mastercolumn then it is automatically deselecting the first and selecting the 2nd using the below code.
But when i select any checkbox in the duplicatecolumn then the checkbox selected in the mastercolumn is getting deselected.
Does anyone have any idea on how to resolve this issue?..please advise.....Thanks in advance
Master |
Duplicate |
Name |
Owner |
|
|
Acme1 |
john |
|
|
Acme2 |
jim |
|
|
Acme |
john |
<apex:page tabStyle="Account" controller="Account_controller" action="{!init}">
<script>
var selectedChkbox;
function deSelectOthers(chkBox)
{
if (chkBox.checked)
{
if ((chkBox != selectedChkbox) && (selectedChkbox != null))
{
selectedChkbox.checked = false;
}
selectedChkbox = chkBox;
}
}
</script>
<apex:form >
<apex:pageBlock>
<apex:panelGrid id="AccountDetail" columns="1" width="150%">
<apex:pageBlock id="page1">
<apex:pageBlockButtons location="Bottom">
<apex:commandButton action="{!continue1}" value="Continue"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Select Master and Dupe records">
<apex:pageBlockTable value="{!AccountResults}" var="acc" rules="all" width="150%">
<apex:column headerValue="Master">
<apex:outputPanel id="op1">
<apex:inputCheckBox value="{!Mstchk}" id="master_Checkbox" disabled="{!Mstchk}" onclick="deSelectOthers(this)">
</apex:inputCheckBox>
</apex:outputPanel>
<script>
if ("{!Mstchk}" == "true")
{
var idForSelectedBox = "$component.master_Checkbox";
selectedChkbox = document.getElementById(idForSelectedBox);
}
</script>
</apex:column>
<apex:column headerValue="Duplicate">
<apex:outputPanel id="op2">
<apex:inputCheckBox value="{!Dupchk}" id="duplicate_Checkbox" disabled="{!Dupchk}" onclick="deSelectOthers(this)">
</apex:inputCheckBox>
</apex:outputPanel>
<script>
if ("{!Dupchk}" == "true")
{
var idForSelectedBox = "$component.duplicate_Checkbox";
selectedChkbox = document.getElementById(idForSelectedBox);
}
</script>
</apex:column>
<apex:column headerValue="Name" value="{!acc.Name}">
</apex:column>
<apex:column headerValue="Owner" value="{!acc.Owner.Name}">
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:panelGrid>
</apex:form>
</apex:page>
public class Account_controller
{
private String searchText;
private Boolean Dupchk;
private Boolean Mstchk;
public string AName;
Id AcctId =ApexPages.currentPage().getparameters().get('id');
public Account acctName;
List<Account> AccountResults=null;
public List<Account> getAccountResults()
{
return AccountResults;
}
public Boolean getDupChk()
{
return Dupchk;
}
public void setDupChk (Boolean Dupchk)
{
this.Dupchk = Dupchk;
}
public Boolean getMstChk()
{
return Mstchk;
}
public void setMstChk (Boolean Mstchk)
{
this.Mstchk = Mstchk;
}
public string getSearchText()
{
return AName;
}
public void setSearchText (String searchText)
{
this.searchText = searchText;
}
public PageReference continue1()
{
return null;
}
public PageReference init()
{
acctName=[Select Name from Account where id=:AcctId];
AName=acctName.Name;
return null;
}
public void search()
{
try
{
AccountResults= (List<Account>)[select Id, Name, Type, BillingStreet,Billingcity,BillingState,BillingPostalCode,Owner.Name from Account where Name like: searchText+'%'];
}
catch (Exception e)
{
AccountResults = (List<Account>)null;
System.Debug('Error in search criteria.');
}
}
public Class AccountResults
{
public Account Acc
{
get;
set;
}
public Boolean selected
{
get;
set;
}
public AccountResults(Account a)
{
Acc=a;
selected=false;
}
}
}
- renuami
- July 17, 2009
- Like
- 0
- Continue reading or reply
Issue with @Future method not getting called
Hello all.
I'm rather new to posting on the Discussion Boards, but I have found them extremely useful in cutting my teeth on force.com development. Big thanks to everyone who has helped me out so far...
I have a general question about future methods (ie Callouts):
I have a trigger in my sandbox that calls a method which calls out to a webservice I'm hosting. This was working great yesterday. The calls were almost instantaneous. This morning I start testing again, and I get the following error:
Failed to invoke future method 'public static void makeCallout(String)' Debug Log: System.CalloutException: Read timed out
Afterwards, everytime I called the method from my trigger, nothing would happen. No error messages, no activity on my web service, nothing. I even put some System.Debug lines in my method, and they never show up in the System Log. Also, I have in no way reached the 200 per licence per 24 hours limit. In addition, my web service is working great. I can call it using a SOAPUI client.
I did notice in the Montoring section under Apex jobs, that there is a record for every single attempt I made today, showing Job type as Future, Status Completed and Errors 0. So it appears that the method is getting called, but not being processed. Is it possible that the sandbox is queuing these up for some reason today? Can anyone point me in the right direction?
Thanks in advance!!!
Arnold
- arnold
- July 16, 2009
- Like
- 0
- Continue reading or reply
WSDL2APEX: Generate from WSDL button unavailable
I am trying to perform an Apex callout to our .Net webserivce. I would like to use the WSDL2APEX however, the button is not available when I go to Setup | Develop | Apex Classes. Is this only available on certain licenses (our license is currently Platform)? I did not see any documentation stating this. Am I missing something?
Worst case, I guess I will use HTTP services.
- valMoto
- March 26, 2009
- Like
- 0
- Continue reading or reply
How to find out what pricebooks the current user can use?
Hi,
I am working on an Visualforce page for opportunity object, I need to ask user to select a pricebook for the opportunity.
It is straight forward for standard users - just show all active pricebooks, but parter users can only access the pricebooks defined in pricebook sharing.
How do I find out what pricebooks the current user can use in Apex code?
Thanks,
Ian
- AltiumForce
- March 26, 2009
- Like
- 0
- Continue reading or reply
Query for possible values for Picklist or Multiple picklist
I would like to query the possible values for a picklist to put up a mutli-select field on my page. Is there a way to query for the possible values for a simple picklist?
Also, I'd like to do the same for a multi-select picklist. I know this was asked before and it wasn't possible in the past. Is there any way to do it now?
- Ken_Koellner
- March 25, 2009
- Like
- 0
- Continue reading or reply
How can i make 2 dimensional array in apex. Lists or Maps are not suitable for my purpose
Hi,
i want to make a two dimesional array in apex. Lists or Maps are not suitable for my purpose. How can I do that?
Thanks
- mwicks
- March 23, 2009
- Like
- 0
- Continue reading or reply
How to define PDF filename?
When rendering a page as a PDF the filename of the PDF is the name of the page which is not a good thing. The problem with this is that the name is not unique and can cause confusion with the user.
I'm working on a quoting app that renders a quote as a PDF. Some broswers open the PDF embed, others automatically launch your PDF reader, and some prompt you to save or open. The problem is that if opened or saved theses files are all saved as qoute.pdf, qoute[1].pdf, quote[2].pdf, quote[3].pdf. The problem should be obvious.
Ideally you should be able to define the name of the generated PDF but I haven't figured out how to do this.
Thanks,
Jason
- TehNrd
- February 25, 2009
- Like
- 1
- Continue reading or reply
SOQL isDeleted
SELECT Id, isDeleted FROM Contact WHERE isDeleted = true
Any clues?
- Sai Lavu
- July 24, 2008
- Like
- 0
- Continue reading or reply
Cancel Command Button not working because of required fields
I have a VF page associated with a controller extension with the "cancel" method, using PageReference. When I call the cancel method in the VF page, it works well.
However, I get an error message "you must enter a value" when I click on the Cancel button, because some fields on the page are required. If I fill in those fields, I can then cancel without problems.
Does anybody have any idea how to work around that?
Thanks a lot
- Schuey1
- July 08, 2008
- Like
- 0
- Continue reading or reply
Anyone deployed Apex code with Unicode characters successfully in Eclipse?
Has anyone deployed Apex code with Unicode characters successfully in Eclipse?
It seems it's the area no one has touched?
- AltiumForce
- October 14, 2007
- Like
- 0
- Continue reading or reply
CompileAndTest Apex code in .NET app
Here is part of my code:
ApexService sfdc = new ApexService(); sfdc.SessionHeaderValue = new SessionHeader(); sfdc.SessionHeaderValue.sessionId = CreateSession(txtUsername.Text, txtPassword.Text).SessionHeaderValue.sessionId; sfdc.Timeout = 60 * 1000; sfdc.RequestEncoding = Encoding.UTF8; CompileClassResult testResult = sfdc.compileClasses(new string[] { txtSourceCode.Lines.ToString() })[0]; if (!testResult.success) txtResult.Text += testResult.problem;
When I passed in a simple empty class: public class TestClass { }, I was getting an error says: unexpected token: System.String
- AltiumForce
- October 12, 2007
- Like
- 0
- Continue reading or reply
SOQL on CampaignMemberStatus fails in apex class?
I've got an apex class I'm building in eclipse. Not much going on yet, here's what it looks like so far:
Code:
Public Class CampaignMemberStat{ Public Static string GetRespondedStatus (Id campId) { // for a given campaign, look up the 'default' status to use for Responded CampaignMemberStatus[] cStatus = [Select c.Label, c.IsDefault From CampaignMemberStatus c WHERE c.CampaignId = :campId ORDER BY c.HasResponded desc, c.IsDefault desc]; } }When I attempt to compile this, i get an error "Illegal assignment from LIST:SOBJECT:CampaignMemberStatus to LIST:CampaignMemberStatus" on the line w/ the SOQL. I've checked and don't see anything wrong w/ my syntax. It's also true that:
* the SOQL query works in testing if I replace the variable w/ an Id
* the line as written seems to compile if pasted into a trigger (not a class)
* the class as written compiles if I chg the line into a query on another object (like Contact) instead of CampaignMemberStatus
Is there some restriction to using CampaignMemberStatus in a class? Or did I just screw up somewhere?
Thanks!
- sparky
- October 01, 2007
- Like
- 0
- Continue reading or reply
SOQL statements can't query related data
I tried one standard query from Apex Web Services API Developer's Guide topic Relationship Queries
======
SELECT Contact.FirstName, Contact.Account.Name from Contact
======
and I received an error: "SOQL statements can't query related data"
When I try to create querues using just only one object/table it works fine, but when there are more than one - it fails.
As I understand sample queries (from RTFM) with predefined objects/tables should work fine.
What the problem is?
Thanks a lot in advance.
- Mario P
- September 18, 2007
- Like
- 0
- Continue reading or reply