• daniel_h
  • NEWBIE
  • 90 Points
  • Member since 2012
  • Developer


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

Hello All-

I'm trying to write a custom Rest API that a 3rd party vendor will use to update our org.   The problem I'm having is that the XML data being passed doesn't have a root element of "request" and unfortunately I cannot have the 3rd party requester change their request XML payload.

My question is, is there a way to change the name of the root element? 

If not, could anyone point me to another resource that I could use to accomplish this?

Thank you so much for any help you could provide

  • October 17, 2015
  • Like
  • 0
Hi Everyone,
          I am a newbie to Salesforce Integrations and I am reading a lot of stuff to get hang of how SOAP and REST integrations are done . I have few very basic questions related to patterns , if anyone can help me out with them , that would be great. Please find them given below:

Q1. For an inbound integration, we have 2 options (as per my knowledge). One is to create an apex class and expose it as a web service , so that it can be consumed by external entity (C# or Java platform). This code will be used in whatever DML operations  that are required . Second option is to ask the Java/C# side developers to write their own code and provide their code login access to salesforce by adding the application under remote side settings. How do we choose which approach to take? 

Q2. While making HTTP callouts to external systems , we usedifferent type of encoding like given below:

String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
String encodedPropAddress = EncodingUtil.urlEncode(Rec.a__c,'UTF-8');

How do we know which format is to be used when ? As in when to use base64 . Will it be provided to me as a salesforce developer by technicians of external systems (to which callouts are being made)?

I do know that these questions might sound to you as very basic ones , but I am bit confused . So I would really appriciate if someone can throw some light on them.

Thanks a lot for your help!!!

Regards
Shrey Tyagi

I've been working on the Box REST API in Apex. I have run into a problem where occasionally I get a response of 400 Bad Request. If I retry the call, it works, but this isn't a good solution as some of my callouts run in batch and I can't have more than one callout. I posted on the Box developer forum and they think it is a problem with Salesforce (http://forum.developers.box.net/box_developers/topics/salesforce_callout_getting_frequent_response_400_bad_request). Has anybody else run into a similar issue? Could it be a bug with Salesforce?

 

I'm playing around with my Spring '12 sandbox, trying out the UserRecordAccess object. First my scenario: I want to allow all users who can edit a contact record be able to delete the record, regardless of who owns it. I've created a custom button that executes my code using a web service. This all works fine in the UI, but my tests fail because when it tries to query the UserRecordAccess, no records are returned. I get a "System.QueryException: List has no rows for assignment to SObject"

 

I've also tried running the SOQL in the developer console and I get an internal Salesforce error, so I think something must be up.

 

Here's my code with test class:

 

global without sharing class ContactUtil {
    webService static String deleteContact(Id id) { 
        Contact c = new Contact(id = id);
        try {
            UserRecordAccess ura = [select RecordId, HasEditAccess from UserRecordAccess where UserId = :UserInfo.getUserId() and RecordId = :id];
            if (ura.HasEditAccess) 
                delete c;
            else 
                throw new deleteException('Error deleting');
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    
    @isTest
    static void testDeleteContact() {
        Contact c = new Contact(LastName = 'Test');
        insert c;
        User u = [select id from user where Profile.Name = 'PA Customer Sales and Support' and IsActive = true  limit 1];
        System.runAs(u) {
              deleteContact(c.Id);
        }
        
        //Make sure the contact was deleted
        Contact[] testContact = [select Id from Contact where Id = :c.Id];
        System.assert(testContact.isEmpty());
    }
    
    public class deleteException extends Exception {}
}

 

Hi All,
I am new to creating visual force page and I need help with creating a search button on visual force page.

This search button should return search results on two custom objects (say: Service and Service Component) when a custom field (say: Circuit Id which is of Data Type: Text) is typed and hit search button. Similar to the image attached here. But this search is the custom search within Salesforce and I want to create seperate one in visual force page just to search on two custom objects.

Can anyone give me a head start here please. Thanks !
Visual Force Page
  • November 04, 2015
  • Like
  • 0
Hi there, 

I developed a test project to sync my DB with salesforce Users table with REST API. For this test I just had 5 users. I want to know how many users I can read within one request?  what is the optimum number of records we can get per HTTP request in regular rest API? 
How can I realize that Bulk API is better feature for me to use (considering I just need to work with User table in SF)

Appreciate your help

P.S Most links in Bulk API page doesn't work: e.g Auick Start and Sample Code https://developer.salesforce.com/page/Bulk_API
Dear Folks,

I need to develop exactly below same VF page for opportunity, can you please help to suggest?

http://www.screencast.com/users/VadimEgorov/folders/Jing/media/e6812493-6113-4cb9-99af-198bf980cae8

Thanks,
Kumar

Hello All-

I'm trying to write a custom Rest API that a 3rd party vendor will use to update our org.   The problem I'm having is that the XML data being passed doesn't have a root element of "request" and unfortunately I cannot have the 3rd party requester change their request XML payload.

My question is, is there a way to change the name of the root element? 

If not, could anyone point me to another resource that I could use to accomplish this?

Thank you so much for any help you could provide

  • October 17, 2015
  • Like
  • 0
Good evening,

Beforehand I am grateful for any comment that will help find the solution.
I have an application built and created several TABS TABS and one of those is by default set to Default Landing Tab.
My application was asked to exhibit a Popup informing that are private content where there are two buttons:
1 - A button "Accept" accepts and continues the normal flow of the work process;
2 - A button "Refuse" the loggar user Salesforce;
My problem is this, I would call the TAB which was charged as Default Landing Tab, but have not found identifier for the TAB. I did not see how I can call the TAB screen right after you click the button.


Best regards
Ronaldo Vasconcelos
One of our forms is getting this error "Authorization Required - You must first login or register in order to access page......"
We have made no changes and this has been working fine for over a year.  Could you please advise how to resolve.  Thank you!
I am trying to deploy my first changeset from sandbox to production. I made few changes to visual force pages in my sandbox now I am trying to mock the deployment (to production) in Sandbox. when I validate it is giving my 100's of errors which are due to some packages that we use . Code does not have 75% coverage . How to handle this? Any help is appreciated
Greetings.

I'm looking to make a career change out of Mortgage Banking and have been told time and again that "coding" is the way to go.  So I started researching what sorts of coding I should be learning as a beginner-  Part of my research was to reach out to some of my contacts in Mortgage Banking to see what sorts of languages I should be learning if I want to get a developer job in the mortgage industry.  One contact suggested I complete these Salesforce Trailheads instead of learning HTML/CSS, etc.  So, I started the Trailheads, completing the Admin Beginner and Intermediate Trails fairly easily.  Next I started the Developer Beginner Trail and, of course, have been confronted with Apex, which I know nothing about.  A few additional searches later and I found out that I should learn Javascript before learning Apex.  I'm not sure how long Javascript would take to learn, but it seems like Apex is another several months on top of it.

The whole purpose of starting the Salesforce Trailhead was to learn a new skill in a reasonable amount of time so I can get out of my industry, hopefully within 6 months. Now I'm confronted with need to learn multiple new web languages and additional months of training for something that may not yield a new career anyways.

I'm wondering if anybody has completed all of the Trailheads as a beginner (no previous coding experience) and how long it took. If I have to learn multiple web languages before being able to complete the Trailheads, then I have to decide whether to cut my losses and try something else or what other languages I should try to learn and how.  I'm also wondering if anybody completing these trails is a noob like me or if Trailheads is geared towards people that are already Salesforce Admins/Developers and I've wasted a bunch of time on this.

Any input is greatly appreciated.
-----------------Controller----------------------
public class search_con 
{
 
  Public List<Contact> results{Get;set;}
  public String field_name{get;set {field_name=value;} }   
  public String keyword{get; set {keyword=value;}}
   
  public void search_now()
  {
     results=(List<Contact>)[FIND :keyword IN ALL FIELDS RETURNING CONTACT(NAME, ACCOUNT.NAME, Email, PHONE, FAX, Owner.Name, MobilePhone)][0];
     
  }
  
  public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('Name','Name'));
            options.add(new SelectOption('Email','Email'));
            options.add(new SelectOption('Phone','Phone'));            
            return options;
        } 
}

----------------------------VF------------------------------------
Input:<apex:inputText value="{!keyword}" />
  In:<apex:selectList multiselect="false" size="1" value="{!field_name}">                                                 
                      <apex:selectOptions value="{!items}"/>
                   </apex:selectList>
                   
  <apex:commandButton value="search" action="{!search_now}"/>
In above code I am able to do the search using input 'keyword' but how to use 'field_name' string so that i can find the input keyword in selected field only.i tried this
 
results=(List<Contact>)[FIND :keyword IN field_name FIELDS RETURNING CONTACT(NAME, ACCOUNT.NAME, Email, PHONE, FAX, Owner.Name, MobilePhone)][0];

but it is throwing error.

Thanks
 
I want to add a new checkbox item to my company's Visualforce Donation page, but cannot find the appropriate fieldname or fieldvalue for the custom field I created.  How do I get that information so that the box registers properly when clicked on?

I have some, but limited, html knowledge, so I believe knowing how to find that value of my custom field is all I need to make this work.

Thank you!
I have a VF page rendered as PDF, and I have always had one footer.  Now I want two different footers.

I'm not sure how to code that.

Here is the CSS that I have for one footer...
 
<style type="text/css" media="print">
	@page {  margin: .25in .25in 0in .25in;
			@top-left {content :element(header);}
			@bottom-left {content :element(footer);}
		    }						
	div.header {position: running(header); }
	div.footer {position: running(footer); }				
</style>

And my VF code is 
<div class="footer" >
    Footer text, etc.
</div>

But on my first page - I want NO footer, other pages - I wan the current footer, and on my last page - I need the margin to be 

margin: .25in .25in 1.25in .25in;

I've tried changing my CSS to be...
<style type="text/css" media="print">
	@page {  margin: .25in .25in 0in .25in;
			@top-left {content :element(header);}
			@bottom-left {content :element(footer);}
			}
	
					
	div.header {position: running(header); }
	div.footer {position: running(footer); }
	div.footerLarge {@page {margin: .25in .25in 1.25in .25in}}
</style>

And while I did get my larger footer on my last page - I ALSO got my previous (smaller) footer with it's content also. 

Any suggestions?  Thanks


 
Hi All,

We are looking to automate the creation of Opportunity Splits on each opportunity as we cannot trust Sales Reps to add the Opportunity Team and Opportunity Splits accurately. So we decided to automate these through a trigger.

1- We can add and remove the 3 members to the Opportunity Team no problem.
2- When attempting to add the 3 members with the following percentages to the Opportunity Splits: 80%, 10%, 10%, we get an error suggesting that the percentages don't add up to 100% .

FULL ERROR MESSAGE: "caused by: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Can't update splits: percentages don't add up to 100.00%.: []: Class.CreateOppoTeamMember.CreateOppoSlpits: line 187, column 1"

Any help to resolve this will be greatly appreciated

 
Hi,

currently working on a PoC compiling a pdf from a custom object record. Using a button to redirect to a vf page, rendering the record data as PDF. Still in the very beginingn just checking whether fields render appropriately on the vF page, however am facing an issue rendering a rich text field.

Code and error below:
<apex:page StandardController="DokumentenTemplate__c" showHeader="false" renderas="pdf">
This is a standard field on the object: <br/>
{!DokumentenTemplate__c.Name}
<br/>
<br/>
This is a simple custom text field: <br/>
<apex:outputText value="{!DokumentenTemplate__c.Signatur__c}" escape="false"/>  
<br/>
<br/> 
This is where the richt text area should be displayed: <br/>
<apex:outputText value="{!DokumentenTemplate__c.Fusszeile__c}" escape="false"/> 
</apex:page>

The error I'm getting is the following:
Error: Invalid field Fusszeile__c for SObject DokumentenTemplate__c

API Name of the Object: DokumentenTemplate__c
Name of the field: Fusszeile__c

Queried, but couldn't find a similar post on this. Any recommendation on how to display this would be appreciated.

Thanks,
Henrik 

I want  to screenshare to 2 users.

Like One user can share a screen and another user can see the same.
In AppExchange having some apps but all those are Managed, So those we can't see any code.
How can i start development for the functionality in salesforce.

I don't know actually from where to start development?
 
  • October 15, 2015
  • Like
  • 0