• kennedyman
  • NEWBIE
  • 85 Points
  • Member since 2011

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 22
    Replies

Hi Community,

 

From dupeBlocker i receive an id with size of       x=18.

But i need only 15 letters  from x like y=15

and use it in a soql query

 

example

values = Select id , name from Account  where Account.Id =: ( y);

 

for this purpose i wrote code as follows . But no result.

 

Integer i;
            List<String> s = new List<string>();
            CRMfusionDBR101__Potential_Duplicate__c[] crmDupeIds = [select CRMfusionDBR101__Account__c from CRMfusionDBR101__Potential_Duplicate__c];
            System.debug('****************DupeValue  11---'+crmDupeIds);
            if(crmDupeIds.size() > 0 && showdups == false ){
            for(i = 0; i <> crmDupeIds.size(); i++){
            s = string.valueof(crmDupeIds[i].CRMfusionDBR101__Account__c);
            s.substring(1,15);

 

Any body can help me in this regard. i also provide the trimmed debuglog

ANY)
13:34:08.888 (1888986000)|USER_DEBUG|[148]|DEBUG|****************DupeValue  11---(CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A4iIAE, Id=a0iW00000004mnoIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W000000569unIAA, Id=a0iW00000004mnKIAQ}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000055o5YIAQ, Id=a0iW00000004mdjIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000055oPWIAY, Id=a0iW00000004mdkIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A73IAE, Id=a0iW00000004mo3IAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A6jIAE, Id=a0iW00000004mnyIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W000000569xwIAA, Id=a0iW00000004mnUIAQ}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000055oQ2IAI, Id=a0iW00000004mdoIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056HsGIAU, Id=a0iW00000004mx3IAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A6gIAE, Id=a0iW00000004mrCIAQ}, ...)
13:34:08.889 (1889011000)|SYSTEM_METHOD_EXIT|[148]|System.debug(ANY)
13:34:08.889 (1889071000)|SYSTEM_METHOD_ENTRY|[149]|LIST.size()
13:34:08.889 (1889103000)|SYSTEM_METHOD_EXIT|[149]|LIST.size()
13:34:08.889 (1889128000)|METHOD_ENTRY|[149]|01p50000000DMvl|NewCustomerControllerExt.__sfdc_showDups()
13:34:08.889 (1889151000)|METHOD_EXIT|[149]|01p50000000DMvl|NewCustomerControllerExt.__sfdc_showDups()
13:34:08.889 (1889168000)|SYSTEM_METHOD_ENTRY|[150]|LIST.size()
13:34:08.889 (1889186000)|SYSTEM_METHOD_EXIT|[150]|LIST.size()
13:34:08.889 (1889240000)|SYSTEM_METHOD_ENTRY|[151]|String.valueOf(Object)
13:34:08.889 (1889260000)|SYSTEM_METHOD_EXIT|[151]|String.valueOf(Object)
13:34:08.889 (1889287000)|SYSTEM_METHOD_ENTRY|[154]|System.debug(ANY)
13:34:08.889 (1889300000)|USER_DEBUG|[154]|DEBUG|****************DupeValue 21---001W00000056A4iIAE
13:34:08.889 (1889306000)|SYSTEM_METHOD_EXIT|[154]|System.debug(ANY)
13:34:08.889 (1889329000)|SYSTEM_METHOD_ENTRY|[155]|String.valueOf(Object)
13:34:08.889 (1889345000)|SYSTEM_METHOD_EXIT|[155]|String.valueOf(Object)
13:34:08.889 (1889355000)|SYSTEM_METHOD_ENTRY|[155]|System.debug(ANY)
13:34:08.889 (1889360000)|USER_DEBUG|[155]|DEBUG|****************DupeValue 22---001W00000056A4iIAE

I need to display a single summary value on my VF page. Given the following apex code, how do I display "Total"?

 

I'm new to apex and VF so maybe I have the wrong approach altogether.

 

private String myVar;

myVar = 'something';

 

private List<AggregateResult> summary;

public List<AggregateResult> getSummary;

 

summary = [select sum(Total__c) Total from MyTable__c where Foo__c = :myVar];

 

VF:

<td>{!Summary.Total}</td>

 

When I save my work I get this error: Unknown property 'VisualforceArrayList.Total'

 

  • May 10, 2012
  • Like
  • 0

i have a need to Update more that 5000 records at a time, so i am storing the records in a List and updating but there is a limit that list cannot store more that 1000 rows.

 

Can any one help me with a code snippet to ccomplish this task 

 

Currently i am doing like this 

 

selectedjobs is a list of type jobwrapper

 

for(JobWrapper on : GetWrapperData())
{
if(cCon.isSelected == true)
{
selectedJobs .add(cCon.jb);
}
}

 

saving the changes

 

for(Job eq:selectedJobs)
{
Job eqsObject=new Job (Id=eq.id);
eqsObject.No=code;
lstEqRec.add(eqsObject);
}

 

updating 

if(!lstEqRec.isEmpty())
{
update lstEqRec;
}

 

Hello, 

 

I have implemented a simple REST API and oauth java app that connects to my company's salesforce instance. 

 

My code forwards the user here for authorization: 

Redirect URL: https://test.salesforce.com/services/oauth2/authorize?response_type=code&client_id=<client_id>&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fsfdcrest%2Fconnect.html&display=touch

 

And this works beautifully, however, there is one major flaw that i cannot figure out.

 

This authentication form does not authenticate customer portal users. Now the portal users I want to hook up to this already have API enabled, and should have access.

 

Does anyone know how to work this so that Customer Portal users are able to authenticate through my oauth REST application?

Everyone,

 

I'm running into a very annoying issue with the latest version of the eclipse Force.com IDE plugin.

 

When I'm writing test classes, I'm right-clicking on the test class and selecting "force.com -> run tests." However, in the "code coverage results" window it no longer displays any code coverage information for my class.

 

When I run the same test in the browser, i can see my 16% code coverage, but my custom class isn't showing up in the eclipse test runner results.

 

Is anyone else seeing this issue, does anyone know how to fix it?

Hi Community,

 

From dupeBlocker i receive an id with size of       x=18.

But i need only 15 letters  from x like y=15

and use it in a soql query

 

example

values = Select id , name from Account  where Account.Id =: ( y);

 

for this purpose i wrote code as follows . But no result.

 

Integer i;
            List<String> s = new List<string>();
            CRMfusionDBR101__Potential_Duplicate__c[] crmDupeIds = [select CRMfusionDBR101__Account__c from CRMfusionDBR101__Potential_Duplicate__c];
            System.debug('****************DupeValue  11---'+crmDupeIds);
            if(crmDupeIds.size() > 0 && showdups == false ){
            for(i = 0; i <> crmDupeIds.size(); i++){
            s = string.valueof(crmDupeIds[i].CRMfusionDBR101__Account__c);
            s.substring(1,15);

 

Any body can help me in this regard. i also provide the trimmed debuglog

ANY)
13:34:08.888 (1888986000)|USER_DEBUG|[148]|DEBUG|****************DupeValue  11---(CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A4iIAE, Id=a0iW00000004mnoIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W000000569unIAA, Id=a0iW00000004mnKIAQ}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000055o5YIAQ, Id=a0iW00000004mdjIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000055oPWIAY, Id=a0iW00000004mdkIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A73IAE, Id=a0iW00000004mo3IAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A6jIAE, Id=a0iW00000004mnyIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W000000569xwIAA, Id=a0iW00000004mnUIAQ}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000055oQ2IAI, Id=a0iW00000004mdoIAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056HsGIAU, Id=a0iW00000004mx3IAA}, CRMfusionDBR101__Potential_Duplicate__c:{CRMfusionDBR101__Account__c=001W00000056A6gIAE, Id=a0iW00000004mrCIAQ}, ...)
13:34:08.889 (1889011000)|SYSTEM_METHOD_EXIT|[148]|System.debug(ANY)
13:34:08.889 (1889071000)|SYSTEM_METHOD_ENTRY|[149]|LIST.size()
13:34:08.889 (1889103000)|SYSTEM_METHOD_EXIT|[149]|LIST.size()
13:34:08.889 (1889128000)|METHOD_ENTRY|[149]|01p50000000DMvl|NewCustomerControllerExt.__sfdc_showDups()
13:34:08.889 (1889151000)|METHOD_EXIT|[149]|01p50000000DMvl|NewCustomerControllerExt.__sfdc_showDups()
13:34:08.889 (1889168000)|SYSTEM_METHOD_ENTRY|[150]|LIST.size()
13:34:08.889 (1889186000)|SYSTEM_METHOD_EXIT|[150]|LIST.size()
13:34:08.889 (1889240000)|SYSTEM_METHOD_ENTRY|[151]|String.valueOf(Object)
13:34:08.889 (1889260000)|SYSTEM_METHOD_EXIT|[151]|String.valueOf(Object)
13:34:08.889 (1889287000)|SYSTEM_METHOD_ENTRY|[154]|System.debug(ANY)
13:34:08.889 (1889300000)|USER_DEBUG|[154]|DEBUG|****************DupeValue 21---001W00000056A4iIAE
13:34:08.889 (1889306000)|SYSTEM_METHOD_EXIT|[154]|System.debug(ANY)
13:34:08.889 (1889329000)|SYSTEM_METHOD_ENTRY|[155]|String.valueOf(Object)
13:34:08.889 (1889345000)|SYSTEM_METHOD_EXIT|[155]|String.valueOf(Object)
13:34:08.889 (1889355000)|SYSTEM_METHOD_ENTRY|[155]|System.debug(ANY)
13:34:08.889 (1889360000)|USER_DEBUG|[155]|DEBUG|****************DupeValue 22---001W00000056A4iIAE

I need to display a single summary value on my VF page. Given the following apex code, how do I display "Total"?

 

I'm new to apex and VF so maybe I have the wrong approach altogether.

 

private String myVar;

myVar = 'something';

 

private List<AggregateResult> summary;

public List<AggregateResult> getSummary;

 

summary = [select sum(Total__c) Total from MyTable__c where Foo__c = :myVar];

 

VF:

<td>{!Summary.Total}</td>

 

When I save my work I get this error: Unknown property 'VisualforceArrayList.Total'

 

  • May 10, 2012
  • Like
  • 0

Hi all,


I've been going round in circles with this for a while now, and could really use a definitive answer if anyone can help.


We use Professional Edition with Workflow and API 'bolted on'.

As a service company we send our customers quotes for installations, repairs, maintenance plans etc.  Each quote we send is logged as an opportunity againt the relevant account.


In our company a case is a job.  Currently when an opportunity is won, we change the opportunity status to 'closed won' and then have to manually open a case for the job that the customer has just accepted.
From time to time staff here update the opp status to 'closed won', but then forget to open a case for the job.  We end up accepting the customer's order, but then not creating a job to fulfil it.


I'd therefore like a case to be automatically created when an opp status is changed to 'closed won'.

 

It seems that this can be achieved with an Apex trigger, but neither our SF Account Executive or Tech Support can tell me whether this is possible with Professional Edition with Workflow and API 'bolted on'.  


Can anyone clarify how we get an Apex trigger into our Org?

Thanks in advance.


Steve

Hi all,

 

We are currently using Google Doc (Form) to collect user information which we then convert to CSV to upload into salesforce as "Contacts". However, this is quite repetitive and we have to do it many times a day. We are looking for a solution to:

(1) Automate the above process - when customer use the online google doc form, it goes automatically into salesforce contact

OR

(2) A form app that integrates with Salesforce's Contact featuer.

 

Many thanks.

I'm fairly new to apex and I have this grand idea to dynamically move custom object records from one queue to another based on the record contact time zone.

 

My initial thought was to build an apex class for each scenario (i.e. at 5am only East Coast items are in the queue, 6am Eastern and Central etc.) and then use either cronKit or apex scheduler to run the classes.

Is this a good approach? Has anyone ever tried something like this?

i have a need to Update more that 5000 records at a time, so i am storing the records in a List and updating but there is a limit that list cannot store more that 1000 rows.

 

Can any one help me with a code snippet to ccomplish this task 

 

Currently i am doing like this 

 

selectedjobs is a list of type jobwrapper

 

for(JobWrapper on : GetWrapperData())
{
if(cCon.isSelected == true)
{
selectedJobs .add(cCon.jb);
}
}

 

saving the changes

 

for(Job eq:selectedJobs)
{
Job eqsObject=new Job (Id=eq.id);
eqsObject.No=code;
lstEqRec.add(eqsObject);
}

 

updating 

if(!lstEqRec.isEmpty())
{
update lstEqRec;
}

 

Hi guys,

 

Does anyone have a sample code to automatically add all NEW users to a specific Public Group?

 

Thank you!:)

Hello, 

 

I have implemented a simple REST API and oauth java app that connects to my company's salesforce instance. 

 

My code forwards the user here for authorization: 

Redirect URL: https://test.salesforce.com/services/oauth2/authorize?response_type=code&client_id=<client_id>&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fsfdcrest%2Fconnect.html&display=touch

 

And this works beautifully, however, there is one major flaw that i cannot figure out.

 

This authentication form does not authenticate customer portal users. Now the portal users I want to hook up to this already have API enabled, and should have access.

 

Does anyone know how to work this so that Customer Portal users are able to authenticate through my oauth REST application?

Hi, I am doing OAuth in this simple HTML page:

 

<%@page import="static rest.RESTApp.*"%>
<html>
    <body onLoad="document.authorizationForm.submit()">
    <form action="<%=currentREST.getAuthURL()%>" method="post" name="authorizationForm">    
      <input type="hidden" name="response_type" value="code"/>    
      <input type="hidden" name="client_id" value="<%=currentREST.getClient_id()%>"/>
      <input type="hidden" name="redirect_url" value="<%=currentREST.getRedirect_url()%>"/>
    </form>
    </body>
</html>

 

I am getting an error "error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration" from salesforce server.

However, I checked several times the redirectURL and I am sure it is the same as in the REMOTE ACCESS configuration.

 

Can anyone tell me what am I doing wrong?

 

I'm wondering if anyone can tell me why I can't connect to http://localhost from Salesforce to a local rest interface. I've added "http://localhost" as a remote site but I still get an error when connectiong that says the connection failed. The localhost rest uri does work if I use Fiddler or via browser so why doesn't it work from Salesforce?

Everyone,

 

I'm running into a very annoying issue with the latest version of the eclipse Force.com IDE plugin.

 

When I'm writing test classes, I'm right-clicking on the test class and selecting "force.com -> run tests." However, in the "code coverage results" window it no longer displays any code coverage information for my class.

 

When I run the same test in the browser, i can see my 16% code coverage, but my custom class isn't showing up in the eclipse test runner results.

 

Is anyone else seeing this issue, does anyone know how to fix it?

Hi all,

 

I would like to populate an account custom field with "active contract” if at least one of the contracts related to this account is still active

 

I guess I can use a formula to look at the deadline of the contract and say "still active" or "ended" 

 

But then I should look at all the account contracts and if one of the contracts is "still active", have the account custom field populated with "active contract"

 

Any ideas?

Thank you!!!:)

 

  • November 03, 2011
  • Like
  • 0

Dear guys ,

I have an issue in eclipse When I run test to any test class I cant see the class in Apex Test Runner.

 

Please help me out its bery urgent...