• Amritesh Singh
  • NEWBIE
  • 75 Points
  • Member since 2013


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

HI,

 

I am trying to fetch values from visual force page to controller. My requirement is  - 

 

1. I have 4 textbox in my vf page where i will enter 4 integer values.

2. Those values should be given to controller for doing average function and return back the result to 5th textbox in my vf page.

 

My VF page code - 

<apex:page controller="test1" id="pg">
<apex:form >
<apex:pageBlock id="frm">
<apex:pageBlockSection columns="1">
<apex:inputText label="Num1:" id="text1" />
<apex:inputText label="Num2:" id="text2"/>
<apex:inputText label="Num3:" id="text3"/>
<apex:inputText label="Num4:" id="text4"/>
<apex:commandButton value="Click" id="button" style="width:80px"/>
<apex:inputText label="Result:" id="result"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<script type='text/javascript'>
function getvalue()
{
var a = document.getElementById('{!$Component.pg.frm.text1}').value
var b = document.getElementById('{!$Component.pg.frm.text2}').value
var c = document.getElementById('{!$Component.pg.frm.text3}').value
var d = document.getElementById('{!$Component.pg.frm.text4}').value
var e = document.getElementById('{!$Component.pg.frm.result}').value
}
</script>

</apex:page>

 

 

My Controller code - 

public with sharing class test1
{
public integer text1{get;set;}
public integer text2{get;set;}
public integer text3{get;set;}
public integer text4{get;set;}

public decimal avg(integer tex1,integer tex2,integer tex3,integer tex4)
{

integer result;
result = ((text1+text1+text1+text1)/4);
return result;
}}

 

 

. Kindly provide me solution how to achieve this scneario.

 

Thanks in Advance

Sidhartha

Hi Folks,

 

I am getting this error Error IINVALID_SESSION_ID' exceptionMessage='Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key'  while calling Apex webservice class  from .net.This webservice  class ,i have deployed from sanbox to production.

 

Strange fact is , its working fine when i call same webservice classfrom Sanbox.

 

i ahve cheked my session setting and its fine no locks are there.i am using partner Wsdl of each instance in their respective call.

 

 

Thanks in Advance.

hello folks,

 

I am using service cloud console for case management .Now when i use Email template to reply for any email, and when i see that mail in my outlook, i cant reply to that address.means it is not showing to address when i click reply button in outllok but its working fine in Gmail.

 

Now when i reply from SFDC to outlook for cases without using template,and when i click reply button in outlook then i can see to address there.

 

Problem occurs  only when i m use email template.

 

Need help ASAP !!!

 

 

 

 

 

 

HI all,

 

I have to insert Account,contact and Opportunity records coming from .net server as a xml string.i have created a webservice method and getting that xml as string and then parsing the xml.

 

I am able to it,but before inserting i have to check if those account,contact n Opp. is existing in salesfore or not.If not,then insert.I have done every thing and also achieve my goal.

 

But my code is working for small set of data , that is coming from extenal server.Currently i am sending 30-30 information in  xml to sfdc and its working,but more than 30 records at a time causing prblm,giving

 

error System.LimitException: Too many SOQL queries: 101

bcs i m using SOQL for checking the existing Account,contact and Opportunity.

 

Error like

System.LimitException: Too many DML statements : 151

System.LimitException: Too many code statements: 200001

 

Also occuring for more than 30 as i m also inserting Account,contact and Opportunity if it is not existing,

 

If u know any other way to do this pls share the idea,cause i have to import large data at a time from external server.

 

Thanx in adv

Hi all

I have create the following Restfull  Http webservice in Apex

 

RestResource(urlMapping='/sfdcWebservice/*')

global class RESTCaseController {

@HttpPost 
global static String GetXml() 
{
try 
{
RestRequest req = RestContext.request;
RestResponse res = Restcontext.response;

blob Body = req.requestbody;
string str=body.toString(); 
}
catch(Exception E)
{
system.debug('ERROR :' +e.getMessage());
}

return null;
}
}

 

End Url :https://ap1.salesforce.com/services/apexrest/sfdcWebservice

 

But this url is not working.

 

I searched and found that some authentication is required.

 

what changes i have to make in the code and to my account 

so that external server will be able to post xml to my End url.

 

Pls help me

 

Hi all

I have create the following Restfull  Http webservice in Apex

 

RestResource(urlMapping='/sfdcWebservice/*')

global class RESTCaseController {

@HttpPost
global static String GetXml()
{
try
{
RestRequest req = RestContext.request;
RestResponse res = Restcontext.response;

blob Body = req.requestbody;
string str=body.toString();
}
catch(Exception E)
{
system.debug('ERROR :' +e.getMessage());
}

return null;
}
}

 

End Url :https://ap1.salesforce.com/services/apexrest/sfdcWebservice

 

But this url is not working.

 

I searched and found that some authentication is required.

 

what changes i have to make in the code and to my account 

so that external server will be able to post xml to my End url.

 

Pls help me

 

HI All,

 

 

I need to Create cookies for Standard/Custom Object. Is it possible??

 

Basically what i want,is to store an Opportunity name in cookie after the save and use that cookie to populate Opp. Name to some other Object before insert..

 

Thanx in Advance

 

hi,

 

I have to send a Email field value through query string.But that should be in encryped form and in external site( .Net ) server i have to decryprt that email addess.

 

 pls help me how to encrypt text field in saleforce and Decrypt in .net ,and how to find key and all mention above.

 

Thank in Advance

hello every1,

 

i need ur help,i m trying to call a external website to my vf page,not like pop window.

 

Pls help me,as i m very new to vf page n Apex.

 

 

I want to integrate CCAvenue (online payment gateway solution provider) with Salesforce CRM.
Please share some steps or sample code of integration.

Thansk!

Hi,

 

I am having a response in XML format.I am trying to get hold of particular fied value in my response XML and save in my field on salesforce object.

I am getting my body by response.getbody();

So I am trying to parse this XML file and get my ID value and fill my field..How can I do this??Any help??

 

 


<?XML version="1.0" encoding="UTF-8"?>
<case>
<id>00000000ABBl</id>
<subject>test</subject>
<Description>test</Description>
</case>

Hi Folks,

 

I am getting this error Error IINVALID_SESSION_ID' exceptionMessage='Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key'  while calling Apex webservice class  from .net.This webservice  class ,i have deployed from sanbox to production.

 

Strange fact is , its working fine when i call same webservice classfrom Sanbox.

 

i ahve cheked my session setting and its fine no locks are there.i am using partner Wsdl of each instance in their respective call.

 

 

Thanks in Advance.

Hi

I have made a website using the free domain of site.com and I have used the default SiteLogin functionality which redirects to my custom visualforce pages on successful login. I am facing the following issues:-

1. As soon as I login, I want my user session to start unless I logout. While I am in my session, I want my respective Customer Portal username to be available as a global variable which can be used across all Visualforce pages. Is this possible? Even if I am able to maintain session for a single user, even that will be enough for me according to my requirements. 

2. I have made multiple Customer Portal users through SiteRegister visualforce page, but no matter which user logs in, current user is the default user and administrator of the force.com account. 
Can you please provide me a code through which after a user logs in, his session is maintained across all visualforce pages till he logs out. While he is logged in, the current user is the user who is logged and not the user of force.com developer account.

 

3. Since my homepage of my site is login page, I don't want users to access my other custom visualforce pages unless they are logged in. The problem is, I am able to successfully log in but all my visualforce pages can be accessed by just appending the URL of my Site.com domain irrespective of the fact that a user is logged in or not. I want my site to check if a customer portal user is logged in before providing access to all the visualforce pages in my website.

 

4. I also have a small doubt. Why isn't the Logout link displayed if I open the page through Site.com and is visible if I open by https://c.ap1.visual.force.com/apex/ChangePassword? 

Pls. help!

  • July 26, 2013
  • Like
  • 0

Hi All,

 

Our company is moving to Win 7. I am verifying the salesforce compatibality in Win 7. Can you plese share your experience for Win 7.

 

 - Is there any issue while working on Win 7?

 - Any are on which I should focus more while verifying?

 - Does Run All Test behaves same in WIn XP and Win 7. 

 

Welcome to any comment suggestions.

 

Thanks

 

 

Hi,

 

I have a custom object named candidate (Salesforce Std Page layout) and in that we are capturing candidate email address.

 

I would like to send email to the candidate by clicking send email custom button. By clicking the send email button, outlook should  open with to as candidate email address and user can enter the body and subject. 

 

Note: I am not integrated outlook with salesforce

 

How to achieve this? Kindly advise.

 

 

Hi ,

 

I create visualforce page , but page is created , im using apex/filename -  the development mode will be open only it shows apex code , apex class controller , but it never shows the viewstate , ill check in the profile , personal information  it will selected in that page , but why this never shows page ,   please anyone can give solution..........

 

 

Regards

Ganez

Hi All,

    I don't want to remove the Notes & Attachments related list.  I just want to remove the "Attach File" button in Page Layouts.

HI,

 

I am trying to fetch values from visual force page to controller. My requirement is  - 

 

1. I have 4 textbox in my vf page where i will enter 4 integer values.

2. Those values should be given to controller for doing average function and return back the result to 5th textbox in my vf page.

 

My VF page code - 

<apex:page controller="test1" id="pg">
<apex:form >
<apex:pageBlock id="frm">
<apex:pageBlockSection columns="1">
<apex:inputText label="Num1:" id="text1" />
<apex:inputText label="Num2:" id="text2"/>
<apex:inputText label="Num3:" id="text3"/>
<apex:inputText label="Num4:" id="text4"/>
<apex:commandButton value="Click" id="button" style="width:80px"/>
<apex:inputText label="Result:" id="result"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<script type='text/javascript'>
function getvalue()
{
var a = document.getElementById('{!$Component.pg.frm.text1}').value
var b = document.getElementById('{!$Component.pg.frm.text2}').value
var c = document.getElementById('{!$Component.pg.frm.text3}').value
var d = document.getElementById('{!$Component.pg.frm.text4}').value
var e = document.getElementById('{!$Component.pg.frm.result}').value
}
</script>

</apex:page>

 

 

My Controller code - 

public with sharing class test1
{
public integer text1{get;set;}
public integer text2{get;set;}
public integer text3{get;set;}
public integer text4{get;set;}

public decimal avg(integer tex1,integer tex2,integer tex3,integer tex4)
{

integer result;
result = ((text1+text1+text1+text1)/4);
return result;
}}

 

 

. Kindly provide me solution how to achieve this scneario.

 

Thanks in Advance

Sidhartha

Hai 

 

i have an requrement on multi file uploading which should support IE browser i have done so much search on this but still no result can anybody please help me on this is urgent .

 

 

 

 

 

Thanks 

  • June 28, 2013
  • Like
  • 0

Hi all,

 

I'm trying to invoke a web service from SOUP UI 5.1 but I come up with the error stated in the subject.

 

What I did is create an apex class that actually does an insert into an sObejct (see the code below).

Then I generated a wsdl file from it and imported it inside my SOAP UI env.

 

Any help would be much appreciated.

 

----------------------------------------------------------------------------------------------------------------------------------------------

global class InsertInvoice{

webService static Id makeContact(String invoiceDescr) {

Invoice_Statement__c inv = new Invoice_Statement__c(Description__c='WebServiceInvoice');
// Insert the invoice using DML.
insert inv;
return inv.id;
}
}

----------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!--
Web Services API : InsertInvoice
-->
<definitions targetNamespace="http://soap.sforce.com/schemas/class/InsertInvoice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/InsertInvoice">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/InsertInvoice">
<xsd:element name="DebuggingInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="debugLog" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ID">
<xsd:restriction base="xsd:string">
<xsd:length value="18"/>
<xsd:pattern value="[a-zA-Z0-9]{18}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="LogCategory">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Db"/>
<xsd:enumeration value="Workflow"/>
<xsd:enumeration value="Validation"/>
<xsd:enumeration value="Callout"/>
<xsd:enumeration value="Apex_code"/>
<xsd:enumeration value="Apex_profiling"/>
<xsd:enumeration value="Visualforce"/>
<xsd:enumeration value="System"/>
<xsd:enumeration value="All"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="LogCategoryLevel">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Internal"/>
<xsd:enumeration value="Finest"/>
<xsd:enumeration value="Finer"/>
<xsd:enumeration value="Fine"/>
<xsd:enumeration value="Debug"/>
<xsd:enumeration value="Info"/>
<xsd:enumeration value="Warn"/>
<xsd:enumeration value="Error"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="LogInfo">
<xsd:sequence>
<xsd:element name="category" type="tns:LogCategory"/>
<xsd:element name="level" type="tns:LogCategoryLevel"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="LogType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="None"/>
<xsd:enumeration value="Debugonly"/>
<xsd:enumeration value="Db"/>
<xsd:enumeration value="Profiling"/>
<xsd:enumeration value="Callout"/>
<xsd:enumeration value="Detail"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="DebuggingHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="categories" minOccurs="0" maxOccurs="unbounded" type="tns:LogInfo"/>
<xsd:element name="debugLevel" type="tns:LogType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CallOptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="client" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SessionHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sessionId" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="AllowFieldTruncationHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="makeContact">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="invoiceDescr" type="xsd:string" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="makeContactResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="result" type="tns:ID" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<!-- Message for the header parts -->
<message name="Header">
<part name="AllowFieldTruncationHeader" element="tns:AllowFieldTruncationHeader"/>
<part name="CallOptions" element="tns:CallOptions"/>
<part name="DebuggingHeader" element="tns:DebuggingHeader"/>
<part name="DebuggingInfo" element="tns:DebuggingInfo"/>
<part name="SessionHeader" element="tns:SessionHeader"/>
</message>
<!-- Operation Messages -->
<message name="makeContactRequest">
<part element="tns:makeContact" name="parameters"/>
</message>
<message name="makeContactResponse">
<part element="tns:makeContactResponse" name="parameters"/>
</message>
<portType name="InsertInvoicePortType">
<operation name="makeContact">
<input message="tns:makeContactRequest"/>
<output message="tns:makeContactResponse"/>
</operation>
</portType>
<binding name="InsertInvoiceBinding" type="tns:InsertInvoicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="makeContact">
<soap:operation soapAction=""/>
<input>
<soap:header use="literal" part="SessionHeader" message="tns:Header"/>
<soap:header use="literal" part="CallOptions" message="tns:Header"/>
<soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
<soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
<soap:body use="literal" parts="parameters"/>
</input>
<output>
<soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="InsertInvoiceService">
<documentation></documentation>
<port binding="tns:InsertInvoiceBinding" name="InsertInvoice">
<soap:address location="https://na15-api.salesforce.com/services/Soap/class/InsertInvoice"/>
</port>
</service>
</definitions>

 

----------------------------------------------------------------------------------------------------------------------------------------------

hi every one, need ur help

 

When i m sending the hard code xml data through http,in response i m getting the status is ok n status code is 200,but the xml data is going to the external server in some encoded form.I m not using any encoding(like UTF-8) in my code,but still the external server getting xml in encoded form. 

 

Can any one tell me,how to remove this problm,cos if the external server receives the correct xml format data it will response back to correct value,for which i m looking.

 

Hi,

 

We are using Single-Sign on to allow customers to log into the customer portal without having to enter their login details. The problem is, if this single-sign on fails for whatever reason, the customer reaches a Customer Portal login page (login_portal.jsp), with the username already filled in, and asking for a password. This will be confusing for our customers if it happens, as theyhaven't knowingly entered a username or password (as their login is handled by the single sign on).

 

The question is, is it possible to designate a redirect page (or at least a message to be displayed) if the single sign on fails? I have seen that we can designate a page to arrive at for successful logins and logouts, but I haven't found a way of definining what happens if the login fails - we do not want this login page (login_portal.jsp) to be displayed.

 

Any ideas will be greatly appreciated

 

Thanks,

 

Dan