• Vipul Sharma 15
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 12
    Replies
Hi
I am kinda stuck.
I have a div, form and an iFrame inside a lightning component. Div has the onClick attribute and moment div is clicked , it should POST the HTML form and iFrame should be visible with hosted page.

parametersValues and signedData, these details are present already.
Component Code

<div aura:id="sectionOne"  onclick="{!c.sectionOne}">
                                <div class="slds-hide slds-p-around–medium" aura:id="articleOne">
                                 <body> 
                                    <form id="theFormHost"  action="https://testsecure.com/pay" 
                                          target="my_frame" method="post" >
                                        <aura:unescapedHtml value="{!v.parametersValues}" />
                                        <aura:unescapedHtml value="{!v.signedData}" />
                                       </form>
                                </body>
                                <iframe aura:id="my_frame"
                                        name="my_frame" 
                                        src ="https://testsecure.com/pay"
                                        width="100%"
                                        height="250"
                                        frameborder="0">
                                </iframe>
                                </div>
                                </div>
------------------------------------------------------------
JS controller code
sectionOne : function(cmp, event, helper) {
var lst= cmp.find('articleOne');
        for(var v in acc) {
            $A.util.toggleClass(lst[v], 'slds-show');
            $A.util.toggleClass(lst[v], 'slds-hide');
        }
 document.getElementById('theFormHost').submit;
}

Any help is appreciated.
Hello ,
Here is the scenario,
I have an apex trigger and its handler class with an adderror method, so whenever a record is in approval process and some user tries to approve/reject a record without entering any commnets , addError method is called and it shows the mesaage that comments cannot be blank but after refreshing the page, the record status is changed from Pending to Approved. 
This is working well and good in sfdc web but coming to SF1 I am facing this issue , record is getting approved/Rejected even after adderror throws an error(it should not happen) inn SF1. 

Please advice how to overcome it. Or if more information is needed do let me know. Thanks for the assistance.
Hi Everyone , I am stuck
I am currently testing out some functionality where I have to pass 1 record value from one instance to other instance of salesforce using SOAP webservice and WSDL , steps being followed by me :
step1 :  wrote a webservice class in SFDC instance1
step2 : after successfull creation , clicked on GENERATE WSDL on the same page and saved it.
step 3 : opened my SFDC instance2 and in Apex class -- clicked on Generate from  WSDL , here i refered to the wsdl class which I had obtained from SFDC instance 1.
step 4 :  now I am working in my another controller class in sfdc Instance2 and trying to fetch the data retured from WSDL class (by intiating it and calling my method in it ) but it is saying
"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="

I know I am missing many things :
- call login() with username and password
- I have to fetch the session ID and use it

even I want to set them up , but I am unable to find out them in my "APEX generated from wsdl class" . There is only 1 method with the name LoginINFO (no username or password in the method) in my apex generated frm WSDL
please advise and assist me.
Thanks
Hi Guys, 

Has anyone tried Cybersource silent order API integration with Salesforce? Looking for some help.
Thanks in advance.

Thanks,
Prashant.
Hi,

I'm currently working on the Lightning Component Framework Specialist Superbadge.

When I click "New", at least as I've interpretted the requirements, the "Friends with Boats" pages is behaving as expected, but Trailhead complains:
Challenge Not yet complete... here's what's wrong: 
The BoatSearchForm component's "New" button should launch the default boat record create page using logic in its controller.

Have I misunderstood a requirement?

Here is my markup:
 
<aura:component controller="BoatSearchFormAuraCtrl" >
	<aura:attribute access="private" name="boatList" type="BoatType__c[]" default="[]" />
	<aura:attribute access="private" name="showNewButton" type="Boolean" default="false" />
	<aura:attribute access="private" name="selectedBoat" type="BoatType__c" />
	
	<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
	
	<h2 class="slds-page-header__title">Find a Boat</h2>
	<form>
		<lightning:layout horizontalAlign="center">
		    <lightning:select name="select" value="{!v.selectedBoat}">
		        <option value="">All Types</option>
		        <aura:iteration items="{!v.boatList}" var="boat">
		            <option value="{!boat.Name}" text="{!boat.Name}"></option>
		        </aura:iteration> 
		    </lightning:select>
		    <lightning:button name="Search" label="Search" variant="brand" />
		    <aura:if isTrue="{!v.showNewButton}">
		    	<lightning:button name="New" label="New" variant="neutral" onclick="{!c.createBoat}"/>
		    </aura:if>
		</lightning:layout>
	</form>	
</aura:component>
And here is my controller:
({
	doInit : function(component, event, helper) {
		component.set('v.showNewButton', $A.get('e.force:createRecord'));
		helper.setBoatTypeList(component);
	},
	
	createBoat : function(component) {
		var createRecordEvent = $A.get('e.force:createRecord');
		createRecordEvent.setParams({
			'entityApiName' : 'BoatType__c',
			'defaultFieldValues': {
				'Name': component.get('v.selectedBoat')
			},
		});
		createRecordEvent.fire();
	}
})





 
Below is the apex class for which I have generated a wsdl
global class DemoWS{
    static webservice String greetings(){
    String s='Happy Holidays';
    return s;
  }
}

Below is my wsdl which I have used in another org to generate apex class---

​This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!-- Web Services API : custom_package.DemoWS -->
<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/custom_package/DemoWS" targetNamespace="http://soap.sforce.com/schemas/class/custom_package/DemoWS">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/custom_package/DemoWS">
<xsd:element name="AllowFieldTruncationHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
</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="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: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="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: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="DebuggingInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="debugLog" 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: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:element name="greetings">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
<xsd:element name="greetingsResponse">
<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="greetingsRequest">
<part element="tns:greetings" name="parameters"/>
</message>
<message name="greetingsResponse">
<part element="tns:greetingsResponse" name="parameters"/>
</message>
<portType name="DemoWSPortType">
<operation name="greetings">
<input message="tns:greetingsRequest"/>
<output message="tns:greetingsResponse"/>
</operation>
</portType>
<binding name="DemoWSBinding" type="tns:DemoWSPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="greetings">
<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="DemoWSService">
<documentation/>
<port binding="tns:DemoWSBinding" name="DemoWS">
<soap:address location="https://ap1.salesforce.com/services/Soap/class/custom_package/DemoWS"/>
</port>
</service>
</definitions>

Using the above wsdl the generated apex is below

//Generated by wsdl2apex
public class demo {
    public class LogInfo {
        public String category;
        public String level;
        private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'category','level'};
    }
    public class AllowFieldTruncationHeader_element {
        public Boolean allowFieldTruncation;
        private String[] allowFieldTruncation_type_info = new String[]{'allowFieldTruncation','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'allowFieldTruncation'};
    }
    public class DebuggingHeader_element {
        public demo.LogInfo[] categories;
        public String debugLevel;
        private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'0','-1','false'};
        private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'categories','debugLevel'};
    }
    public class CallOptions_element {
        public String client;
        private String[] client_type_info = new String[]{'client','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'client'};
    }
    public class greetingsResponse_element {
        public String result;
        private String[] result_type_info = new String[]{'result','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'result'};
    }
    public class SessionHeader_element {
        public String sessionId;
        private String[] sessionId_type_info = new String[]{'sessionId','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'sessionId'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/custom_package/DemoWS',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class greetings_element {
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class DemoWS {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/custom_package/DemoWS';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public demo.SessionHeader_element SessionHeader;
        public demo.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public demo.DebuggingHeader_element DebuggingHeader;
        public demo.DebuggingInfo_element DebuggingInfo;
        public demo.CallOptions_element CallOptions;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/custom_package/DemoWS';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/custom_package/DemoWS';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/custom_package/DemoWS';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/custom_package/DemoWS';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/custom_package/DemoWS';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/custom_package/DemoWS', 'demo'};
        public String greetings() {
            demo.greetings_element request_x = new demo.greetings_element();
            demo.greetingsResponse_element response_x;
            Map<String, demo.greetingsResponse_element> response_map_x = new Map<String, demo.greetingsResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/custom_package/DemoWS',
              'greetings',
              'http://soap.sforce.com/schemas/class/custom_package/DemoWS',
              'greetingsResponse',
              'demo.greetingsResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
    }
}

and the anonymous block where I have used the below code to run that apex is

demo.DemoWS stub = new demo.DemoWS();
stub.greetings();

I have used correct endpoint in remote settings .

Please help .

Thanks in advance.
I am writing a unit test class in which the original class methods submit a record for approval; then they query like this :

[ select id, status, lastmodifieddate,lastmodifiedby.Name, isdeleted,createddate , createdby.Name, targetobjectId , (select Id, IsPending, ProcessInstanceId  , TargetObjectId , StepStatus, OriginalActor.Name , Actor.Name , RemindersSent from StepsAndWorkItems  order by createdDate desc, stepstatus asc)  from ProcessInstance  where TargetObjectId =:testRec.Id ]

the problem is the testRec was succesfully submitted for approval and the ProcessInstance records have Status as 'Pending'  but their children stepsAndWorkItems always return null.This does not happen when I use an original record and try the same in Executing_Anynomous_Window with a real record it gives me StepsAndWorkItems records. Please tell me what to do. Thanks
I have a requirement in Lightning community, from a lightning
component the user has a button to make payment -
- when clicked on that button, a lightning dialog will be displayed, initially this dialog box is hidden, after clicking "make payment " button, i am enabling dialog to show
-then user selects card type - like master, visa etc and click to proceed button
-this button and cardtype selection are included inside a <form> that has other information required to pass for payment gateway url.
-after proceed button is clicked, in the pop - user has to enter required info like card no, cvv, exp etc.-that shows a button to complete payment.
***************************************************
My problem is after clicking on the proceed button, the <form> is not being posted to the iframe i am using to redirect the user for processing payment. 
Can somebody solve or suggest a better way to handle this ? 

Below is my code written
*******************************************
LIGHTNING COMPONENT CODE:
*****************************************************
<div class="slds">
        <div aria-hidden="true" role="dialog" class="slds-modal slds-modal--prompt slds-fade-in-hide" aura:id="modaldialog">
            <div class="slds-modal__container">
                <div class="slds-modal__header slds-theme--info">
                    <button class="slds-button slds-button--icon-inverse slds-notify__close" 
                            onclick="{!c.hidePopup}" title="Close Pop-Up">
                        <span class="slds-assistive-text">
                            Close
                        </span>
                        <b>X</b>
                    </button>
                    <h2 class="slds-text-heading--medium">Make Payment</h2>
                </div>
                <div class="slds-modal__content slds-p-around--small">
                    <div class="font-size-text-xx-small">
                         <p> 
                               SAMPLE TEXT
                        </p>
                    </div>
                    <div aura:id="payment" class="slds-visible">
                        <b>
                            Your billable Amount: &nbsp;&nbsp; 
                        </b>
                        <p class="slds-truncate">
                            <ui:outputCurrency aura:id="mamount" value="141.20"/>
                        </p>
                    </div>
                    <br/>
                    <form target="<ID OF IFRAME>" action="https://securepaymentstest.cardconnect.com/hpp/payment/?5" method="post" 
                      name="cardconnectForm" aura:id="cardconnectForm">
                    <input type="hidden" name="ccId" value="<STANDARD CCID TO BE PASSED TO THIS PAYMENT GATEWAY PAGE>" id="ccId"/>
                    <input type="hidden" name="ccSite" value="gewater" />
                    <input type="hidden" name="ccCssUrl" value="<A URL GENERATED IN OUR SFDC>"/>
                    <input type="hidden" name="ccPostbackUrl" value="<A URL GENERATED IN OUR SFDC>" />
                    <input type="hidden" name="ccDisplayAddress" value="0" />
                    <input type="hidden" name="ccDisplayCvv" value="1" />
                    <input type="hidden" name="ccCancel" value="0" />
                    <input type="hidden" name="ccAmount" id="amount" value="141.20"/>                                    
                    <input type="hidden" name="ccname" id="name" value="testingggg"/>                           
                    <input type="hidden" id="invoiceNumber" name="ccOrderId" />
                    <input type="hidden" name="ccCapture" value="1" /><!-- we want to not pull funds from card, just see if it's authorized for it -->
                    <input type="hidden" name="ccTokenize" value="1" /><!-- we need the token and the token and other info needs to be saved to CC in the order object so that GE can get it from SAP -->                         
                    <div class="slds-align--absolute-left">
                        <ui:inputSelect aura:id="cardType" multiple="false" class="slds-visible">
                            <ui:inputSelectOption text="Select a card..." label="Select a card..." value="true"/>
                            <ui:inputSelectOption text="Mastercard" label="Mastercard"/>
                            <ui:inputSelectOption text="Visa" label="Visa"/>
                            <ui:inputSelectOption text="American Express" label="American Express"/>
                        </ui:inputSelect>
                    </div>
                    <br/>
                    <div style="text-align:right">   
                        <ui:button aura:id="proceedBtn" buttonTitle="Click to Continue for Completing Payment Process." 
                                   class="slds-visible actionBtn" label="Proceed" press="<AFTER CLICKING ON THIS BUTTON, I AM MAKING TO SHOW IFRAM >"/>
                    </div>
                </form>
                 <iframe aura:id="<ID OF IFRAME>" name="<NAME OF IFRAME THAT IS SAME AS ID>" class="slds-hide"
                        style="width: 100%; height: 405px;" src="https://securepaymentstest.cardconnect.com/hpp/payment/?5" />  
                </div>
            </div>
        </div>
    </div>
    
    *************************************
    lightning component javascript code to show frame and to add data to iframe from <form> body
     var iframeBody = $('#iframeCheckout').contents().find('body');
    var styleTag = iframeBody.append($('#cardconnectForm'));
    
    compId = component.find("iframeCheckout");
    $A.util.removeClass(compId, 'slds-hide');
    $A.util.addClass(compId, 'slds-visible');