• Mentee
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 12
    Replies
Name- aws_WScallout
url - https://servicename.amazonaws.com
Identity Type - Named Principal
Authentication Protocol - AWS Signature Version 4
AWS Access Key ID - ******
AWS Secret Access Key - ********
AWS Region - us-east-1
AWS Server- executea
Generate Authorization Header - true 
 
String token ='abcdefghijkl'; (say)
 HttpRequest req = new HttpRequest();
 req.setEndpoint('callout:aws_WScallout/alpha/plan/5?Source=Ops&localen=NA');
 req.setMethod('GET');
 Http http = new Http();
 HTTPResponse res = http.send(req);
 while (res.getStatusCode() == 302) {
           res.setEndpoint(res.getHeader('Location'));
           res = new Http().send(req);
       }
 System.debug(res.getBody());

I have to add x-amz-access-token which I get programmatically from another webservice. without adding error I am getting.
DEBUG|{"message": "Missing required request parameters: [x-amz-access-token]"}
how should I add to this callout?
I tired doing this 
  • req.setHeader('x-amz-access-token', token); 
  • req.setHeader('Authorization', EncodingUtil.base64Encode( Blob.valueof('x-amz-access-token'+ token)));
  • req.setHeader('x-amz-access-token', EncodingUtil.base64Encode(Blob.valueof(token)));

I get this error
DEBUG|{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method..."}
  • December 06, 2019
  • Like
  • 0
I displaying data in a table using <apex: repeat> and  Lightning Design System in a visualforce page. And using data tables.js I am paging the data. pagination numbers, instead of appearing on bottom right , horizontally. is displays vertically. Any inputs?
pagination issue with Datatables.js
  • November 21, 2018
  • Like
  • 0
I have a page that iterates a list object to display the records. Once clicked on save, I updated the same list with new values and debug logs shows the update list but output panel is not rerender'ed and I dont see updated list on VF page.
 
<apex:outputLabel >A  </apex:outputLabel>
        <apex:inputfield id="idAText" value="{!ttlookup.A}" />
      <apex:inputCheckbox id="checkBoxTMId" value="{!Acheckbox}"/>
      <apex:outputLabel > Check if you want to clear all values 
</apex:outputLabel>

    <apex:commandButton id="btnSave" value=" Save " action="{!Save}" reRender="idPanel" />

 <apex:outputPanel ID = "idPanel">
        <div class="container">   
            <table>
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th> 
                        </tr>
                    </thead>
                    <tbody>
                        <apex:repeat value="{!ryList}" var="tt">
                                <tr>
                                    <td>{!tt.name}</td>
                                    <td>{!tt.Type__c}</td>
                                </tr>
                        </apex:repeat>
                    </tbody>
            </table>

Controller Method :
 
public void save(){
    Boolean noUpdateFlag = false;
    for(MyObjec ttry: ryList){
        if(ttlookup.A !=null){
            noUpdateFlag = true;
            ttry.name = ttlookup.A;
        }

        if(Acheckbox){
            noUpdateFlag = true;
            ttry.name = null;
        }

    }
    system.debug(ryList[0].B + ' noUpdateFlag '+noUpdateFlag);
    try{
        if(noUpdateFlag){
            update ryList;
            ApexPages.addmessage(new Apexpages.message(apexpages.severity.CONFIRM, 'records are saved.'));
        }
        else
            ApexPages.addmessage(new Apexpages.message(apexpages.severity.Info, 'no value entered '));
    }catch(Exception ex){
        System.debug(ex);
        ApexPages.addmessage(new Apexpages.message(apexpages.severity.Error, 'Something went wrong'));
    }

}

and moreover when I add reRender = "idPanel" my apex messages are not displayed. I have no clue why :( any inputs please?
  • October 22, 2018
  • Like
  • 0
String query = 'FIND \'*' + searchString + '*\' IN ALL FIELDS RETURNING Ticket__C (Region__r.name, Manager__c, Manager__r.name, Name, Notes__c), user(id,Name)'; 
 I am searching with user name and results are zero.
 Aim: when a string is entered, it should match with any of the fields of ticket and display the results. with the above query, it will match only with Ticket.name and shows zero results when i am searching for the user.name.  any inputs please
  • October 16, 2018
  • Like
  • 0
I am trying to show a popup when picklist is selected but I am unable to do
I tired this https://developer.salesforce.com/forums/?id=906F0000000DDKiIAO
dint work :(

        <apex:outputPanel">
          <apex:outputLabel>Pick one</apex:outputLabel><br/>
          <apex:selectList id="picklst" value="{!selectedValue}" size="1" required="TRUE" multiselect="FALSE">
              <apex:selectOptions value="{!Lst}"/>
              <apex:actionSupport event="onchange" action="{!func}"/>
          </apex:selectList>
        </apex:outputPanel>

I mean it works but doesn't execute <apex:actionSupport event="onchange" action="{!func}"/> as this render the VF components to display form page. I want to display a popup when someone change to value1 to value2. saying data will be lost. Any ideas
Name- aws_WScallout
url - https://servicename.amazonaws.com
Identity Type - Named Principal
Authentication Protocol - AWS Signature Version 4
AWS Access Key ID - ******
AWS Secret Access Key - ********
AWS Region - us-east-1
AWS Server- executea
Generate Authorization Header - true 
 
String token ='abcdefghijkl'; (say)
 HttpRequest req = new HttpRequest();
 req.setEndpoint('callout:aws_WScallout/alpha/plan/5?Source=Ops&localen=NA');
 req.setMethod('GET');
 Http http = new Http();
 HTTPResponse res = http.send(req);
 while (res.getStatusCode() == 302) {
           res.setEndpoint(res.getHeader('Location'));
           res = new Http().send(req);
       }
 System.debug(res.getBody());

I have to add x-amz-access-token which I get programmatically from another webservice. without adding error I am getting.
DEBUG|{"message": "Missing required request parameters: [x-amz-access-token]"}
how should I add to this callout?
I tired doing this 
  • req.setHeader('x-amz-access-token', token); 
  • req.setHeader('Authorization', EncodingUtil.base64Encode( Blob.valueof('x-amz-access-token'+ token)));
  • req.setHeader('x-amz-access-token', EncodingUtil.base64Encode(Blob.valueof(token)));

I get this error
DEBUG|{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method..."}
  • December 06, 2019
  • Like
  • 0
I displaying data in a table using <apex: repeat> and  Lightning Design System in a visualforce page. And using data tables.js I am paging the data. pagination numbers, instead of appearing on bottom right , horizontally. is displays vertically. Any inputs?
pagination issue with Datatables.js
  • November 21, 2018
  • Like
  • 0
I have a page that iterates a list object to display the records. Once clicked on save, I updated the same list with new values and debug logs shows the update list but output panel is not rerender'ed and I dont see updated list on VF page.
 
<apex:outputLabel >A  </apex:outputLabel>
        <apex:inputfield id="idAText" value="{!ttlookup.A}" />
      <apex:inputCheckbox id="checkBoxTMId" value="{!Acheckbox}"/>
      <apex:outputLabel > Check if you want to clear all values 
</apex:outputLabel>

    <apex:commandButton id="btnSave" value=" Save " action="{!Save}" reRender="idPanel" />

 <apex:outputPanel ID = "idPanel">
        <div class="container">   
            <table>
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th> 
                        </tr>
                    </thead>
                    <tbody>
                        <apex:repeat value="{!ryList}" var="tt">
                                <tr>
                                    <td>{!tt.name}</td>
                                    <td>{!tt.Type__c}</td>
                                </tr>
                        </apex:repeat>
                    </tbody>
            </table>

Controller Method :
 
public void save(){
    Boolean noUpdateFlag = false;
    for(MyObjec ttry: ryList){
        if(ttlookup.A !=null){
            noUpdateFlag = true;
            ttry.name = ttlookup.A;
        }

        if(Acheckbox){
            noUpdateFlag = true;
            ttry.name = null;
        }

    }
    system.debug(ryList[0].B + ' noUpdateFlag '+noUpdateFlag);
    try{
        if(noUpdateFlag){
            update ryList;
            ApexPages.addmessage(new Apexpages.message(apexpages.severity.CONFIRM, 'records are saved.'));
        }
        else
            ApexPages.addmessage(new Apexpages.message(apexpages.severity.Info, 'no value entered '));
    }catch(Exception ex){
        System.debug(ex);
        ApexPages.addmessage(new Apexpages.message(apexpages.severity.Error, 'Something went wrong'));
    }

}

and moreover when I add reRender = "idPanel" my apex messages are not displayed. I have no clue why :( any inputs please?
  • October 22, 2018
  • Like
  • 0
I have gotten all the way to Create a Trigger, and I get:

Couldn’t find the record named 'Nina Simone' with Email 'nsimone@test.com'. Please double check the instructions.

When I try to create the candidate, I get:

CreateContact: execution of AfterInsert caused by: System.QueryException: List has more than 1 row for assignment to SObject Class.CreateContactFromCan.createContact: line 5, column 1 Trigger.CreateContact: line 5, column 1   

 
String query = 'FIND \'*' + searchString + '*\' IN ALL FIELDS RETURNING Ticket__C (Region__r.name, Manager__c, Manager__r.name, Name, Notes__c), user(id,Name)'; 
 I am searching with user name and results are zero.
 Aim: when a string is entered, it should match with any of the fields of ticket and display the results. with the above query, it will match only with Ticket.name and shows zero results when i am searching for the user.name.  any inputs please
  • October 16, 2018
  • Like
  • 0
Hello everyone. 
I am in need of some help creating a S-Control.  I am the Admin for my company but do not have much programming experience.  I am trying to create a process in the opportunity tab that will create a new record in in a related custom object when the user saves a new opportunity.  The new record on the custom (related) object will contain data from 3 fields in the opportunity.  I was told that an S-Control can achieve this.  If anyone can lead me in the right direction, it would be greatly appreciated. 

Thank you in advance,
sfmoose