• ryanjupton
  • NEWBIE
  • 493 Points
  • Member since 2013
  • Developer Evangelist
  • Salesforce.com


  • Chatter
    Feed
  • 14
    Best Answers
  • 19
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 160
    Replies

OK...I have my classes and trigger working in my sandbox; how do I get them created in my prod org? I do not have an Add button in Prod like I did in the sandbox.

I am currently in process of invoking Salesforce REST API from my own server.

Following are the two options I have already implemented,

  • Use OAuth 2.0 User-agent model for querying Salesforce REST API
  • User OAuth 2.0 User-password model for querying Salesforce REST API.

In both the above case, I needed to setup Remote Site in the Salesforce Org. How can I bypass this. i.e. Without setting up Remote Site, I can directly query Salesforce API. I have seen a popular app integrated with salesforce already done similar thing.

 

Also, after reviewing salesforce Authentication documentation, token used in Oauth 2.0 is same as Session Id. i.e. In theory if I have instance URL and SessionId , I can directly query API.

Thanks for your help.

Greetings,

 

I am attempting to display an image on a visualforce page if account.dq_reason__c == 'Out of Business'

 

The image displays but the problem is it ALWAYS displays.  I only need it to display when the dq_reason is "Out of Business".  Seems like a simple task but I don't know what I am doing wrong.  Any help is greatly appreciated.  Thanks in advance.

 

****************************************************VisualForce Page*************************************************************

 

<apex:page standardController="Account" showHeader="true"  >

<img src="{!$Resource.Black_Box}" width="600" height="60" rendered ="{!account.DQ_Reason__c =='Out of Business'}" />


<apex:detail relatedList="false" title="true"/>


<apex:relatedList subject="{!account}" list="contacts" />


<apex:relatedList subject="{!account}"
list="opportunities" />


<apex:relatedList subject="{!account}"
list="OpenActivities" />


<apex:relatedList subject="{!account}"
list="NotesAndAttachments" />


</apex:page>

I'm fairly new to Apex code and was wondering if someone could help review a trigger for me.

 

Background: We have On-Demand Email-To-Case enabled and will be routing a lot of emails to different addresses in SalesForce

 

What I need is to have the email address that the email was sent to populated on the Case. This will be used for filtering list views in the service console. I couldn't figure out how to get this field on the Case since it resides on the EmailMessage object, so I wrote a Case Email Trigger.

 

I basically just want to know if what I did here is best practice. Any advice would greatly be appreciated.

 

trigger UpdateToField on EmailMessage (after insert) {
    
    List<Case> cases = new List<Case>();
    
    for(EmailMessage em: Trigger.new){
        Case cs = [select SentToAddress__c from Case where Id =: em.ParentId];
        cs.SentToAddress__c = em.ToAddress;
        cases.add(cs);
    }
    update cases;
    
}

 

  • June 28, 2013
  • Like
  • 0
We are building a Connected App that connects to Salesforce.com only via the APIs (using oAuth).
 
I would just like to verify the below architecutre would work. (Our goal is to save work for child users by having the company admin globally authenticate the Salesforce connection)
 
  • Our app (separate from Salesforce) has a company-level account. (Single admin who can add multiple child-users)
  • Admin connets their Salesforce.com org (via oAuth).
  • Associated child users do not have to authenticate – they share the admin's Salesforce API connection.
  • Child-account actions in our external app get updated in Salesfoce.
I am new to the Salesforce app world, but am hoping someone knows the answer to this simple question offhand. If anyone could confirm, that would be much appreciated. Thanks!

Hallo,

 

I am starting develop in salesforce, i want to do the following exercise, I hope somebody can tell me, how should I start?

 

For example, there are two similar Contacts (Contact_1, Contact_2) with different addresses,

 

They should be displayed in one page: Contact_1 displays on the left side of the page, Contact_2 displays on the right side of the page. After click save button, Contact_1 take the address from Contact_2. or after click Cancel button, the Contact_2 should be deleted.

 

Could somebody tell me, how and where can i find a similar sample code. Or how should I start with this exercise? Should I define a visualforce page to slove?

 

thanks! 

Best regards,

Leo

Controller:

public class A
{
public string  s{get;set;};
	public A()
	{
		A= //some how i would like to store the value of s(java script varicble in this variable)
	}

}


VF page:

<apex:page controller="A">
	<script>
		var s;
		s='Value to be passed to apex class';
	</script>
</apex:page>

 http://boards.developerforce.com/t5/Visualforce-Development/How-to-store-javascript-variable-value-in-VFpage-controller/m-p/347637#M41881

 

given approach is not working for me.

plz suggest.

 

can we call one batch with other? if yes how?

what is the difference between controller and apex class?

I want to replace the Home tab with our Leaderboard tab for all my user in a single profile. I know this is visualforce, and I just want to get the best step-by-step guide on building this. I found this simular post, will these direction accomplish resetting the home tab to the leaderboard tab?

 

"

Super Contributor
 
Posts: 932
 
0
 
Re: Default Landing Tab [ New ]

Create a VF page called "New Checklist Record" which has nothing in it but a redirect to the Edit for that object.  One line should do the job.

 

<apex:page action="{!urlfor($Action.Checklist__c.New)}"/>      

 

Then set up a VisualForce Tab Setup -> create -> tabs and scroll down.  for that one line VF page.

 

Then use that as the default Landing Tab for the default App.

 

Best, Steve.

 

p.s. Note that this isn't foolproof.  If people want to get around it they can easily just specify a different starting page for their login for example:"

 

Thanks!!!

 

 

 

Update - I created an app, pulled everything over there and then made my leaderboard the landing tab. :) thanks for the help. 

HI,

I am trying to write an soql query on Case object. I am looking for contact email. How do i query for it?

 

I tried the below query and it gave an error.

 

 

Select Contact.id.Email from Case where Id=: c.id;

 

Any help is appreciated.

 

*c.id is case Id.

 

 

Thanks,

Mike

Hi,

I am a new ISV, in pre-development stages.

 

When I spoke with the SF execs, they told me (or so I understood) that as a Developer Partner I will be able to download the SF platform, as if I were a user.

The reason I need the platform is because before I develop the App, i need to well understand the working environment in which it will work.

Pls advise if I can download the SF platform and how?

Thank you for your help!

Daniel

Hi All,

 

 

Please help me...

 

For one of my apex class i need to fill out some mandatory fields with dummy data. Actually i want to get the field data type in apex class to fill dummy data. How i can do this.

  • May 05, 2013
  • Like
  • 0

hi

 

I have an appplication which was developed in java ,

 

i want to maintain my database in salesforce is it possible?

 

if yes how ?please let me know ...

 

if it is possible to store my data in another clouds plz suggest one..

 

if yes how ?please let me know ...

 

 Thanks & Regsrda

sunny

 

 

As many of you have discovered, our developer community is awesome. The wealth of knowledge here is phenomenal. This is an all volunteer community and people who take the time to help and post answers do so totally on their own initiative. With that said when someone provides the right answer to your question please take the time to mark their answer as the accepted solution. Also give them a kudos if they've really gone the extra mile to help out. Show some love ;)

As many of you have discovered, our developer community is awesome. The wealth of knowledge here is phenomenal. This is an all volunteer community and people who take the time to help and post answers do so totally on their own initiative. With that said when someone provides the right answer to your question please take the time to mark their answer as the accepted solution. Also give them a kudos if they've really gone the extra mile to help out. Show some love ;)

Hi Everyone,

I have created a Apex class that I would like to schedule to run. However when I try to schedule the class it does not run. 
I have run my test class to see if there is antying wrong but it seems to run fine with the test class. I don't understand what the issue is.
Currently in our salesforce org we have a thrid party product that runs a apex class every hour. Could that be causing an issue with my class? Is it possible the two classes can't run at the same time?

Let me know if there is anything else you need from me.

Thanks,

Pretty new to Salesforce & while I know this is a pretty abstract question, I'm hoping to get pointed in the right direction:  is there anywhere where people share their data, or we can download some sample data to populate with?  A tutorial that anyone might recommend to start with, to populate some data myself?  

OK...I have my classes and trigger working in my sandbox; how do I get them created in my prod org? I do not have an Add button in Prod like I did in the sandbox.

I have this:

PageReference retPage = new PageReference('/' + changeID + '/e?00Na000000BA4Ip=Rejected&00Na000000BA4IU=True&00Na000000BA4IW=UserInfo.getName()&00Na000000BA4IV=');

 This needs to equal the current date and time.  How do I accomplish that?

00Na000000BA4IV=
  • August 30, 2013
  • Like
  • 0

Hi,

 

Is there any difference in:  between System.trigger.new and Trigger.new

 

-Kaity.

  • August 30, 2013
  • Like
  • 0

Hi, 

 

I want to display value of open oportunities on a dashboard. I want to display weekly values of open opportunities.

But thes values keep changing in salesforce as open opportunities could be lost or won. So, the weekly values chnages. I have these weekly values in excel. 

 

How can I show these values in a dashborad.

 

Thanks,

Alok

  • August 30, 2013
  • Like
  • 0

I know I am missing something simple here, but I getting a:

 

Apex script unhandled trigger exception by user/organization: 0055000000118E4/00D50000000784t

Update_NCOA_Address_v01: System.LimitException: Too many DML rows: 10001

 

Error Message.

 

1.  Can someone spot my error?

2.  Is there a way to put into the code or error message which record(s) triggered the error?

 

trigger Update_NCOA_Address_v01 on printsf__Collateral_Send_History__c(after insert, after update) {
    // Update the appropriate SD_Member__c record with NCOA address from PrintSF
    List<SD_Member__c > recordsToUpdate = new List<SD_Member__c >();
    For(printsf__Collateral_Send_History__c CSH: Trigger.new) {
        // Get the SD Member Id from the recipient id field 
        //String strSDId = CSH.printsf__Recipient_ID__c;

// Check to see if it is an SD Member Entry        
If(CSH.printsf__Recipient_ID__c!=null){   
     
        If(CSH.printsf__NCOA_Result__c == 'None') {
            SD_Member__c SD = New SD_Member__c(id = CSH.printsf__Recipient_ID__c,
                NCOA_Address__c = CSH.printsf__Street__c,
                NCOA_City__c = CSH.printsf__city__c,
                NCOA_State__c = CSH.printsf__State__c,
                NCOA_Zip__c = CSH.printsf__Zip_Code__c,
                NCOA_Error_Code__c = CSH.printsf__NCOA_Result__c,
                NCOA_Error_Description__c = CSH.printsf__NCOA_Result_Description__c);
            recordsToUpdate.add(SD);
        }

        If(CSH.printsf__NCOA_Result__c == 'Fowarded') {
            SD_Member__c SD = New SD_Member__c(id = CSH.printsf__Recipient_ID__c,
                NCOA_Address__c = CSH.printsf__Street__c,
                NCOA_City__c = CSH.printsf__city__c,
                NCOA_State__c = CSH.printsf__State__c,
                NCOA_Zip__c = CSH.printsf__Zip_Code__c);
            recordsToUpdate.add(SD);
        }

        If(CSH.printsf__NCOA_Result__c == 'Failed') {
            SD_Member__c SD = New SD_Member__c(id = CSH.printsf__Recipient_ID__c,
                NCOA_Address__c = CSH.printsf__Street__c,
                NCOA_City__c = CSH.printsf__city__c,
                NCOA_State__c = CSH.printsf__State__c,
                NCOA_Zip__c = CSH.printsf__Zip_Code__c,
                Address_Bad__c = True);

            recordsToUpdate.add(SD);
        }

    
  
  update recordsToUpdate;
}

}}

 Thanks for the help.

I'm leaving my company and wanted to update who gets these emails.  Does anyone know how to update this?  The other users are not developers so I don't think I could have them 'edit' the existing code so they're the last modified by...

I create 2 objects ,

one is "A" this is master object 

second is "B" this is detail object

              problem is standardcontroller="A" (master) , in visualforce i have to read the "B" (detail)  field  ?

                    

                   is it possible ? if possible how? ,not possible how do this ?

I am currently in process of invoking Salesforce REST API from my own server.

Following are the two options I have already implemented,

  • Use OAuth 2.0 User-agent model for querying Salesforce REST API
  • User OAuth 2.0 User-password model for querying Salesforce REST API.

In both the above case, I needed to setup Remote Site in the Salesforce Org. How can I bypass this. i.e. Without setting up Remote Site, I can directly query Salesforce API. I have seen a popular app integrated with salesforce already done similar thing.

 

Also, after reviewing salesforce Authentication documentation, token used in Oauth 2.0 is same as Session Id. i.e. In theory if I have instance URL and SessionId , I can directly query API.

Thanks for your help.

select id from account where name='123' or name='345' or name='456';

 

or

 

select id from account where name IN ('123','345','456');

 

Which one you all think is optimized more. Or both are same??

Hi all, my company has created a cloud flow embedded in a visualforce page that we use to capture employee clock in and clock outs. The flow is working great with the exception of employees having to use the mouse to manually click on the Next Button to pass between flow pages. This can take more time than we would like as for some projects he have to clock in perhaps 70 people within 10 minute time spans.

 

To solve this I would like to use the enter key to press the Next button. How can this be done?

 

I'm assuming this is simple javascript code placed in the visualforce page alongside the embedded flow, but to start with I have no idea how to locate the ID of the "Next" button.

 

Any help would be much appreciated!

 

Thank you.

 

 

 

Developed post install script -- no problem.

However, when I try to add a test script (see below), I get "Method does not exist or incorrect signature: System.Test.testInstall". The testInstall method does not show up in the list of methods available for the Test class in Eclipse IDE, and editing/saving the test class directly in the Salesforce UI results in the same error.

Please advise.

 

@isTest
static void testInstallScript() {
PostInstallClass postinstall = new PostInstallClass();
System.Test.testInstall(postinstall, null);
System.Test.testInstall(postinstall, new Version(1,0), true);
List<Account> a = [Select id, name from Account where name ='Newco'];
System.assertEquals(a.size(), 1, 'Account not found');
}

My Problem is as follows:

 

5 values on the multi-select picklist in the Account field "Use Cases"

 

Cloud Migration

Cloud Disaster Recovery

Cloud DevTest-DevOps

Cloud Bursting

Other

 

I want to map the values from this account field to the same titled field on the opportunity page.

 

I have played around with the "IF()" function and "INCLUDES()" function, but it does not seem to be working.

 

I have several errors that keep coming up, and although this might seem like a simple formula I think, I really just need to know how to make this work? Thank you anyone for your help!

I have a managed package and that I can access successfully (through api) from my host  'host1.com' but when I try to access it from my development host 'host2.com' I get the error message:

 

Call to token URL https://login.salesforce.com/services/oauth2/token failed with status 400, response {"error":"invalid_grant","error_description":"expired access/refresh token"

 

I believe my access and refresh tokens are correct as I have copied them over from the working host 'host1.com'.  Can I only access a package from one host?  or am I doing something else wrong?  I have remote access set up for both hosts so that they each have their own consumer key and consumer secret.  

Hi Team,

 

we had a requirement on the Approval Process.

 

We we click on the custom button on Account Detail Page, we are adding logged in user to Account Team of that Account with some role "X". Then we need to write the approval process such that, when ever we added looged in user to Account Team member for account, i want to send an approval to account owner. Once he/she approved it, i want to change the role to "Y".

 

Please suggent an solution fir above functionality.

 

Thanks in Advance,

Anil 

Hi All

 

I wish to enable INTELLISENSE feature in my VF Input Textbox, so that as soon as i start entering something, it shows a dropdown of items listing the most viable choices.

 

Kindly help!!!

 

Thanx in Advance

Shiv