• incuGuS
  • NEWBIE
  • 230 Points
  • Member since 2010

  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 104
    Replies

I've been bouncing around the forums and searching online, which I thought would be easy. How do you create a new record on the Account object inside of a trigger?

 

I want the new Account to have a name, record type, owner id, and that's it.

  • May 10, 2010
  • Like
  • 0

Dears

 

Please could you help me to parse a XML code that contain the latitude and longitude of address? Below the XML code I try with the manual but I has for soap and the another example is too simple to parse this complicated XML of google.

 

I want to take the value of latitude and longitude.

 

Thanks in advances

 

<GeocodeResponse> 
 
<status>OK</status>
 
<result>
 
<type>street_address</type>
 
<formatted_address>1600 Amphi Pkwy, Mountain, CA 94043, USA</formatted_address>
 
<address_component>
   
<long_name>1600</long_name>
   
<short_name>1600</short_name>
   
<type>street_number</type>
 
</address_component>
 
<address_component>
   
<long_name>Amphitheatre Pkwy</long_name>
   
<short_name>Amphitheatre Pkwy</short_name>
   
<type>route</type>
 
</address_component>
 
<address_component>
   
<long_name>Mountain View</long_name>
   
<short_name>Mountain View</short_name>
   
<type>locality</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>San Jose</long_name>
   
<short_name>San Jose</short_name>
   
<type>administrative_area_level_3</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>Santa Clara</long_name>
   
<short_name>Santa Clara</short_name>
   
<type>administrative_area_level_2</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>California</long_name>
   
<short_name>CA</short_name>
   
<type>administrative_area_level_1</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>United States</long_name>
   
<short_name>US</short_name>
   
<type>country</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>94043</long_name>
   
<short_name>94043</short_name>
   
<type>postal_code</type>
 
</address_component>
 
<geometry>
   
<location>
   
<lat>37.4217550</lat>
   
<lng>-122.0846330</lng>
   
</location>
   
<location_type>ROOFTOP</location_type>
   
<viewport>
   
<southwest>
     
<lat>37.4188514</lat>
     
<lng>-122.0874526</lng>
   
</southwest>
   
<northeast>
     
<lat>37.4251466</lat>
     
<lng>-122.0811574</lng>
   
</northeast>
   
</viewport>
 
</geometry>
 
</result>
</GeocodeResponse>
  • April 27, 2010
  • Like
  • 0

 

Hello,

I've tried to put a select-query with Date/DateTime-Comparison using literals and the compiler always showed an error, like: "unexpected token: today (or LAST_MONTH,...)", Hence I took the following simple query example from the online sf documentation and put it into my eclipse:

       List<Account> acc = [SELECT Id FROM Account WHERE CreatedDate = YESTERDAY];

from: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_dateformats.htm

again the same error ("unexpected token: YESTERDAY") occured. Can someone explain, what's happening here?

Thanks

Hans

 

Hi

 

I would like to retrieve information from the parent of the Account linked to a contact. The query is based on the object Contacts, is it possible to do it?

 

Something like:

 

Select Account.ParentId.FieldName__c from Contact 

  • April 21, 2010
  • Like
  • 0

Hello,

 

I have written a simple trigger, but it does not compile for some reason.

I have a checkbox on my Campaign object called "High_Campaign__c" and a custom field of type text "Testing__c"

whenever the "High_Campaign__c" is checked i want to populate some text into custom field.

 

how do i check if a checkbox is checked or not? (like checkbox.checked=true).

Am i doing anything wrong?

 

The error is: execution of AfterUpdate caused by: System.Exception: Record is read-only: Trigger.TasksfornewMembers: line 6, column 12

 

Here is the code:

 

trigger TasksfornewMembers on Campaign (after Insert,after update) {

    for(Campaign c: Trigger.New)
    {
        if(c.High_Campaign__c=True)
           c.Testing__c='Hi I am Checked';
    }

}

 

Hi,

 

I am thinking if my idea is possible or not.

Can we write trigger on a campaign that processes only Campaigns that are marked "Special".

I have created a custom field called "Special Campaign" which is a checkbox.

Now when ever that checbox is checked and whenever users add Contacts or Leads to that Special campaign i need to create a task.Also i need to make sure i do not add duplicate contacts/leads.

I am guessing that we need to write a trigger to achieve this, but a trigger works on all campaigns. How do i make it work only for campaigns marked "Special"?

 

Or should i write a trigger and at first check if the checkbox is checked and then do processing as per business logic or any other way.

 

Any idea/start up code is highly appreciated.

 

Thanks,

Sales4ce

Hi,

 

How can i sort the list of values (ascending /descending) using soql query? 

 

 

SELECT Id, CommentBody, CreatedById, createdBy.communityNickname, CreatedDate, IdeaId 
                                          FROM IdeaComment 
                                          WHERE IdeaId in :ideaIds
                                          AND createdById = :createdById];

 

Can anyone provide the syntax?

 

Thanks,

Nik 

I am working on creating a site for our partners who can be registered members of our customer portal or they can be new users who can self sign up. I want the experience to be like a internet site with multiple links/tabs for multiple areas of website. I am not able to figure out how to create multiple tabs on my site.

 

Do I need to create a new Force.com application for this or can this be achieved with out it?

 

If there is any step by step guide for this topic I would really appreciate pointers to it.

 

Thanks in advance.

  • April 12, 2010
  • Like
  • 0

Hi community,

 

I need to connect to an URL from Salesforce, I mean, from a VF page. The URL returns an XML and I need to process it.

 

The URL is http://www.ctt.pt/pdcp/xml_pdcp?incodpos=1000234

 

where incodpos parameter is a Portuguese postal code.

 

I don't know the best way to proceed. Can anyone help me out with this, please?

 

Thanks in advance.

 

Regards.

Hello Guys and Girls,

 

 

When implementing URL Rewriting on a site with Ideas Base Theme (IBT) i found a problem that i haven't been able to work around.

The issue comes from the need of having links with dynamic page references, since the IBT uses pages overrides to customize the site.

When using Page References, Page Urls, String or any other form(except $Page.myPageName) the URLFOR does not convert to the Nice URL.

 

 

A bit of background:

 

The IBT uses a Site configuration object to hold in its records the information about a site using it, one of its options is to OVERRIDE the default pages for the site, for example IdeasPageList, which is the one handling the listing of ideas and browsing through categories, etc.

 

This field in the Site Config record takes a String, which is the name of the Page you want IdeasPageList to be overriden with.

Therefore i cannot use the $page.mypageName for the URLFOR since the Page to be used is Dynamic.

 

 

Tried >

 

 

public PageRefence IdeaListPage {get;set;}

 

 

<apex:outputLink value="{!URLFOR($Page.ideaList)}">All Ideas</apex:outputLink>

<apex:outputLink value="{!URLFOR(IdeaListPage.url)}">All Ideas</apex:outputLink>

<apex:outputLink value="{!IdeaListPage}">All Ideas</apex:outputLink

 

Result is >

 

 

https://mysite.force.com/sitename/all

https://mysite.force.com/sitename/ideaList

https://mysite.force.com/sitename/ideaList

 

Only the first one is Rewritten, because it uses the static $page.mypagename , and in order to make the Url Rewriting work for any site using IBT and work if the IdeaListPage is changed i need a way to make the Url Rewriting work either passing a Url String, or a Page reference, not only the $page.mypagename way.

 

 

So any ideas?  (no pun intended :P )

 

 

Thanks in advance,

Gaston!

 

 

Hello community,

 

Does anyone know if its possible or how to create a Email address for a Email service programatically?

 

Thanks,

Gaston.

Hello community,

 

Does anyone know if its possible or how to create a Email address for a Email service programatically?

 

Thanks,

Gaston.

I have a component I use on a VF page in a Site with a prefix--http://mysite.force.com/events. I create a relative link to a VF page that is part of the site like this:

 

 

<a href="Event?id={!event.Id}">{!event.Name}</a>

 

 

The link the component creates drops the prefix, however, and looks like this: http://mysite.force.com/Event?id=00dhwhegdhewy

 

What's the best way to preserve the site prefix in this case without hard-coding it into the component?

 

Thanks,

Steve

If the top  chekcbox in the column within <apex:facet> tags in checked , I would want to check the checkbox in that column.

So its something like check All functionality. Anything with an example would be really helpful.

 

Heres the code for that column in the pageBlockTable

 

 

<apex:column id="colChk">
	<apex:facet name="header">
		<apex:inputCheckbox id="chkTopCheckBox" onclick="selectCheckboxes();"/>
	</apex:facet>
	<apex:inputCheckBox id="chkbox" value="{!row.selected}"/>
</apex:column>

 

 

  • May 19, 2010
  • Like
  • 0

Hi all

I practice a sample ,write a apex class testing about a apex trigger.

but if I want write more apex class tesing about the same trigger, could I choose some of them to run test instead of running all of them?

I notice apex class testing have a status "Active" ,so I think whether I can use status to choose some of apex class to test?

thank you. wait for your answer ...?

Hi all

i got some issues i am listing out here.please respond as early as possible.

if we search a company it displays 100 records with same company name located in different places.can we sort the records by certain criteria like sort by stateor sort by city .

please reply very urgent

  • May 18, 2010
  • Like
  • 0

Hai all,

 

Can anyone suggest me the way of storing the body content of the HTTP response.

 

Plesae help me with this,its urgent....

 

Can any body tell me the way to retrieve the content displayed in a HTML response.

The response page displays something like this:  STATUS: 920

If I  can get that number(here,920) and if I can store it in a string, my task will be completed.

 

Please, help me.

I'm playing with some Ideas development in a dev environment and from what the docs say I need the extended Ideas controllers enabled. How do I go about getting that done?

Do we have a limit of one thousand records that can be processed per DML statement? I believe, that was to do with the earler collection limit of one thousand records. Since, there is no limit on number of records in the collection, do we still have a limit on the number of records processed per DML statement. Please advice.

After editing my apex class from within the Force.com IDE, i clicked "Save" button. Got an error "File saved locally, not to server". How can i get past this errror? Thanks!

I imported some WSDL to get stubs and wrote a class that successfully class them when testing interactively.

 

I'm now writing Apex tests and my first test that calls Apex methods that will eventually get into methods that do callouts is failing with an exception. 

 

Are the any specific techniques that are needed to get Apex test methods to run when callouts are invoked?

 

 

Hi everyone,

 

IAm very much interested in doing salesforce certification of Force.com Developer Certification,but facing much difficulty in getting dump for the force .com developer cwertification for preparation of isomeone provide me with dump material for salesforce developer certification it will be very helpful for me to prepare for the exam..

 

 

So someone help me

 

                                                                                                                                                     Thanks and regards,

                                                                                                                                                                 Anu...

I've been bouncing around the forums and searching online, which I thought would be easy. How do you create a new record on the Account object inside of a trigger?

 

I want the new Account to have a name, record type, owner id, and that's it.

  • May 10, 2010
  • Like
  • 0

i have been trying to get datepicker to work with my visualforce page. I set it up but i can not get the calendar to pop up. 

Here is my code:

 

 

<apex:page controller="testController">
<link type="text/css" href="{!URLFOR($Resource.css)}" rel="stylesheet" />
<script type="text/javascript" src="{!URLFOR($Resource.Jquery)}"></script>
<script type="text/javascript" src="{!URLFOR($Resource.core)}"></script>
<script type="text/javascript" src="{!URLFOR($Resource.Datepicker)}"></script>
 
<input id="datepicker" type="textbox" />
<script type="text/javascript">
    $(function() {
        $(“#datepicker”).datepicker();
    });
    </script>
 
<apex:form >
 <apex:inputText value="{!inputValue}" id="datepicker"/><br/>
 <apex:commandButton action="{!testAction}" value="testButton"/>
 </apex:form>
</apex:page>

 

 

Thanks for any help you can give.

Hi Everyone,

 

I'm working on a solution to export records that meet do not have a date in a customer field called Extract_Date__c.  I have a controller and a VF page that displays the records and a button on the VF page that exports the data in a .csv format.  Once the records have been exported, I need to update the Extract_Date__c field with the date the records were extracted. 

 

I have a method written that updates the field, but not sure how to update the records once they are extracted.  I was thinking a trigger, but am not sure.  Any thoughts?

 

Thanks for your assistance!

 

JoAnn

  • May 10, 2010
  • Like
  • 0

Hi,

 

I have an ideas site, and in the idea detail page (when a particular idea is choosen the user is navigated to this page), i have a java script to generate url for that particular idea so that user could email the link with a click of a button. Our internal org has requested for url's for all the ideas submitted so far and future ideas with respective to their title in reports. Do i need to write a trigger (& where do i save url's?). i can use a specific portion of static url hardcoded  http://xxxxxxxxxxxxxxxx/ideaView?"id=1235487584784" (only id is dynamic here, rest can be hardcoded). can anyone tell me a better way to do this?

 

Thanks.

 

 

  • May 07, 2010
  • Like
  • 0

Hai everyone,

 

 

 

 

 

 

 

Can anyone suggest me a method to navigate to a visualforce page onclick of a custom button in force.com.

I am using a javascript function to navigate but the page opens in a new window.But I want it to be opened in the same window.

 

Thanks in advance.

 

Hi community,

 

I need to connect to an URL from Salesforce, I mean, from a VF page. The URL returns an XML and I need to process it.

 

The URL is http://www.ctt.pt/pdcp/xml_pdcp?incodpos=1000234

 

where incodpos parameter is a Portuguese postal code.

 

I don't know the best way to proceed. Can anyone help me out with this, please?

 

Thanks in advance.

 

Regards.