• SFDC developer55
  • NEWBIE
  • 15 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 14
    Replies
In the below requeststring, I have to pass one value from the post form data.

For e.g: I have a user name text box and I need to pass that user name value on form submission in the below request string:

String abc = post data from form;

String requestString = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bns:EnvironmentExtensions xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="XXXXXXXXXXXXXXXX" extensionGroupId="" environmentId="XXXXXXXXXXXXXXX"> <bns:connections> <bns:connection name="SFDC connection" id="XXXX"> <bns:field componentOverride="false" usesEncryption="false" encryptedValueSet="false" value="email@gmail.com" id="user"/> <bns:field componentOverride="false" usesEncryption="true" encryptedValueSet="true" id="password" value="password"/> </bns:connection> </bns:connections> </bns:EnvironmentExtensions>';


What i Need?
To pass abc string value in the body.

String requestString = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bns:EnvironmentExtensions xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="XXXXXXXXXXXXXXXX" extensionGroupId="" environmentId="XXXXXXXXXXXXXXX"> <bns:connections> <bns:connection name="SFDC connection" id="XXXX"> <bns:field componentOverride="false" usesEncryption="false" encryptedValueSet="false" value= abc id="user"/> <bns:field componentOverride="false" usesEncryption="true" encryptedValueSet="true" id="password" value="password"/> </bns:connection> </bns:connections> </bns:EnvironmentExtensions>';


Above request string is the body that i am passing in the HTTPRequest.
i would appreciate your help!
I am trying to call one rest API using Httprequest (from salesforce using Apex code), but not able to figure how I can pass the body.  I would appreciate if anyone share the way to pass the below mentioned body in the HttpRequest.

here are the details:
End-point URL : https://api.boomi.com/api/rest/v1/AccountID/EnvironmentExtensions/XXXXXXXXXX

Body:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:EnvironmentExtensions xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="XXXXXXXXXXXXXXXX" extensionGroupId="" environmentId="XXXXXXXXXXXXXXX">
    <bns:connections>
        <bns:connection name="SFDC connection" id="XXXX">
            <bns:field componentOverride="false" usesEncryption="false" encryptedValueSet="false" value="email@gmail.com" id="user"/>
            <bns:field componentOverride="false" usesEncryption="true" encryptedValueSet="true" id="password" value="password"/>
        </bns:connection>
    </bns:connections>
</bns:EnvironmentExtensions>


Apex code to call Rest API:


      String endPointURL = 'https://api.boomi.com/api/rest/v1/AccountID/EnvironmentExtensions/XXXXXXXXXX';
      
      String userName = 'XXXXXX';
      String password = 'XXXXXXX';

      String body= '';
      String query;
      query = '';
      Blob headerValue = Blob.valueOf(userName + ':' + password);
      String authorizationHeader = 'BASIC ' +
      EncodingUtil.base64Encode(headerValue);
      accs1 = new List<cAccount>();
      Httprequest request = new HttpRequest();
      Http http = new Http();
      request.setMethod('POST');
      request.setEndpoint(endPointURL);
      request.setHeader('Content-Type', 'application/json');
      // Header info with remote server user name and password
      request.setHeader('Authorization', authorizationHeader);
      request.setBody(query); 
            
      request.setTimeout(120000); 
      request.setBody(query);          
      //Making call to external REST API
      HttpResponse response = http.send(request);  
      System.debug('responseBody: '+response.getBody());
Hi All,

Any idea how can I parse the below Rest API response using Apex code and how can I display this pageblock section.

<bns:QueryResult xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfResults="3">
<bns:result xsi:type="bns:Process" id="XXXXXX" name="AAA"/>
<bns:result xsi:type="bns:Process" id="XXXXXXXX" name="BBBB"/>
<bns:result xsi:type="bns:Process" id="XXXXXX" name="CCC"/>
</bns:QueryResult>

Regards,
PR
Hi All,

Did anyone implement QR code scanner in Salesforce project?

What I need? If user scans the attached QR code, it should return the result after decode.

For e.g. If you scan the attached image (QR code) then it should return “ER-0000130”.

We are able to get the results from online demo’s, here is one example:http://dwa012.github.io/html5-qrcode/

However, after implementing code in SFDC, I am getting one or more errors. 

Please let me know if anyone implemented any QR code scanner in their project, with the instruction to implement.

Thank you.
Regards,
Paddy 
On click of command button (from Inline visual force page), I need to open different window for partners or append partners in a URL, when button is clicked from partners community otherwise the regular URL.

Command button is like this:

<apex:commandButton id="btn" value="Add product" onclick="window.open('/{!IF(boolPartner,$Label.AddOpptyProductPartnerURL,$Label.AddOpptyProductURL)}={!opportunity.name}&retURL=%2Fa0a%2Fo','_blank','height=400,location=no,resizable=yes,to


Any idea how we can do this on click..

I have tried to write a code on controller but that method was not called:


public Controller(ApexPages.StandardController cont) {

    String hostVal  = ApexPages.currentPage().getHeaders().get('Host');
    String urlVal = Apexpages.currentPage().getUrl();
    String URLL = 'https://' + hostVal+ urlVal;
    Boolean result=URLL.contains('partners');
    system.debug(URLL+'==URLL=='+result);
    return result;
  }
I have custom field on Oppty object - by the name "Sales Owner" - (It is User Vlookup).
I want to give edit access to the Sales owner. Is this can be done with the criteria based Sharing rules? I did not find any solution using configuration?
Do you have any suggestion on this? else i will need to write code..
I would appreciate if you please share the code to do this..
Object A

field A
________

A
A
B

I need to compare field value before update record..

for e.g: If current and last field value is same then do something else other stuff

if(old == new)
else
{
}
can we use this using apex code without writting trigger..

List<myObject__C> obj = [Select A from myObject]

for (myObject abc: obj)
//here I need to compare the value of previous and current record...
like if(old == new value)

can you please help me on this?

Hierarchical structure of Folders, and grant access accordingly...
"Files" and "Document" option did not work for me. Can we get similar functionality what we have in Box or Sharepoint where we can do PMO stuff using Salesforce.
I need to get the value of Locale from user object using javascript.  Could you please help me on this?   Locale image from User Object 

Regards,
Paddy

I have trigger on Account (before insert), it is working fine when I create an account manually but when i tried to test while inserting bulk records using dataloader it did not work..

Here is the code:

trigger  Name on Account (before insert)
{
    for(Account a : Trigger.new)
    {
        if(a.FieldName =='abc')
        {
            a.FieldName__c = 'Value';
        }
  }
}

And is there any way I can make this to work on bulk inserts...

Thank you for the help in advance.

Regards,
Paddy

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

I have a custom button in communities and on click of that this javascript method file get called..

 

And below code is not working.. it is giving undefined//

alert ("{!$User.CustomField__c}")

 

However, it is working fine for the standard field..For e.d below code is working fine .. I am able to see the Id but same thing is not working for the Custom field.

alert ("{!$User.Id}")

 

 

Thank you for the help in advance.

 

Regards,

Paddy

I am trying to call one rest API using Httprequest (from salesforce using Apex code), but not able to figure how I can pass the body.  I would appreciate if anyone share the way to pass the below mentioned body in the HttpRequest.

here are the details:
End-point URL : https://api.boomi.com/api/rest/v1/AccountID/EnvironmentExtensions/XXXXXXXXXX

Body:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:EnvironmentExtensions xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="XXXXXXXXXXXXXXXX" extensionGroupId="" environmentId="XXXXXXXXXXXXXXX">
    <bns:connections>
        <bns:connection name="SFDC connection" id="XXXX">
            <bns:field componentOverride="false" usesEncryption="false" encryptedValueSet="false" value="email@gmail.com" id="user"/>
            <bns:field componentOverride="false" usesEncryption="true" encryptedValueSet="true" id="password" value="password"/>
        </bns:connection>
    </bns:connections>
</bns:EnvironmentExtensions>


Apex code to call Rest API:


      String endPointURL = 'https://api.boomi.com/api/rest/v1/AccountID/EnvironmentExtensions/XXXXXXXXXX';
      
      String userName = 'XXXXXX';
      String password = 'XXXXXXX';

      String body= '';
      String query;
      query = '';
      Blob headerValue = Blob.valueOf(userName + ':' + password);
      String authorizationHeader = 'BASIC ' +
      EncodingUtil.base64Encode(headerValue);
      accs1 = new List<cAccount>();
      Httprequest request = new HttpRequest();
      Http http = new Http();
      request.setMethod('POST');
      request.setEndpoint(endPointURL);
      request.setHeader('Content-Type', 'application/json');
      // Header info with remote server user name and password
      request.setHeader('Authorization', authorizationHeader);
      request.setBody(query); 
            
      request.setTimeout(120000); 
      request.setBody(query);          
      //Making call to external REST API
      HttpResponse response = http.send(request);  
      System.debug('responseBody: '+response.getBody());
Hi All,

Any idea how can I parse the below Rest API response using Apex code and how can I display this pageblock section.

<bns:QueryResult xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfResults="3">
<bns:result xsi:type="bns:Process" id="XXXXXX" name="AAA"/>
<bns:result xsi:type="bns:Process" id="XXXXXXXX" name="BBBB"/>
<bns:result xsi:type="bns:Process" id="XXXXXX" name="CCC"/>
</bns:QueryResult>

Regards,
PR
Hi All,

Did anyone implement QR code scanner in Salesforce project?

What I need? If user scans the attached QR code, it should return the result after decode.

For e.g. If you scan the attached image (QR code) then it should return “ER-0000130”.

We are able to get the results from online demo’s, here is one example:http://dwa012.github.io/html5-qrcode/

However, after implementing code in SFDC, I am getting one or more errors. 

Please let me know if anyone implemented any QR code scanner in their project, with the instruction to implement.

Thank you.
Regards,
Paddy 
I need to get the value of Locale from user object using javascript.  Could you please help me on this?   Locale image from User Object 

Regards,
Paddy

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

I have a custom button in communities and on click of that this javascript method file get called..

 

And below code is not working.. it is giving undefined//

alert ("{!$User.CustomField__c}")

 

However, it is working fine for the standard field..For e.d below code is working fine .. I am able to see the Id but same thing is not working for the Custom field.

alert ("{!$User.Id}")

 

 

Thank you for the help in advance.

 

Regards,

Paddy

Hi Guys,

 

We have a custom button on a detail page which is used for custom clone and should be acccessible only for user that are assigned with a specific permission set. When I try to achieve this using

var permissionsetid = sforce.connection.query("select id,label from PermissionSet where Label = " + "\'" + "permissionset name" + "\'");

 

The system throwing 

 

A problem with the OnClick JavaScript for this button or link was encountered:

{faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'PermissionSet' is not supported.', detail:{InvalidSObjectFault:{exceptionCode:'INVALID_TYPE', exceptionMessage:'sObject type 'PermissionSet' is not supported.', row:'-1', column:'-1', }, }, }

 

Can anyone let me know that can we achieve this through script, I already thought of a workaround to redirect user to a page from where I can query permissionsets and validate the logged in user.

 

--yvk

 

  • April 26, 2013
  • Like
  • 0

Hi All,

 

I have a use case in which user with different locale can access the VF page.

On this VF page I have some number calculation using JavaScript this number field are directly bind with SF object fields.

So whenever user with different locale access this page the bind number field display format is changed and result in improper calculation.

 

For example, a number that we would write in the US as "1,250,500.75" would be written differently in different countries: "1.250.500,75" in Germany, "1 250 500,75" in France, and "1'250'500.75" in Switzerland, and "125,0500.75" in Japan.

 

Any thoughts or workaround would be appreciated

 

Thanks in advance.

 

 

 

 

I am trying a simple Account GET operation on Boomi from Salesforce through REST API. The following is the code in Salesforce which is executed by button click.

public pageReference AccountGet()
{
String username = <Boomi username>;
        String password = <Boomi password>;
Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'BASIC ' +  EncodingUtil.base64Encode(headerValue);
HttpRequest req = new HttpRequest();
        req.setEndPoint('https://platform.boomi.com/api/rest/v1/<Boomi Account Id>/Account/<Boomi Account Name>');
        req.setMethod('GET');
        req.setHeader('Authorization', authorizationHeader);
     
        Http http = new Http();
HttpResponse res = http.send(req);
        
        AccCreateBody = res.getBody();
        AccCreateStatus = res.getStatus();
        AccCreateStatCode = res.getStatuscode();
return null;
}

Execution of the above code results in '500 Internal Server Error'. Any pointers on how to proceed will be greatly helpful.
Thanks!
  • April 10, 2012
  • Like
  • 0

Hello, I have a data table I've created on a Visual Force page. This table lists out all my records I've created for a custom Sales object. I was asked to gather the total amount cummulated for each record and display it on the top row (not counting the Header Values). I have come up with the total amount, but I am having trouble getting it to display the way I want.  

 

Here's an example of the layout I need.  I want the Total amount to display directly underneath the header row.

Total   Employee   Amount

$350    Mike            $50

           Steve           $100

           Perry           $150

           Johnson      $50

 

However, here is what I am getting using the following code:

 <apex:column headerValue="Total" width="50">
        <apex:facet name="header"><apex:outputPanel >
        <apex:outputText value="${!Total['sum']}" /></apex:outputPanel></apex:facet>
</apex:column>

 This code takes my header value "Total" and replaces it with the numeric total, so I am seeing:

 

$350    Employee   Amount

            Mike            $50

            Steve          $100

            Perry           $150

           Johnson       $50

 

I also decided to create my Headers using standard <TH> tags, rather than the <column headerValue="">, and then setup my dataTable without column headers.  However, this resulted in the following layout:

 

Total   Employee   Amount

$350

           Mike              $50     

           Steve            $100

           Perry            $150

           Johnson       $50

 

While the total amount is directly underneath the "Total" header, the other records have jumped down a line. Is there a way to get this total amount to display in my first layout?

 

Thanks!

Mike

Hi,
 
From past few days, i am facing a problem when i click the custom button.
It shows a javascript error "sforce not defined".
Prior to winter'09 release, this issue was not there.
 
Is anyone else facing this issue.
 
Any help on this will be highly appreciated.
 
Thanks,
OnDemand