-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
11Questions
-
14Replies
Pass post form value in a string
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!
-
- SFDC developer55
- May 31, 2016
- Like
- 0
- Continue reading or reply
Httprequest using Apex code
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());
-
- SFDC developer55
- May 20, 2016
- Like
- 0
- Continue reading or reply
Parse Rest API response
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
-
- SFDC developer55
- April 20, 2016
- Like
- 0
- Continue reading or reply
QR code scanner for salesforce
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
-
- SFDC developer55
- June 18, 2015
- Like
- 0
- Continue reading or reply
onclick javascript from visual force
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;
}
-
- SFDC developer55
- July 01, 2014
- Like
- 0
- Continue reading or reply
sharing rules settings
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..
-
- SFDC developer55
- June 24, 2014
- Like
- 0
- Continue reading or reply
compare old field value with the next field value
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?
-
- SFDC developer55
- May 28, 2014
- Like
- 0
- Continue reading or reply
How to share files and create folders using Salesforce
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.
-
- SFDC developer55
- February 18, 2014
- Like
- 0
- Continue reading or reply
locale value from user object
Regards,
Paddy
-
- SFDC developer55
- January 27, 2014
- Like
- 0
- Continue reading or reply
Trigger not working on dataloader insert
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
-
- SFDC developer55
- October 24, 2013
- Like
- 0
- Continue reading or reply
Custom Button Onclick issue using Javascript
{!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
-
- SFDC developer55
- October 17, 2013
- Like
- 0
- Continue reading or reply
Httprequest using Apex code
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());
- SFDC developer55
- May 20, 2016
- Like
- 0
- Continue reading or reply
Parse Rest API response
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
- SFDC developer55
- April 20, 2016
- Like
- 0
- Continue reading or reply
QR code scanner for salesforce
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
- SFDC developer55
- June 18, 2015
- Like
- 0
- Continue reading or reply
locale value from user object
Regards,
Paddy
- SFDC developer55
- January 27, 2014
- Like
- 0
- Continue reading or reply
Custom Button Onclick issue using Javascript
{!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
- SFDC developer55
- October 17, 2013
- Like
- 0
- Continue reading or reply
sObject type 'PermissionSet' is not supported
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
- yvk431
- April 26, 2013
- Like
- 0
- Continue reading or reply
JavaScript calculation based on locale
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.
- Flight Plan
- November 09, 2012
- Like
- 0
- Continue reading or reply
Help - Boomi REST API call
- vsf
- April 10, 2012
- Like
- 0
- Continue reading or reply
Need Help Displaying a Total Amount on the 1st Row in My Data Table
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
- Michael3.Brown
- May 18, 2011
- Like
- 0
- Continue reading or reply
"Sforce not defined" javascript error alert when Custom button is clicked.
- OnDem Dev
- October 23, 2008
- Like
- 0
- Continue reading or reply