• Randy Rose
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 0
    Replies
We've have created plenty of REST Apex classes and access them using OAuth 2.0 using Web Server Flow (cosumer secret, consumer key, etc.)

However, we're in the process of creating our first REST Apex class that a 3rd party partner will have access to.

Since our current APEX REST classes are used by our own client applications  (hosted on our servers), we feel they're secured.

My question is what is considered best practice to allow a 3rd party partner to use a new APEX REST class?  This class will return back one opportunity record (JSON)

My thinking is to continue to use OAuth 2.0 and do the followng
1. Create new Connected App
2. Set connected app to read only 
3. Add IP Restriction
4. Provide partner consumer secret/key

Is this sufficient or is their a better secured way?
We plan on having a 3rd party vendor doing some production deployments for us.  However, we don't want to provide username/password to our production enviroment at this time.

We're thinking we could have them use Force.com Migration Tool and provide an access token (oauth).  I'm assuming we would create a connected app/access token for this?  If so wouldn't the access token expire fairly quickly which would mean we would have to constantly create access tokens.  Or is there another access token I would create for this so it doesn't expire?

Or is there another option instead of using access token or another approach?  Bascially, we would like this team deploy to prodcution (visualforce pages, apex classess, etc.) but don't want to provide them username/password at this time.

Thanks
We have a force domain name and have many sites in use
xyz.force.com
xyz.force.com/survey
xyz.force.com/subsribe


Since the domain shows up on the Live Agent chat client, we don't want to use xyz.force.com and instead want it to be abc.force.com.  Is there a way to have  Live Agent use abc.force.com without affecting all the other sites that are currently using xyz.force.com? 

If not, we're open to using an alias; e.g. abc.force.com/liveagent would show up in Live Chat window but not sure how this can be accomplished.

Thanks



 
I'm interating through an sObject and Opportunity Id exists in the sObject.

I want to move some Opportunities to a collection and a custom field (e.g. campaign) and then when done iterating through the sObject do a bulk update for the Opportunity.

What type of collection should this be and how do I define the field in the collection (these opportunites already exits)?

Example

Lets call sObject campaigns
<list><map> Opps;
for (Campaigns  campaign:coCampaigns :) {
     Opps (collection?) = campaign.get('campaign__Opportunity__c')
     Opps.campaign (collection?) = campaign.get('campaign__c')
}

update Opps (collection);

 
Due to hitting CPU Limit, I need to update my batch job.  I thought this would be simple but can't figure how to move an Object and assoicated field (total amount) to a collection; meaning I have access to the Object ID (Opportunit) from another Object (Payment) but don't know how to move this to a collection

Background

The job does the following
  1. Retrive all payment records (status = 'completed'); approx. 20,000 payment records!
  2. Batch Job (processes 100 payments per job <List>Payments)
(a) Create List of Opportunity (status = 'closed won')
(b) iterates through payment records
(c)  for each payment record find matching opportunity (2,500 opporunities; this technically loops 250,000 times - 100 payments X 2,500 opportunites)
(d) add payment amount to Opportunity.payment_amt
(e) when payment loop is complete 'update Opporunity' (list from (a) )

Its seems obvious that the loop is causing the CPU Limit (although, this error is random). What I've decided to do is modify the Payment collection List and order by Opportunity id -> Opp_id, payment_amt, pament_date.

So instead of trying to find matching Opportunity (on Opporunity object), I can just total the amount until the Opportunity ID is differnet from the next record in the payment List.
  1. Retrive all payment records and order by Opporunity Id (this is on Payment object0
  2. Batch Job (processes 100 payments per job <List>Payments)
(a) iterates through payment records (List)
(b) add payment amount to Opportunity.payment_amt
(c) when Opportunity changes, add total amount to a List
(e) when loop is complete 'update Opporunity'

So now I have Opportunities what their totaly amounts. 

How do I add these amounts to a list (or map) so I can do a 'bulk' update?
 
We plan on having a 3rd party vendor doing some production deployments for us.  However, we don't want to provide username/password to our production enviroment at this time.

We're thinking we could have them use Force.com Migration Tool and provide an access token (oauth).  I'm assuming we would create a connected app/access token for this?  If so wouldn't the access token expire fairly quickly which would mean we would have to constantly create access tokens.  Or is there another access token I would create for this so it doesn't expire?

Or is there another option instead of using access token or another approach?  Bascially, we would like this team deploy to prodcution (visualforce pages, apex classess, etc.) but don't want to provide them username/password at this time.

Thanks