• Sandip Chakraborty
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I need a help here. Though I have passed the challenge 7 , but my review Tab is not getting focus. However the event is fired and captured by the parent component but it is not chaning the tab. I have tried in google chrome and edge. Here is my code. Any help is appreciated.

Boat Detais - 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="id" type="Id" />
    <aura:attribute name="boat" type="Boat__c" />
    <aura:attribute name="selectedTabId" type="String"/>
    <aura:handler event="c:BoatSelected" action="{!c.onBoatSelected}"/>
    <aura:handler name="boatReviewAdded" event="c:BoatReviewAdded" action="{!c.onBoatReviewAdded}" />
    <aura:if isTrue="{! !empty(v.boat)}">
        <lightning:tabset variant="scoped" aura:id="tabs" selectedTabId="{!v.selectedTabId}">
            <lightning:tab label="Details" aura:id="boatdetailstab">
                <c:BoatDetail boat="{!v.boat}"/>
            </lightning:tab>
            <lightning:tab label="Reviews" aura:id="boatreviewtab">
                This is review tab !!
            </lightning:tab>
            <lightning:tab label="Add Review" aura:id="addreviewtab">
                <c:AddBoatReview boat="{!v.boat}"/>
            </lightning:tab>
        </lightning:tabset>
    </aura:if>
    <force:recordData aura:id="service"
        recordId="{!v.id}"
        targetFields="{!v.boat}"
        fields="Id, Name, Description__c,Price__c,Length__c,
            Contact__r.Name,Contact__r.Email,Contact__r.HomePhone,BoatType__r.Name,Picture__c"
        mode="VIEW"
        recordUpdated="{!c.onRecordUpdated}"
    />
</aura:component>
BoatDetailsController :
({
    onBoatSelected : function(component, event, helper) {
        console.log('Method from Boat Details..');
        var boat = event.getParam("boat");
        console.log('Boat Id..'+boat.Id);
        component.set("v.id" , boat.Id);
        var recordData = component.find("service");
        recordData.reloadRecord();
        
    },
    onBoatReviewAdded : function (component, event, helper){
        console.log("Review tab event listen..");
// I tried below both option. not any luck.
        component.set("v.selectedTabId","boatreviewtab");
        //component.find("tabs").set("v.selectedTabId","boatreviewtab");

    },
    onRecordUpdated : function (component, event, helper)
    {
        var recordData = component.find("service");
        recordData.reloadRecord();
    }
})

BoatReviewAdded :
<aura:event type="COMPONENT" description="Event template">
    <aura:attribute name="boat" type="Boat__c" /> // I Added this attribute as an option if that solves my problem. But no luck.
</aura:event>

AddBoatReview.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
    <aura:attribute name="boat" type="Boat__c"/>
    <aura:attribute name="boatReview" type="BoatReview__c"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:registerEvent name="boatReviewAdded" type="c:BoatReviewAdded" />
    <aura:attribute name="recordError" type="String" access="private"/>
    
    <force:recordData aura:id="service"
        targetFields="{!v.boatReview}"
        targetError="{!v.recordError}"
        fields="Id,Name,Comment__c,Boat__c"
        recordUpdated="{!c.onRecordUpdated}"
    />
    <div class="slds-form slds-form-element-stacked">
        <lightning:input aura:id="title" name="title" label="Title" value="{!v.boatReview.Name}" required="true"/> 
        <lightning:inputRichText aura:id="comment" labelVisible="true" label="Description:"   disabledCategories="FORMAT_FONT" placeholder="Comment" value="{!v.boatReview.Comment__c}"/> 
        <lightning:button iconName="utility:save" label="Save" onclick="{!c.onSave}" class="slds-align_absolute-center"/>
    </div>
    <aura:if isTrue="{!not(empty(v.recordError))}">
        <div class="recordError">
            {!v.recordError}
        </div>
    </aura:if>
</aura:component>

AddBoatReview controller
({
    doInit : function(component, event, helper) {
        helper.onInit(component, event, helper);
    },
    onSave : function(component, event, helper){
        component.find("service").saveRecord($A.getCallback(function(saveResult){
            if(saveResult.state == "SUCCESS" ||saveResult.state == "DRAFT"){
                
                var toastEvt = $A.get("e.force:showToast");
                if(toastEvt){
                    toastEvt.setParams({
                        "title":"Success !!",
                        "message" :"Record Created Successfully"
                    });
                    toastEvt.fire();
                }
                else{
                    alert("Record Created Successfully");
                }
                helper.onInit(component, event, helper);
                component.getEvent("boatReviewAdded").fire();
                
            }
            else if(saveResult.state == "ERROR"){
                
            } 

        }));
    },
    onRecordUpdated : function (component,event,helper){
        var changeType = event.getParams().changeType;
        /*
        if (changeType === "ERROR") {}
        else if (changeType === "LOADED") {}
        else if (changeType === "REMOVED") {}
        else if (changeType === "CHANGED") {}
        */
        if(changeType === "CHANGED"){
            var toastEvt = $A.get("e.force:showToast");
            if(toastEvt){
                toastEvt.setParams({
                    "title":"Success !!",
                    "message" :"Record Changed Successfully"
                });
                toastEvt.fire();
            }
            else{
                alert("Record Changed Successfully");
            }
        }
    }
})

 
I have very painful experinece to authorize an Org. Most of the time it fails to authorize the Org and shows the below error. I restarted m/c , shutdown , kill the node.js process , re-install and install Vs code . But nothing works.
Any help is very much needed. 

Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
13:16:15.855 sfdx force:auth:web:login --setalias personal --instanceurl https://login.salesforce.com --setdefaultusername ended with exit code 1

 
Hi,
I want clear one doubt of mine for a 2 Way SSL apex call out.
AS per my understanding here is the step - 
1) Create CA signed Cert. Down load the CSR. get it signed by CA and upload it again. I believe this is client certificate in this case.
2) Do I now need to download this cert and share with the external server whom I am making the webservice call ?, If not then how the server verifies the client certificate which I store in salesforce ?
3 And , the server certificate which is send by Server during SSL handshking process will be a different one which will be verified by Salesforce under their trust store as per this link - http://wiki.developerforce.com/index.php/Outbound_Messaging_SSL_CA_Certificates

Can any one confirm if all 3 steps are correct or anything is wrong here ?
 
How to make the community made of VF page+Tab to publicly accessible ? I create a community and gave Case status to my guest profile. But when I click the URL it takes me to login screen.
 
Hello,

I am working on integrating Salesforce.com and external system (ERP).  I am making a call out using SOAP API

What I have provided to third party?
- Create a user for integration and shared the username,password&securitytoken
-Created an global apex class with webservice methods.
-Generated WSDL from above class
-Generated Enterprise WSDL

What I received from third party?
-WSDL (https end point)
-.PEM certificate and .pfx format certifcate

Development process on Salesforce side

I have generated a single Apex class (Gnerate from WSDL) from the WSDL I recieved from third party.

One of the classes generated is below

public class HTTPS_Port {
        public String endpoint_x = ‘bhla bhla…’;
        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;



            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://sap.com/xi/WebService/soap1.1',
              'urn:sap-com:document:sap:soap:functions:mc-style',
              'YRequest',
              'urn:sap-com:document:sap:soap:functions:mc-style',
              'YRequestResponse',
              'WebServiceClient.YRequestResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.FStatus;
        }
    }


I have generated an apex class to call the third party service (above generated class). In this class I have to provide the following

public String clientCertName_x;// may be this is required if the certificate is generated with in SAlesforce org. So I might not need to pass this info.
        public String clientCert_x; // This is the certifcate which has based64. I am good with this
        public String clientCertPasswd_x; // what is the password i need to enter  here. I asked third party to give this password but they say don't have it. Where do i get this password from?

My call fails if I don't enter the password. Error is - CertPasswd cannot be null
If the give a blank string for the password, the Error is "Error MessageIO Exception: DER input, Integer tag error"

I am stuck with the password issue here. Can someone help me out if there is something to be on Salesforce side? Am I missing something?

Any help is greatly appreciated.

Thank you!