• S D
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 20
    Replies
I am trying to update the inlineEdited field in Extension Controller, and am not able to capture the value of the Phone# field in the Controller?


<apex:outputField value="{!candidate.Phone__c}" label="Phone#">
           <apex:inlineEditSupport event="ondblclick" showOnEdit="EditBttn" HideOnEdit="DelBttn" /> </apex:outputField>
My COntroller Code:
public string Phone{get;set;}  //how to capture the value ??

  public UpdateCandidateInfo(ApexPages.StandardController controller) 
  {
           this.jb = (Job_Application__c )controller.getRecord(); 
           system.debug( 'jb' + this.jb);
           system.debug('candidate Id' +  jb.Candidate__c);
  }
public void save()  // Also on click of Save this part of code is not getting called.
   {
         system.debug('Phone' +pPhone);  //in Logs i can see the Phone is empty
        candidate   = new Candidate__c ();
        candidate.Phone__c = pPhone;
        candidate.id= jb.Candidate__c;
       update candidate ;
      
   }


  • August 17, 2014
  • Like
  • 0
Can anyone please help me with this:---

I want to  only insert 3 records using POST Method. and as its not a bulk request so i am not preferring  BULK API.

also as JSON does support the storage of data as array, so believe the below format is good to go for. 

But am not able to understand how would this be processed further in Apex Class???  How can i pass it as a  signature to the class. I tried to do and got the below error.

format of JSON :

{"merch" : [
{"name" : "Eraser1", "description" : "desc", "price" = 2, "Inventory" : 1000},
{"name" : "Eraser2", "description" : "desc", "price" = 20, "Inventory" : 9000},
{"name" : "Eraser3", "description" : "desc", "price" = 28, "Inventory" : 6000}
]}

Error:
"message" : "Unexpected parameter encountered during deserialization: merch at [line:1, column:12]",
  "errorCode" : "JSON_PARSER_ERROR"
} ]

I am not sure what does this error mean??
  • July 30, 2014
  • Like
  • 0
Hi, am new to SOQL and trying to learn with workbook : but somehow I have observed none of the SOQL for parent child traversing works for me :I am executing this from Developer console and WorkBench. Both giving the below error:

My SOQL is : 
select id, name, (SELECT Name
FROM Job_Application__r)
from Position__c

Just trying to execute the query from workbook. Is there any setting required to make in tools.??



SOQL error from WOrkbench

Thanks!!
  • July 30, 2014
  • Like
  • 0
Hi
I am using the below code , and looking it to perform its standard function of saving the change and not redirecting .
I am new to visual force so still not able to understand the correct usage of reRender, as using it on my below  code,suffice the need of not redirecting it but in that case,changes are not saved. 

<apex:page standardController="Account" recordSetVar="records" id="thePage">
<apex:form id="theForm">
<apex:pageBlock id="thePageBlock">
<apex:outputPanel id="locationPicker">
<apex:pageBlockTable value="{!records}" var="record" id="thePageBlockTable">

<apex:column >
<apex:outputField value="{!record.Name}" id="AccountNameDOM" />
<apex:facet name="header">Name</apex:facet>
</apex:column>
<apex:column >
<apex:outputField value="{!record.Type}" id="AccountTypeDOM" />
<apex:facet name="header">Type</apex:facet>
</apex:column>
<apex:column >
<apex:outputField value="{!record.Industry}"
id="AccountIndustryDOM" />
<apex:facet name="header">Industry</apex:facet>
</apex:column>
</apex:pageBlockTable>
</apex:outputPanel>
<apex:inlineEditSupport event="ondblClick"
showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />


<apex:pageBlockButtons >
<apex:commandButton value="Edit" action="{!save}" id="editButton"  />
<apex:commandButton value="Save" action="{!save}" id="saveButton"  reRender="locationPicker"/>
<apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

what shall be done to sort this out?
  • July 18, 2014
  • Like
  • 0
I am using the following Apex Web Service class.
Global class SuryaDhuravSoftWebservice
{
 webservice static String saywelcome(String Name)
 {
 return 'Hello' +Name+' welcome to salesforce Web Services';
 }
 }
I generated the WSDL and created another apex class using that WSDL, code pasted below
<!-- 
 Web Services API : SuryaDhuravSoftWebservice
 -->
<definitions 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/SuryaDhuravSoftWebservice" targetNamespace="http://soap.sforce.com/schemas/class/SuryaDhuravSoftWebservice">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/SuryaDhuravSoftWebservice">
<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="saywelcome">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="saywelcomeResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="result" type="xsd:string" 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="saywelcomeRequest">
<part element="tns:saywelcome" name="parameters"/>
</message>
<message name="saywelcomeResponse">
<part element="tns:saywelcomeResponse" name="parameters"/>
</message>
<portType name="SuryaDhuravSoftWebservicePortType">
<operation name="saywelcome">
<input message="tns:saywelcomeRequest"/>
<output message="tns:saywelcomeResponse"/>
</operation>
</portType>
<binding name="SuryaDhuravSoftWebserviceBinding" type="tns:SuryaDhuravSoftWebservicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="saywelcome">
<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="SuryaDhuravSoftWebserviceService">
<documentation/>
<port binding="tns:SuryaDhuravSoftWebserviceBinding" name="SuryaDhuravSoftWebservice">
<soap:address location="https://ap1.salesforce.com/services/Soap/class/SuryaDhuravSoftWebservice"/>
</port>
</service>
</definitions>

In Remote Site Setting As end point URL 
User-added image

Now I am executing the following code in Developer Console.
soapSforceComSchemasClassSuryadhura.SuryaDhuravSoftWebservice  proxyClass = new soapSforceComSchemasClassSuryadhura.SuryaDhuravSoftWebservice();

String retVal = proxyClass.saywelcome('prayank');

System.debug('------retVal----'+retVal);

But It shows Error 
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=

What i am doing wrong here ?


  • August 21, 2014
  • Like
  • 0
How do I make vertical tables in HTML? By vertical, I mean the rows will be vertical with table headers on the left.

I have tried something like below, i can display results how i was expecting but when any field value is empty then that particulat  <td> cell is shrinking its height and making entire table big mess. I tried CSS "empty-cells: show" but it is also not working.

<style>
    table { border-collapse: separate; empty-cells: show; line-height:25px; }
     tr { display: block; float: left; width:200px;}
    th,  td { display: block; }
    #rich1 .sfdc_richtext img {width:90%; height:250px;}
  </style>

  <apex:form >

      <table border="1" class="variant-table" >
         <tr>
            <td style=" height:250px; border:0;"></td>
            <td style="background-color: #53B3AE;">Name</td>
            <td style="background-color: #53B3AE;">SKU Number</td>
            <td style="background-color: #53B3AE;">WAN</td>
            <td style="background-color: #53B3AE;">HAN</td>
            <td style="background-color: #53B3AE;">Physical Dimensions</td>
            <td style="background-color: #53B3AE;">Notes</td>
         </tr>
         <apex:repeat value="{!arqivaproducts}" var="p">
         <tr>
            <td id="rich1"><apex:outputField style=" border:none;" value="{!p.Arq_Product_Image__c}"></apex:outputField></td>
            <!-- <td> <apex:image style="align:center;" url="{!p.Arq_Product_Image__c}"  /></td> -->
            <td><apex:outputField value="{!p.Name}"></apex:outputField></td>
            <td><apex:outputField value="{!p.ccrz__SKU__c}"></apex:outputField></td>
            <td><apex:outputText value="{!p.CCArq_WAN__c}"></apex:outputText></td>
            <td><apex:outputText value="{!p.CCArq_HAN__c}"></apex:outputText></td>
            <td><apex:outputField value="{!p.CCArq_Physical_Dimensions__c}"></apex:outputField></td>
            <td><apex:outputField value="{!p.ccrz__LongDesc__c}"></apex:outputField></td>
         </tr>
         </apex:repeat>
      </table>
      
  </apex:form>


Please let me know if any one has any better solution than this or any adice how can i fix my issue when values are empty.

Thanks in Advance

Regards,
Ramesh
I am trying to update the inlineEdited field in Extension Controller, and am not able to capture the value of the Phone# field in the Controller?


<apex:outputField value="{!candidate.Phone__c}" label="Phone#">
           <apex:inlineEditSupport event="ondblclick" showOnEdit="EditBttn" HideOnEdit="DelBttn" /> </apex:outputField>
My COntroller Code:
public string Phone{get;set;}  //how to capture the value ??

  public UpdateCandidateInfo(ApexPages.StandardController controller) 
  {
           this.jb = (Job_Application__c )controller.getRecord(); 
           system.debug( 'jb' + this.jb);
           system.debug('candidate Id' +  jb.Candidate__c);
  }
public void save()  // Also on click of Save this part of code is not getting called.
   {
         system.debug('Phone' +pPhone);  //in Logs i can see the Phone is empty
        candidate   = new Candidate__c ();
        candidate.Phone__c = pPhone;
        candidate.id= jb.Candidate__c;
       update candidate ;
      
   }


  • August 17, 2014
  • Like
  • 0
Can anyone please help me with this:---

I want to  only insert 3 records using POST Method. and as its not a bulk request so i am not preferring  BULK API.

also as JSON does support the storage of data as array, so believe the below format is good to go for. 

But am not able to understand how would this be processed further in Apex Class???  How can i pass it as a  signature to the class. I tried to do and got the below error.

format of JSON :

{"merch" : [
{"name" : "Eraser1", "description" : "desc", "price" = 2, "Inventory" : 1000},
{"name" : "Eraser2", "description" : "desc", "price" = 20, "Inventory" : 9000},
{"name" : "Eraser3", "description" : "desc", "price" = 28, "Inventory" : 6000}
]}

Error:
"message" : "Unexpected parameter encountered during deserialization: merch at [line:1, column:12]",
  "errorCode" : "JSON_PARSER_ERROR"
} ]

I am not sure what does this error mean??
  • July 30, 2014
  • Like
  • 0
Hi, am new to SOQL and trying to learn with workbook : but somehow I have observed none of the SOQL for parent child traversing works for me :I am executing this from Developer console and WorkBench. Both giving the below error:

My SOQL is : 
select id, name, (SELECT Name
FROM Job_Application__r)
from Position__c

Just trying to execute the query from workbook. Is there any setting required to make in tools.??



SOQL error from WOrkbench

Thanks!!
  • July 30, 2014
  • Like
  • 0
Hi floks,

I need to insert Account with mutiple contact records at a time using apex rest api . i will be getting the response in json please help me . i had read many article in google .but i was not able to figure it . please help me to over come this stiuation .

Thanks,
AZU
Hi
I am using the below code , and looking it to perform its standard function of saving the change and not redirecting .
I am new to visual force so still not able to understand the correct usage of reRender, as using it on my below  code,suffice the need of not redirecting it but in that case,changes are not saved. 

<apex:page standardController="Account" recordSetVar="records" id="thePage">
<apex:form id="theForm">
<apex:pageBlock id="thePageBlock">
<apex:outputPanel id="locationPicker">
<apex:pageBlockTable value="{!records}" var="record" id="thePageBlockTable">

<apex:column >
<apex:outputField value="{!record.Name}" id="AccountNameDOM" />
<apex:facet name="header">Name</apex:facet>
</apex:column>
<apex:column >
<apex:outputField value="{!record.Type}" id="AccountTypeDOM" />
<apex:facet name="header">Type</apex:facet>
</apex:column>
<apex:column >
<apex:outputField value="{!record.Industry}"
id="AccountIndustryDOM" />
<apex:facet name="header">Industry</apex:facet>
</apex:column>
</apex:pageBlockTable>
</apex:outputPanel>
<apex:inlineEditSupport event="ondblClick"
showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />


<apex:pageBlockButtons >
<apex:commandButton value="Edit" action="{!save}" id="editButton"  />
<apex:commandButton value="Save" action="{!save}" id="saveButton"  reRender="locationPicker"/>
<apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

what shall be done to sort this out?
  • July 18, 2014
  • Like
  • 0
Hi, 

I am able to create Quote by using POST method with JSON data and REST URL as https://instance-name/services/data/v29.0/sobjects/Quote But I am not seeing any Quote Line Items in Quote.

I have given opportunity Id in json to create Quote thereafter is not creating QuoteLineItems which is already exist in opportunity as products.

My JSON data to create Quote is,
{
   "Name" : "NewTest",
   "OpportunityId" : "006U000000FqDTR",
}

Please reply what JSON format should I use, so that it will create QuoteLineItems too.

Just build this great visualforce page to replace the standard salesforce view page for a custom object. Now it seems I can't add the Activity History or the History Tracking list. 

 

Is there anyway to do this without creating a custom apex class? (I'm on professonal)

I have a JSON string which represents a List<String>, but I can't figure out how to deserialize it - I don't know what to put for the deserialization type argument.

 

List<String> myList = (List<String>)System.JSON.deserialize(json_string, ????);

 

I've tried putting "List<String>" as the arg, but I get an error about an "unexpected token".

Re-Posting to the Apex Board per a suggestion...(http://boards.developerforce.com/t5/Formulas-Validation-Rules/Execute-Workflow-Rules-from-Apex/td-p/272059)

 

Is it possible to execute a workflow rule from an Apex class?

 

For example could I query the metadata of an Opportunity and get back the array of all workflow rules (e.g., WorkflowRule[]) then execute a specific one?

 

 

//pseudo code//

//could one perform something to the effect of...

 

WorkFlowRule[] rules = gatherRules();

 

WorkflowRule rule = WorkflowRules[0];

 

rule.execute();

 

 

 

Thanks in advance.

 

 

Hi,
 
I've look around on the boards and through the documentation on this, but haven't been able to find an answer.  I'm using both the API and a third-party product to connect to Salesforce, and thus need a security token appended to my password (we haven't whitelisted our IP yet, as the IP of the connecting machine periodically changes right now, but we might use a static IP in the future).
 
connecting to the non-sandbox works fine with the token, but i'm unable to connect to the sandbox data with the same token.  Do i need to have a security token generated for the Sandbox login as well?  Will this interfere with the "live" login?
 
Thanks,
Matt