• tukmol
  • NEWBIE
  • 260 Points
  • Member since 2012

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

I have been using the IDE plugin for Eclipse for awhile and tried today for the first time to use the Execute Anonymous view. The Active Project, Log Category, and Log Level controls are enabled, but the "Source to execute:" textbox is disabled - in fact, I don't even see a textbox, just the prompt. I have been unable to find any information on what might be causing this or how to fix it. Can anyone help?

 

Thanks

  • June 27, 2012
  • Like
  • 0

Ok, I feel kind of dumb asking this, but I'm trying to get double quote characters to appear in either the title or subtitle attributes of an <apex:sectionHeader>. I tried using &quot;, but that gets converted into "&#34;" in the rendered page. I also tried using the " character directly, but the Visualforce compile gets confused by the nested quotes in the title or subtitle attribute. Am I missing something obvious?

  • June 26, 2012
  • Like
  • 0
<apex:page standardController="Account">
<script type="text/javascript">
function test()
{

var accname=document.getElementById("{!$Component.f.pb1.pbs1.a}").value;
alert(accname);
var message=document.getElementById("{!$Component.f.pb1.msg}").value;
alert(message);

}

</script>

<apex:form id="f">
<apex:pageBlock id="pb1">
<apex:pageMessages id="msg" />
<apex:pageBlockSection id="pbs1">
<apex:inputField value="{!account.name}" id="a" />
<apex:inputField value="{!account.industry}"/>
<apex:commandButton action="{!save}" value="Save!"/>
<apex:commandButton onclick="test();" value="test"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 For the above code

I am getting the value of field in account name but i am not able to get the error message displayed in alert

Its giving as "undefined".

 

Could anyone please help me out with this.

Hi 

 

Can some one pls. let me know how to set the all valuses in multiselect Pick list as default. here is the code.

 

Controller 

-------------------------

public class sampleCon {
String[] countries = new String[]{};

public PageReference test() {
return null;
}

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Americas','Americas'));
options.add(new SelectOption('AP','AP'));
options.add(new SelectOption('EMEA','EMEA'));
return options;
}

public String[] getCountries() {
return countries;
}

public void setCountries(String[] countries) {
this.countries = countries;
}
}

 

Page 

-------------------------------------------------------

 

<apex:page controller="sampleCon">
<apex:form >
<apex:selectList value="{!countries}" multiselect="true"> Channel :
<apex:selectOptions value="{!items}"/>
</apex:selectList><p/>

<apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
</apex:form>

<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="testing...">
<apex:facet name="stop">
<apex:outputPanel >
<p>You have selected:</p>
<apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
</apex:outputPanel>
</apex:facet>
</apex:actionstatus>
</apex:outputPanel>
</apex:page>

 

Thanks for your help in advance.

 

Hi All,

 

I have two custom objects Employee and Department, I have created and displaying one VF page with these objects Field Values and two command buttons like Update and Cancel buttons. Also created validation rules for those objects.While Updating the employee information I am entering wrong data on some fields. It displays the validation rule error message and at the same time those fields are get cleared

How to keep the wrong data on the fields.

How to resolve this "Fields get cleared" problem... Please suggest me.

 

Thanks,

yarram.

Hi,

 

I have an array of  type AggregateResult. How to loop through this?

 

For Eg:

 

AggregateResult[] pp = [select min(Purchase_Date__c)Purchase_Date__c, Account__c from Purchased_Products_del__c group by Account__c];

 

When i loop using

 

for(Purchased_Products_del__c ppd : pp) {} shows an error

 

"Save error: Loop variable must be of type SOBJECT:AggregateResult"

 

Please help

 

Thanks and Regards

Hari G S

 

 

 

OK. I'm tired, but can someone tell me why I keep getting "Error: Compile Error: Variable does not exist: c at line 42 column 16", when "c: is defined just a few lines above? Here's the relevant code...

 

trigger createCaseFromProject on SFDC_Project__c (after insert) {
    
    // iterate over the list of Project records being processed in the trigger and
    // create the required cases
    for (SFDC_Project__c prj : Trigger.new)

        //Define the Cases to Insert, then insert them

        // 01230000001B8slAAC   Account & Billing
        Case c = new Case(
            RecordType = '01230000001B8slAAC',
            Project__c = prj.Id,
            Subject = prj.Account__r.Name & ': Subject ',
            Description = ' Description ',
            Origin = 'From Project',
            SuppliedEmail = prj.Customer_Contact__r.Email,
            Contact = prj.Customer_Contact__r.Id,
            Account = prj.Account__r.Id,
            Status = 'New'
        );
        insert c;

}

 

The error is apparently in the line "insert c;"

But the variable is defined at the line "Case c = ..."

 

Or have my tired eyes missed something silly?

 

Thanks,

 

JaimieLivest

The title says it all, i created a visualforce page with some javascript in it:

 

<apex:page standardController="Aangebodenobject__c">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
       <script type="text/javascript">
        var $_org = jQuery.noConflict();
        $_org("#CF00NU0000002waYc").change(function(object){
            $_org("#Name").val($_org("#CF00NU0000002waYc").val());
        })
    </script>
</apex:page>

This bit of JS is used to populate the name field when a lookup object is selected pretty straight forward. So i added this as a Visualforce page to the edit layout but when i check the source this page isn't rendered ?! What am i doing wrong any tips?

 

Thanks,

Daniël

  • June 21, 2012
  • Like
  • 0

Hi,

We are developing salesforce using Visualforce for accounts and leads tabs.

We would like our Sales Managers to use Ipads and Iphones to log into accounts and leads, see the information, log follow-ups....We tried to see the developments done with Visualforce with the application for Iphone but we just see the default fields, none of the developments with visualforce are shown.

Could you please indicate me how to solve this?

Thanks a lot,

 

Antonio

<apex:page showheader="false" sidebar="false" controller="searchFlightsController" standardstylesheets="false">
<apex:form style="font-size:13pt">
<h1 style="text-align:center;color:black;"> Search for Flights </h1>
<apex:pageBlock title="Search for Flights">
<apex:pageblockSection >
<apex:inputField value="{!flight.departureCountry__c}" /><br/>
<apex:inputField value="{!flight.Departure__c}" />
<apex:inputField value="{!flight.destinationCountry__c}" /><br/>
<apex:inputField value="{!flight.Destination__c}" />
<apex:inputField value="{!flight.dayOfDeparture__c}"/><br/>
<apex:inputField value="{!flight.timeOfDeparture__c}" />
<apex:inputField value="{!flight.dayOfArrival__c}" /><br/>
<apex:inputField value="{!flight.timeOfArrival__c}" /><br/>
<apex:commandButton rerender="FlightsDetail" action="{!searchFlights}" value="Search for Flights">
<apex:param value="{!flight.dayOfDeparture__c}" assignTo="{!dayOfDep}"/>
</apex:commandButton>
</apex:pageblockSection>
<apex:pageblockSection >
<apex:outputPanel id="FlightsDetail">
<apex:repeat value="{!flightsResult}" var="flightres">
<p>{!flightres.timeOfArrival__c} </p>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Hi, i am having an error assigning the day the user selects (from a list) from a visualforce page. Whatever the day the user selects i want to use it in my controller. the problem is the value is always null. Any helps what i am doing wrong. (higlighted red whats not working) If i make the value monday it works. so i am not getting the value what the user selects i think

 

Thanks

We have requirement to send notification to whoever drafted the article, before it was published.

 

An article can be 'Drafted' by user1, and then can be published by user2. In this case, we would notify user1 that the article he drafted has been published by User2. We have no problem determining the publisher. Our problem is how to get User1 ("Drafter").

 

Creator is not necessarily the Drafter (i.e. for already published article).

 

Aricle does not support trigger, so it is out of the picture.

Workflow rule does not fire either, out of the picture.

 

Thanks for the help.

We are experiencing intermittent error when attaching a knowledge article to a case.

 

the error is:

 

Incorrect parameter type for operator '+'. Expected Number, Date, DateTime, received object
Error is in expression '{sectionIndex + 1}' in component <core.apexpages.components.cdk.ScopeSkipperComponent> in page null

 

the IE window/tab title (if it is relevant) is "Visualforce Error"

 

Do note that we don't have any Visualforce Page in our affected org, and we don't have that core.apexpages.components.cdk.ScopeSkipperComponent either.

 

What is this?

 

Thank you very much!

We are experiencing intermittent error when attaching a knowledge article to a case.

 

the error is:

 

Incorrect parameter type for operator '+'. Expected Number, Date, DateTime, received object
Error is in expression '{sectionIndex + 1}' in component <core.apexpages.components.cdk.ScopeSkipperComponent> in page null

 

the IE window/tab title (if it is relevant) is "Visualforce Error"

 

Do note that we don't have any Visualforce Page in our affected org, and we don't have that core.apexpages.components.cdk.ScopeSkipperComponent either.

 

What is this?

 

Thanks!

I'm not sure if I missed something, but I am trying to deploy numerous data categories/groups from UAT to production and I can't seem to find the selection of these in when I try to add item in the change set.

 

Is it not possible?

 

Do I have to do everything again in production?

 

Thanks

Why is salesforce adding an image tag to dynamically generated HTML email? It's causing us issues (Outlook).

 

Here's very simple code to with HTML generated content:

Messaging.Singleemailmessage mail;
mail = new Messaging.Singleemailmessage();
mail.setSubject('TEST 123');
mail.setHtmlBody( '<html><h1>THIS IS JUST A TEST</h1></html>');
mail.setSaveAsActivity(false);
mail.setTargetObjectId(UserInfo.getUserId());
Messaging.sendEmail(new List<Messaging.Singleemailmessage> {mail});

 When i execute this, it adds an image tag right before the closing HTML (</html>).

 

How to workaround this? Why is this?

 

Thanks

 

 

How to get this value? Where is it located? I tried ProcessInstance/WorkItems but it is not there.

Hi, is it not possible to batch knowledge article object?

 

See this batchacble class for example, this gives internal salesforce.com error whenever i try to run this.

 

public class EnumerateExpiredArticles
	implements database.Batchable<sobject> {
    public Database.QueryLocator start(Database.BatchableContext BC) {
    	// Access initialState here         	
    	return Database.getQueryLocator([SELECT  Title, Summary, OwnerId FROM Knowledge_Article__kav WHERE PublishStatus = 'Online' AND Language = 'en_US' AND LastPublishedDate = LAST_N_DAYS:180]);
  	}

  	public void execute(Database.BatchableContext BC,  List<sObject> batch) {
  		for (Knowledge_Article__kav ka : (List<Knowledge_Article__kav>) batch) {
  			//send notification to owner
  		}    	
    }

  	public void finish(Database.BatchableContext BC) {
  		   
	}		
}

But if replace the object with something else (i.e. case, account, etc), it goes fine.

 

any help?

 

thanks

Hi All,

 

Any idea how to add KA category as merge field in a (HTML/text) mail template?

 

Thanks all.

Just want to let off my annoyance with that stealer search at the upper right of the page :D

 

Whenver I would try to search the forum, and started typing in the search box, the other search box steals the focus!

 

Same thing happens when you type in the subject line or in message tags line.

 

It's in IE8. not sure with other browsers.

 

(I don't know in what section to post this, so I just put in "General Development" section. mods please feel free to move if needed)

 

//rant off

<apex:page showHeader="false" title="Test Page" id="thisPage">
    <apex:outputPanel id="tabItem1">
        <apex:form>
            <apex:pageBlock title="Test Page">
                <apex:pageBlockSection columns="1">
                    <apex:inputText label="Input here:" style="width:500px;"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
        </apex:form>
    </apex:outputPanel>        
    
    <script>
        var tab1 = document.getElementById('{! $component.thisPage.tabItem1}');
        alert(tab1.innerHTML);
    </script>
</apex:page>

In this simple apex page, when showHeader="false", innerHTML returns without the <form> tag, while it returns complete when showHeader="true"? what gives?

 

This is in IE8, our company standard browser.

 

it behaves normal in Firefox, i.e. <form> tag is not omitted whatever the showHeader flag is.

 

NOTE: the page above is just a simple page, just to show the inconsistency.

Hi all,

 

I'm creating a page to handle (override the default) adding/editing/viewing of custom object records.

 

I know I can create 2 or 3 pages to handle all the modes mentioned, but it would be handy to maintain just one page, since they would have the same layout and fields set. So it would be like have a page "Page1" to override "New", "Edit" and "View" of a custom object.

 

Now, how do would I determine if a record opened is in New/Edit or View mode?

 

Is there something like ApexPage.currentPage().isEditMode() that I could use?

 

Spent hours (a day actually) searching for this but didn't find an answer.

 

Thanks in advance.

I'm working on a formula for Entry Criteria for an Approval Process.  I want to check a picklist value.  I tried --

 

ISBLANK(TEXT(event_type__c))

 

I get this error --

 

Error: Incorrect parameter type for TEXT. Expected Number, Date, DateTime, received Picklist

 

Without the TEXT, I get the error that only certain functions will work on a picklist field.  I read the help and it says one of the ones to use is TEXT().  Then I use TEXT() and it complains about it being used on a picklist fields.

 

Is the documentation out-of -date?  Does the TEXT() not longer work on picklist and is there something else I should use.

Why is salesforce adding an image tag to dynamically generated HTML email? It's causing us issues (Outlook).

 

Here's very simple code to with HTML generated content:

Messaging.Singleemailmessage mail;
mail = new Messaging.Singleemailmessage();
mail.setSubject('TEST 123');
mail.setHtmlBody( '<html><h1>THIS IS JUST A TEST</h1></html>');
mail.setSaveAsActivity(false);
mail.setTargetObjectId(UserInfo.getUserId());
Messaging.sendEmail(new List<Messaging.Singleemailmessage> {mail});

 When i execute this, it adds an image tag right before the closing HTML (</html>).

 

How to workaround this? Why is this?

 

Thanks

 

 

How to get this value? Where is it located? I tried ProcessInstance/WorkItems but it is not there.

Hi, is it not possible to batch knowledge article object?

 

See this batchacble class for example, this gives internal salesforce.com error whenever i try to run this.

 

public class EnumerateExpiredArticles
	implements database.Batchable<sobject> {
    public Database.QueryLocator start(Database.BatchableContext BC) {
    	// Access initialState here         	
    	return Database.getQueryLocator([SELECT  Title, Summary, OwnerId FROM Knowledge_Article__kav WHERE PublishStatus = 'Online' AND Language = 'en_US' AND LastPublishedDate = LAST_N_DAYS:180]);
  	}

  	public void execute(Database.BatchableContext BC,  List<sObject> batch) {
  		for (Knowledge_Article__kav ka : (List<Knowledge_Article__kav>) batch) {
  			//send notification to owner
  		}    	
    }

  	public void finish(Database.BatchableContext BC) {
  		   
	}		
}

But if replace the object with something else (i.e. case, account, etc), it goes fine.

 

any help?

 

thanks

I have been using the IDE plugin for Eclipse for awhile and tried today for the first time to use the Execute Anonymous view. The Active Project, Log Category, and Log Level controls are enabled, but the "Source to execute:" textbox is disabled - in fact, I don't even see a textbox, just the prompt. I have been unable to find any information on what might be causing this or how to fix it. Can anyone help?

 

Thanks

  • June 27, 2012
  • Like
  • 0

Hi friends,

 

                      How to use Sytem.Resetpasswordresults()  method   in  vf page and apex class???   

 

                   

                     

I've seen some other threads around this subject, but the had a variety of issues being discussed and I'm hoping this one is more focused.

 

Am I missing something obvious? Here is my code:

 

@isTest
private class TestClassForIssue {
    public static Account testAccount1, testAccount2;

	static {
            testAccount1 = new Account(Name='testAccount1', NumberOfEmployees=10);
            insert testAccount1;
            System.assertNotEquals(testAccount1.Id, null);
	}

    static testMethod void test1() {
        System.assertNotEquals(testAccount1.Id, null);
}

 

The test1 testMethod assertion fails, saying that testAccount1.Id is null. Why is this? I'm sure I'm just missing something really obvious, but I'm not finding it...

Ok, I feel kind of dumb asking this, but I'm trying to get double quote characters to appear in either the title or subtitle attributes of an <apex:sectionHeader>. I tried using &quot;, but that gets converted into "&#34;" in the rendered page. I also tried using the " character directly, but the Visualforce compile gets confused by the nested quotes in the title or subtitle attribute. Am I missing something obvious?

  • June 26, 2012
  • Like
  • 0

how to put date in vfpage?i mean tosay.what is the way to put date in vfpage.is there any need to create a classs for this.

<apex:page standardController="Account">
<script type="text/javascript">
function test()
{

var accname=document.getElementById("{!$Component.f.pb1.pbs1.a}").value;
alert(accname);
var message=document.getElementById("{!$Component.f.pb1.msg}").value;
alert(message);

}

</script>

<apex:form id="f">
<apex:pageBlock id="pb1">
<apex:pageMessages id="msg" />
<apex:pageBlockSection id="pbs1">
<apex:inputField value="{!account.name}" id="a" />
<apex:inputField value="{!account.industry}"/>
<apex:commandButton action="{!save}" value="Save!"/>
<apex:commandButton onclick="test();" value="test"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 For the above code

I am getting the value of field in account name but i am not able to get the error message displayed in alert

Its giving as "undefined".

 

Could anyone please help me out with this.

Hi 

 

Can some one pls. let me know how to set the all valuses in multiselect Pick list as default. here is the code.

 

Controller 

-------------------------

public class sampleCon {
String[] countries = new String[]{};

public PageReference test() {
return null;
}

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Americas','Americas'));
options.add(new SelectOption('AP','AP'));
options.add(new SelectOption('EMEA','EMEA'));
return options;
}

public String[] getCountries() {
return countries;
}

public void setCountries(String[] countries) {
this.countries = countries;
}
}

 

Page 

-------------------------------------------------------

 

<apex:page controller="sampleCon">
<apex:form >
<apex:selectList value="{!countries}" multiselect="true"> Channel :
<apex:selectOptions value="{!items}"/>
</apex:selectList><p/>

<apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
</apex:form>

<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="testing...">
<apex:facet name="stop">
<apex:outputPanel >
<p>You have selected:</p>
<apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
</apex:outputPanel>
</apex:facet>
</apex:actionstatus>
</apex:outputPanel>
</apex:page>

 

Thanks for your help in advance.

 

Just want to let off my annoyance with that stealer search at the upper right of the page :D

 

Whenver I would try to search the forum, and started typing in the search box, the other search box steals the focus!

 

Same thing happens when you type in the subject line or in message tags line.

 

It's in IE8. not sure with other browsers.

 

(I don't know in what section to post this, so I just put in "General Development" section. mods please feel free to move if needed)

 

//rant off

Hi All,

 

I have two custom objects Employee and Department, I have created and displaying one VF page with these objects Field Values and two command buttons like Update and Cancel buttons. Also created validation rules for those objects.While Updating the employee information I am entering wrong data on some fields. It displays the validation rule error message and at the same time those fields are get cleared

How to keep the wrong data on the fields.

How to resolve this "Fields get cleared" problem... Please suggest me.

 

Thanks,

yarram.

Hi guys

 

Can someone please shed some light on this?

 

I've seen Messaging.SingleEmailMessage in the apex documentation.

 

So what is it exactly this Messaging is?  Is it a class?  An object?  Is it an Apex reserved word?

 

By looking at this syntax:

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

 

it looks to me that Messaging is a class and SingleEmailMessage is a static method and that's how you can have this syntax.  But I have been looking high and low on documentation about this "Messaging" class and I couldn't find any information.

 

Can you send me a URL from salesforce that teaches this Messaging class (if it is indeed a class)?

 

Thank you very much.

King