• TonyScott
  • NEWBIE
  • 10 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
I've successfully gone through the process for Web Server OAuth Authentication Flow outlined below to aquire an access and request token:

https://developer.salesforce.com/docs/atlas.en-us.200.0.api_rest.meta/api_rest/intro_understanding_web_server_oauth_flow.htm

However I'm having difficulty adding in the optional additional security measure of adding a code_challenge and code_verifier in the requests.

I have tried...
$random = openssl_random_pseudo_bytes(128);
$verifier = base64_encode($random);
$challenge = base64_encode(hash('sha256', $verifier));
Or maybe don't encode the verifier before applying the hash
$random = openssl_random_pseudo_bytes(128);
$verifier = base64_encode($random);
$challenge = base64_encode(hash('sha256', $random));
Or maybe they want 128 chars instead of bytes
$random = bin2hex(openssl_random_pseudo_bytes(64));
Or maybe the encoding needs to be url safe:
function base64url_encode($data) {
  return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}

No luck so far. Has anyone manged to do the sucecssfuly in PHP or otherwise, or could spot a glaring mistake I'm making, who could offer some advice? 


 
I want to show the lookup field in lightning page. plaese any one knows reply to this post.
using this below component to create fields in lightning page. please any one knows modify the partner group and account filed as lookup. please find the below code modify it.
<aura:component implements="force:appHostable">
    
    <ltng:require styles="/resource/bootstrap"/>
    <aura:attribute name="Recipient" type="Recipient__c[]"/>
        <aura:attribute name="newARecipient" type="Recipient__c"
             default="{ 'sobjectType': 'Recipient__c',
                         'Name': '',
                         'Account__c': '',
                           'Actor_Type__c':'',
                           'Partner_Group__c':'',
                           'Request__c':''
                       }"/>

   <div class="bootstrap-sf1" >
    <div class="container">
        <div class="row" >
            
                <div class="col-sm-6">
                    <label class="col-sm-4" >Recipient Name</label>
                    <span class="col-sm-8">
         
                    
                
                    <ui:inputText aura:id="recipientName" 
                                  class="form-control" 
                                  value="{!v.newARecipient.Name}"
                                  placeholder="Recipient Name"/>
</span>
</div>
            </div>
<div class="row" >
           
                <div class="col-sm-6">
                    <label class="col-sm-4" >Request</label>
                    <span class="col-sm-8">
         
                    <!-- If you registered a namespace, the attribute values must include your namespace -->
                    <!-- For example, value="{!v.newExpense.myNamespace__Amount__c}" -->
                    <ui:inputText aura:id="request" 
                                    class="form-control"
                                    value="{!v.newARecipient.Request__c}"
                                    placeholder="Request" />
        
                    </span>
                </div>
    </div>
        <div class="row" >
           
                <div class="col-sm-6">
                    <label class="col-sm-4" >Actor Type</label>
                    <span class="col-sm-8">
                    <ui:inputSelect aura:id="actortype" >
                        <aura:iteration items="{!v.Recipient__c}" var="recipient">
                            <ui:inputSelectOption text="{!recipient.Id}" label="{!recipient.Actor_Type__c}" />
                        
                        </aura:iteration>
                        <ui:inputSelectOption text="select Actor"/>
                        <ui:inputSelectOption text="Requestor"/>
                        <ui:inputSelectOption text="Responder"/>
                    </ui:inputSelect>
                    </span>
                </div>
            </div>
            <div class="row" >
            
                <div class="col-sm-6">
                    <label class="col-sm-4" >Partner Group</label>
                    <span class="col-sm-5">
                    
                    <ui:inputSelect aura:id="partnergroup"  change="{!c.onSelectChange}">
                        <aura:iteration items="{!v.Recipient__c}" var="recipient">
                            <ui:inputSelectOption text="{!recipient.Id}" label="{!recipient.Partner_Group__c}" />
                        </aura:iteration>
                        <ui:inputSelectOption text="Requestor"/>
                    </ui:inputSelect>
                    </span>
                </div>
                </div>
                <div class="row" >
            
                <div class="col-sm-6">
                    <label class="col-sm-4" >Account</label>
                    <span class="col-sm-8">    
                    <ui:inputSelect aura:id="account" change="{!c.onSelectChange}">
                        <aura:iteration items="{!v.Recipient__c}" var="recipient">
                            <ui:inputSelectOption text="{!recipient.Id}" label="{!recipient.Account__c}" />
                        
                        </aura:iteration>
                    <ui:inputSelectOption text="Requestor"/>
                    </ui:inputSelect>
                    </span>
                </div>
                    </div>
         <div class="row " >
        <div  style="text-align:center;font-weight:bold;color:Black;">
             <div class="col-sm-6">
       <span class="col-sm-1">
                    <ui:button label="Save" press="{!c.createRecord}" />
            </span>
            <span class="col-sm-1">
                    <ui:button label="cancel" press="{!c.cancel}"/>
            </span>     
            <span class="col-sm-1">
                <ui:button label="save and new" press="{!c.saveAndNew}"/>
            </span>
            </div>
            
             </div>
        </div>
       </div>
        
        </div>
</aura:component>

I'm writing a unit test on the opportunity and opportunity line item.  I am getting the error "No standard price is defined".

 

Here is my test method:

 

public static testMethod void test3() 
    { 
    	Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
    	insert pb;
    	Product2 prod = new Product2(Name = 'Anti-infectives 2007', Family = 'Best Practices', Practice__c = 'GP/BP', Service_Level__c = 'Partial Service', Product_Abbrev__c = 'CMR_Antiinfect', Sales_Unit__c = 'Each', Standard_Unit__c = 'Each', Product_Year__c = '07', Item_Type__c = 'Non-Inventory (Sales only)', IsActive = true);
    	insert prod;
    	PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
    	insert pbe;
    	Opportunity opp = new Opportunity(Name = 'Test Syndicated 2010', Type = 'Syndicated - New', StageName = 'Planning', CloseDate = system.today());
    	insert opp;
    	OpportunityLineItem oli = new OpportunityLineItem(opportunityId = opp.Id, pricebookentryId = pbe.Id, Quantity = 1, UnitPrice = 7500, Description = '2007 CMR #4 - Anti-Infectives');
    	insert oli;
		List<OpportunityLineItem> olis = [Select Id From OpportunityLineItem Where OpportunityId =: opp.Id];
		update olis[0];
    }

 

The error is thrown on the line where I try and insert the PricebookEntry record:

 

PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
    	insert pbe;

 

I'm not sure what I'm missing. 

 

Thanks for any help.

Regards.

 

Which trigger Event is fired when an Attendee Declines an Event, I want to catch the Decline event of an Event whenever an Attendee of the meeting declines it.

 

I have tried an After trigger as well as Before Trigger, BUT I am unable to track down the case when an Attendee decline smeeting and that meeting Do gets deleted from Events table for that attendee. ....

 

can anyone guide me here .. plz .. :(

  • January 23, 2009
  • Like
  • 0