• sonatine
  • NEWBIE
  • 0 Points
  • Member since 2009

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

hi guys,

i have a requirement to make a dynamic inputText, where it should disabled or enabled according to the value of a checkbox field in an object, for example:

 

<apex:inputText value="{!My_Object__c.Quantity__c}" disabled="{!My_Object__c.Disable__c}" />

 

where Disable__c field is a checkbox field.

 

 

but i keep getting this error when i try to insert the My_Object__c.

 

 

<apex:inputText> element value must resolve to a String type!

 

 


can anyone help me with this?

thank you in advance.

 

 

Regards,

 


hi all,

anyone know a good CTI to integrates switchvox into salesforce?

 

currently we have limited access to salesforce via the switchboard provided by switchvox.

but our original idea is to have the phone system inside the salesforce along with the salesforce softphone.

please let me know if you know a good CTI to do this.

 

all i can find so far is the camrivox.com, it can be used to integrates Asterisk PBX into salesforce.

 

thank you in advance.

 

 

 

Regards,

 

 

hi guys,

i have a requirement to grab a pdf page from an external link, and attach it into an object.

by that i mean if you open the external link in a browser, it will come up as a pdf file.

 

i know how to attach it, but as far as i know the PageReference .getContent() can only work for visualforce page.

 

anyone know how to do this?

 

thank you in advance.

 

hi guys,

is it possible to create a lookup field that will lookup an object based on the object chosen from a picklist?

just like the one under Activities -> Task Fields -> Related To

 

screenshot:

 

SS2

 

SS1

 

or we have to make a custom field via visualforce + apex?

 

thanks in advance.

 

hi guys,

how do you customise the pop-up window made by commandLink target="_blank"? like resizing the window for example.

as now the popup window will appear in a new tab.

i know we can do it using window.open javascript, but can we do it without using javascript?

can anyone help me?

 

thanks.

guys i need some help.

i have two pages,

the first page should display the list of  Class Name and checkboxes.

it will allow the user to choose "Classes" and display them in the second page when the user click the "Submit" button.

 

my problem is: the second page should be a pop-up window.

 

i know how to do it via the controller if second page is Not a new pop-up window,

by getting the list of checked Classes, and using something like "return Page.SecondPage".

 

is it possible to display PageReference in a new window?

or do we have to use Javascript to do this?

 

can anyone help me on this please?

or tell me which tutorial or Javascript guide i should read, as i know very little about Javascript.

 

thanks in advance.

 

first page:

 

<apex:page controller="CheckboxPassValue_controller" showHeader="false">
<apex:form >
<apex:dataTable value="{!List}" var="l" >
<apex:column headerValue="Class Name" >
<apex:outputText value="{!l.cls.Name}" />
</apex:column>
<apex:column headerValue="Checkbox" >
<apex:inputCheckbox value="{!l.selected}" />
</apex:column>
</apex:dataTable>
<apex:commandButton value="Submit" action="PageTwo"/>
</apex:form>
</apex:page>

 

and this is how i did it using pagereference:

second page:

 

<apex:page controller="CheckboxPassValue_controller" showHeader="false">
<apex:form >
<apex:dataTable value="{!Selected}" var="sel" >
<apex:column headerValue="The List" >
<apex:outputText value="{!sel.Name}" />
</apex:column>
</apex:dataTable>
</apex:form>
</apex:page>

 controller:

 

public with sharing class CheckboxPassValue_controller {
public List<cClass> listOfCClass {get; set;}
public List<SFDC_Class__c> listOfCls {get; set;}

public List<cClass> getList() {
if (listOfCClass == null) {
listOfCClass = new List<cClass>();
List<SFDC_Class__c> classList = [SELECT Id, Name
FROM SFDC_Class__c LIMIT 5];
for (SFDC_Class__c c : classList) {
cClass cC = new cClass(c);
listOfCClass.add(cC);
}
}
return listOfCClass;
}

public List<SFDC_Class__c> getSelected() {
listOfCls = new List<SFDC_Class__c>();
for (cClass cC : getList()) {
if (cC.getSelected() == true) {
listOfCls.add(cC.getCls());
}
}
return listOfCls;
}

public PageReference PageTwo() {
return Page.CheckboxPassValue_pageTwo;
}

public class cClass {
SFDC_Class__c cls = new SFDC_Class__c();
public void setCls(SFDC_Class__c a) {
this.cls = a;
}
public SFDC_Class__c getCls() {
return cls;
}

Boolean selected;
public void setSelected(Boolean f) {
this.selected = f;
}
public Boolean getSelected() {
return selected;
}

public cClass() {
selected = false;
}

public cClass(SFDC_Class__c c) {
cls = c;
selected = false;
}
}
}

 

 

 

 

 

hey guys, i get this error all of the sudden.

"System.VisualforceException: core.apexpages.exceptions.ApexPagesGenericException:

Class.GenerateAttachEmailCertificate_WS.GenerateAttachEmailCertificate: line 10, column 18
Class.GenerateAttachEmailCertificate_WS.testingEmail: line 93, column 14
External entry point".

 

line 9 and 10:

 

PageReference pdf = new PageReference('/apex/CertificatePrintToPdf?id=' + id); Blob pdfBody = pdf.getContent();

 

and line 93 is inside my test method:

 

testSend = GenerateAttachEmailCertificate_WS.GenerateAttachEmailCertificate(testId, testVer, testLoc);

 

im pretty sure it was 100% coverage, but now im in the middle of deploying a new class into production, and i got that error.

 

can anyone help me please?

thanks in advance.

 

 

 

 

 

hi guys, i need help.

im trying to make a trigger, so that when a new Task get in, it will catch the ActivityDate, and check it.

if its earlier than all other tasks (with the same whatId of the new task), it should update the field in Case object (Next_Task_Event_Due_Date__c).

 

here is the code:

 

 

for(Task thistask : trigger.new) {
String taskwhatId = thistask.WhatId;
if (taskwhatId.startsWith('500')) {
Case thecase = [SELECT Id, Last_Activity_History__c, Next_Task_Event_Due_Date__c
FROM Case WHERE Id = :taskwhatId];
if (thistask.Status == 'Completed') {
thecase.Last_Activity_History__c = thistask.LastModifiedDate;
}
else {
Task checkAllTask = [SELECT Id, ActivityDate, WhatId
FROM Task
WHERE WhatId = :thistask.WhatId
ORDER BY ActivityDate DESC LIMIT 1];
if (thistask.ActivityDate > checkAllTask.ActivityDate)
thecase.Next_Task_Event_Due_Date__c = checkAllTask.ActivityDate;
else
thecase.Next_Task_Event_Due_Date__c = thistask.ActivityDate;
}
update thiscase;
}
}

 

if you notice, i have another field (Last_Activity_History__c) in Case object,

the trigger for that  is working fine, it catch the latest activity history.

but im unable to get the Next_Task_Event_Due_Date__c to get the value.

 

thanks in advance.

 

 

hi guys,

i have a requirement to make a dynamic inputText, where it should disabled or enabled according to the value of a checkbox field in an object, for example:

 

<apex:inputText value="{!My_Object__c.Quantity__c}" disabled="{!My_Object__c.Disable__c}" />

 

where Disable__c field is a checkbox field.

 

 

but i keep getting this error when i try to insert the My_Object__c.

 

 

<apex:inputText> element value must resolve to a String type!

 

 


can anyone help me with this?

thank you in advance.

 

 

Regards,

 


hi all,

anyone know a good CTI to integrates switchvox into salesforce?

 

currently we have limited access to salesforce via the switchboard provided by switchvox.

but our original idea is to have the phone system inside the salesforce along with the salesforce softphone.

please let me know if you know a good CTI to do this.

 

all i can find so far is the camrivox.com, it can be used to integrates Asterisk PBX into salesforce.

 

thank you in advance.

 

 

 

Regards,

 

 

hi guys,

i have a requirement to grab a pdf page from an external link, and attach it into an object.

by that i mean if you open the external link in a browser, it will come up as a pdf file.

 

i know how to attach it, but as far as i know the PageReference .getContent() can only work for visualforce page.

 

anyone know how to do this?

 

thank you in advance.

 

guys i need some help.

i have two pages,

the first page should display the list of  Class Name and checkboxes.

it will allow the user to choose "Classes" and display them in the second page when the user click the "Submit" button.

 

my problem is: the second page should be a pop-up window.

 

i know how to do it via the controller if second page is Not a new pop-up window,

by getting the list of checked Classes, and using something like "return Page.SecondPage".

 

is it possible to display PageReference in a new window?

or do we have to use Javascript to do this?

 

can anyone help me on this please?

or tell me which tutorial or Javascript guide i should read, as i know very little about Javascript.

 

thanks in advance.

 

first page:

 

<apex:page controller="CheckboxPassValue_controller" showHeader="false">
<apex:form >
<apex:dataTable value="{!List}" var="l" >
<apex:column headerValue="Class Name" >
<apex:outputText value="{!l.cls.Name}" />
</apex:column>
<apex:column headerValue="Checkbox" >
<apex:inputCheckbox value="{!l.selected}" />
</apex:column>
</apex:dataTable>
<apex:commandButton value="Submit" action="PageTwo"/>
</apex:form>
</apex:page>

 

and this is how i did it using pagereference:

second page:

 

<apex:page controller="CheckboxPassValue_controller" showHeader="false">
<apex:form >
<apex:dataTable value="{!Selected}" var="sel" >
<apex:column headerValue="The List" >
<apex:outputText value="{!sel.Name}" />
</apex:column>
</apex:dataTable>
</apex:form>
</apex:page>

 controller:

 

public with sharing class CheckboxPassValue_controller {
public List<cClass> listOfCClass {get; set;}
public List<SFDC_Class__c> listOfCls {get; set;}

public List<cClass> getList() {
if (listOfCClass == null) {
listOfCClass = new List<cClass>();
List<SFDC_Class__c> classList = [SELECT Id, Name
FROM SFDC_Class__c LIMIT 5];
for (SFDC_Class__c c : classList) {
cClass cC = new cClass(c);
listOfCClass.add(cC);
}
}
return listOfCClass;
}

public List<SFDC_Class__c> getSelected() {
listOfCls = new List<SFDC_Class__c>();
for (cClass cC : getList()) {
if (cC.getSelected() == true) {
listOfCls.add(cC.getCls());
}
}
return listOfCls;
}

public PageReference PageTwo() {
return Page.CheckboxPassValue_pageTwo;
}

public class cClass {
SFDC_Class__c cls = new SFDC_Class__c();
public void setCls(SFDC_Class__c a) {
this.cls = a;
}
public SFDC_Class__c getCls() {
return cls;
}

Boolean selected;
public void setSelected(Boolean f) {
this.selected = f;
}
public Boolean getSelected() {
return selected;
}

public cClass() {
selected = false;
}

public cClass(SFDC_Class__c c) {
cls = c;
selected = false;
}
}
}

 

 

 

 

 

hey guys, i get this error all of the sudden.

"System.VisualforceException: core.apexpages.exceptions.ApexPagesGenericException:

Class.GenerateAttachEmailCertificate_WS.GenerateAttachEmailCertificate: line 10, column 18
Class.GenerateAttachEmailCertificate_WS.testingEmail: line 93, column 14
External entry point".

 

line 9 and 10:

 

PageReference pdf = new PageReference('/apex/CertificatePrintToPdf?id=' + id); Blob pdfBody = pdf.getContent();

 

and line 93 is inside my test method:

 

testSend = GenerateAttachEmailCertificate_WS.GenerateAttachEmailCertificate(testId, testVer, testLoc);

 

im pretty sure it was 100% coverage, but now im in the middle of deploying a new class into production, and i got that error.

 

can anyone help me please?

thanks in advance.