-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
1Replies
Salesforce Twitter - Non-200 response code during CRC GET request (i.e. 404, 500, etc)
I have created a Apex Rest Service and enabled the Respective Apex Class under Public Access settings of a Remote site.When i hit this API of twitter with OAuth1 Authorisation
https://api.twitter.com/1.1/account_activity/all/:ENV_NAME/webhooks.json?url=https://{Salesforce_Domain}.com/services/apexrest/{urlMapping}
I am getting the below Error Response
"Non-200 response code during CRC GET request (i.e. 404, 500, etc)"
and i m getting this error while using apex REST services
"METHOD_NOT_ALLOWED errorCode: METHOD_NOT_ALLOWED message: HTTP Method 'POST' not allowed. Allowed are HEAD,GET".
Please help me in registering web hook between twitter and salesforce.
https://api.twitter.com/1.1/account_activity/all/:ENV_NAME/webhooks.json?url=https://{Salesforce_Domain}.com/services/apexrest/{urlMapping}
I am getting the below Error Response
"Non-200 response code during CRC GET request (i.e. 404, 500, etc)"
and i m getting this error while using apex REST services
"METHOD_NOT_ALLOWED errorCode: METHOD_NOT_ALLOWED message: HTTP Method 'POST' not allowed. Allowed are HEAD,GET".
Please help me in registering web hook between twitter and salesforce.
-
- mahesh p 12
- March 19, 2020
- Like
- 0
How to attach uploaded documents to respective custom object record Id
Verification.cmp
<aura:component controller="VerificationFilesController" Implements="flexipage:availableForRecordHome,force:hasRecordId,force:appHostable,flexipage:availableForAllPageTypes,force:lightningQuickAction, forceCommunity:availableForAllPageTypes" access="global" >
<aura:method name="CustomerDetailsValidation" action="{!c.VerificationValidation}" access="public">
<aura:attribute name="isValidated" type="boolean" />
</aura:method>
<!--aura:attribute name="opportunity" type="Opportunity" default="{'sobjectType': 'Opportunity'}" access="private"/-->
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:handler event="force:refreshView" action="{!c.doInit}" />
<aura:attribute name="recordError" type="String" access="private"/>
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="FileList" type="Object[]"/>
<aura:attribute name="DocItemList" type="List" />
<aura:attribute name="DocItemList1" type="List" />
<aura:attribute name="documentType" type="String"/>
<aura:attribute name="isOpen" type="boolean" default="false"/>
<aura:attribute name="showSpinner" type="boolean" default="false"/>
<aura:attribute name="pictureSrc" type="String"
default="https://s3-us-west-1.amazonaws.com/sfdc-demo/image-placeholder.png"/>
<!--aura:attribute name="parentId" type="Id"/-->
<aura:handler event="aura:systemError" action="{!c.showSystemError}"/>
<aura:attribute name="stageName" type="String" default=""/>
<div class="slds-box slds-theme--shade slds-scrollable_x slds-size_1-of-1">
<div class="slds-p-bottom_small">
<div class="slds-page-header ">
<div class="slds-media">
<div class="slds-media__figure">
<lightning:icon iconName="standard:file" size="small" alternativeText="file uploaded"/>
</div>
<div class="slds-media__body">
<h1 class="slds-page-header__title" title="e-KYC">Documents Summary</h1>
</div>
</div>
</div>
</div>
<div>
<!--img src="{!v.pictureSrc}"/>
<button aura:id="viewImg" onclick="{!c.loadImage}" type="button">view Image</button-->
</div>
<table class="slds-table slds-table_bordered">
<thead>
<tr class="slds-text-heading--label">
<!--th scope="col"><div class="slds-truncate" title="Select Schemas">Choose Scheme</div></th-->
<th scope="col"><div class="slds-truncate" title="Document">Document</div></th>
<th scope="col"><div class="slds-truncate" title="Uploaded">Uploaded</div></th>
<th scope="col"><div class="slds-truncate" title="Approved">Approved</div></th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.DocItemList}" var="doc">
<tr>
<td>
<div class="slds-truncate slds-clearfix" name="Role" title="{!doc.docDesc}">
<aura:if isTrue="{!doc.mandatory}">
<div class="slds-float_left">
<p style="color:red;">*</p>
</div>
</aura:if>
<div class="slds-float_none">
<p>{!doc.docDesc}</p></div>
</div>
</td>
<td class="slds-media__figure">
<aura:if isTrue="{!doc.uploaded}">
<div class="slds-media slds-media_center slds-has-flexi-truncate">
<lightning:icon iconName="action:approval" size="xx-small" />
</div>
<!--aura:set attribute="else">
<lightning:icon iconName="action:upload" size="xx-small" alternativeText="file Not uploaded yet"/>
</aura:set-->
</aura:if>
</td>
<td>
<!--aura:if isTrue="{!doc.reviewed}">
<div>
<aura:if isTrue="{!doc.approved}">
<div class="slds-media slds-media_center slds-has-flexi-truncate">
<lightning:icon iconName="action:approval" size="xx-small" />
</div>
<aura:set attribute="else">
<div class="slds-media slds-media_center slds-has-flexi-truncate">
<lightning:icon iconName="action:close" size="xx-small" alternativeText="Document Rejected"/>
</div>
</aura:set>
</aura:if>
</div>
</aura:if-->
<aura:if isTrue="{!and(equals(doc.approvedOrNot,'yes'),doc.reviewed)}">
<div>
<lightning:icon iconName="action:approval" size="xx-small" />
</div>
</aura:if>
<aura:if isTrue="{!and(equals(doc.approvedOrNot,'no'),doc.reviewed)}">
<div>
<lightning:icon iconName="action:close" size="xx-small" alternativeText="Document Rejected"/>
</div>
</aura:if>
<aura:if isTrue="{!and(equals(doc.approvedOrNot,'empty'),doc.reviewed)}">
<div>
</div>
</aura:if>
</td>
</tr>
</aura:iteration>
<!--aura:iteration items="{!v.DocItemList1}" var="doc1">
<tr>
<td>
{!doc1.pankaj2016__Document_Name__c}
</td>
<td>
</td>
<td>
</td>
</tr>
</aura:iteration-->
</tbody>
</table>
<div class="slds-col slds-size_1-of-1 slds-large-size_1-of-2 slds-p-around_x-small">
<lightning:input aura:id="uploadedDocument" type="file" label="Upload Document for Verification" name="file"
onchange="{!c.openModal}"></lightning:input>
</div>
<div class="slds-col slds-size_1-of-1 slds-large-size_1-of-2 slds-p-around_x-small">
<c:CameraComponent myRecordId="{!v.recordId}" />
</div>
</div>
<aura:if isTrue="{!v.isOpen}">
<!--###### MODAL BOX Start From Here ######-->
<div role="dialog" tabindex="-1" aria-labelledby="header99" class="slds-modal slds-fade-in-open ">
<div class="slds-modal__container">
<!-- ###### MODAL BOX HEADER Part Start From Here ######-->
<div class="slds-modal__header">
<button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.closeModel}">
X
<span class="slds-assistive-text">Close</span>
</button>
<h2 id="header99" class="slds-text-heading--medium">Select Document Type</h2>
</div>
<!--###### MODAL BOX BODY Part Start From Here ######-->
<div class="slds-modal__content slds-p-around--medium slds-is-relative">
<aura:if isTrue="{!v.showSpinner}">
<div class="demo-only" style="height:6rem;">
<div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
</div>
<aura:set attribute="else">
<div class="slds-form-element__control">
<ui:inputSelect class="single" aura:id="selectDocType" change="{!c.handleFilesChange}">
<ui:inputSelectOption text="Choose one.." value=""/>
<aura:iteration items="{!v.DocItemList[0].docTypeList}" var="docType">
<ui:inputSelectOption text="{!docType}" label="{!docType}"/>
</aura:iteration>
</ui:inputSelect>
</div>
</aura:set>
</aura:if>
<div class="slds-form-element">
</div>
</div>
<!--###### MODAL BOX FOOTER Part Start From Here ######-->
<div class="slds-modal__footer">
<button class="slds-button slds-button--neutral" onclick="{!c.closeModal}" >Cancel</button>
</div>
</div>
</div>
<div class="slds-backdrop slds-backdrop--open"></div>
<!--###### MODAL BOX Part END Here ######-->
</aura:if>
</aura:component>
VerificationFilesController.apxc
public class VerificationFilesController {
Public attachment objAttachment{get; set;}
static List<String> docTypes = new List<String> { 'ID Proof', 'Bank Statements', 'Nationality Proof', 'Driver License' };
// Public Verification_Documents__c objVerificationFiles{get; set;}
Public VerificationFilesController(apexpages.standardcontroller stdCon){
objAttachment = new Attachment();
// objVerificationFiles = new Verification_Documents__c();
}
Public static List<String> getdocumentTypes(String oppId){
List<String> fileList = new List<String>();
System.debug('opp id for record type is ==== '+oppId);
//List<Opportunity> opplist=[select RecordType.Name from Opportunity where Id=:oppId];
//string recTypeId=opplist.get(0).RecordType.Name;
Boolean flag=false;
for(TypeWiseDocument__c documentDesc: [Select Document_Name__c
from TypeWiseDocument__c ]){
fileList.add(documentDesc.Document_Name__c);
}
return fileList;
}
@AuraEnabled
Public static List<DocumentItem> getVerificationFiles1(String oppId){
// List<String> fileList = getdocumentTypes(oppId);
List<String> fileList = new List<String>();
Map<String,Boolean> mapMandatory=new Map<String,Boolean>();
System.debug('opp id for record type is ==== '+oppId);
//List<Opportunity> opplist=[select RecordType.Name from Opportunity where Id=:oppId];
//System.debug('opplist size ==== '+opplist.size());
//string recTypeId=opplist.get(0).RecordType.Name;
//System.debug('Opportunity Record Type ==== '+recTypeId);
Boolean flag=false;
for(TypeWiseDocument__c documentDesc: [Select Document_Name__c, Mandatory__c
from TypeWiseDocument__c ]){
fileList.add(documentDesc.Document_Name__c);
mapMandatory.put(documentDesc.Document_Name__c,
documentDesc.Mandatory__c);
}
List<DocumentItem> docItems = new List<DocumentItem>();
Map<String,Verification_Documents__c> MapAttchmentByType=new
Map<String,Verification_Documents__c>();
for(Verification_Documents__c attch:[select Id, Name, docType__c,
Reviewed__c, Approved__c,
AttachmentId__c, Comment__c
from Verification_Documents__c
where Opportunity__r.Id = :oppId]){
MapAttchmentByType.put(attch.docType__c, attch);
}
system.debug('MapAttchmentByType-->'+MapAttchmentByType);
List<DocumentItem> manDocItems = new List<DocumentItem>();
List<DocumentItem> nonManDocItems = new List<DocumentItem>();
for(String docuType:fileList){
DocumentItem doc = new DocumentItem();
/*
if(mapMandatory.get(docuType)==true){
doc.mandatory = true;
} else {
doc.mandatory = false;
}
*/
if(MapAttchmentByType.get(docuType)!=null){
doc.uploaded = true;
Verification_Documents__c existingAttchment = MapAttchmentByType.get
(docuType);
doc.docName = existingAttchment.Name;
doc.reviewed = existingAttchment.Reviewed__c;
doc.attId = existingAttchment.AttachmentId__c;
doc.comment = existingAttchment.Comment__c;
doc.approved = existingAttchment.Approved__c;
System.debug('existingAttchment.Approved__c --> ' + existingAttchment.Approved__c);
if(existingAttchment.Approved__c)
{
doc.approvedOrNot = 'yes';
} else {
doc.approvedOrNot = 'no';
}
doc.docDesc = docuType;
doc.docTypeList = fileList;
}else{
doc.approvedOrNot = 'empty';
doc.uploaded = false;
doc.docDesc = docuType;
doc.reviewed = false;
doc.docTypeList = fileList;
}
if(mapMandatory.get(docuType)==true){
doc.mandatory = true;
manDocItems.add(doc);
} else {
doc.mandatory = false;
nonManDocItems.add(doc);
}
// docItems.add(doc);
}
docItems.addAll(manDocItems);
docItems.addAll(nonManDocItems);
return docItems ;
}
@AuraEnabled
Public static List<DocumentItem> getVerificationFiles(String oppId){
List<DocumentItem> docItems = new List<DocumentItem>();
Map<String,Verification_Documents__c> MapAttchmentByType=new
Map<String,Verification_Documents__c>();
for(Verification_Documents__c attch:[select Id, Name, docType__c,
Reviewed__c, Approved__c,
AttachmentId__c, Comment__c
from Verification_Documents__c
where Opportunity__r.Id = :oppId]){
MapAttchmentByType.put(attch.docType__c, attch);
}
system.debug('MapAttchmentByType-->'+MapAttchmentByType);
for(String docuType:docTypes){
DocumentItem doc = new DocumentItem();
if(MapAttchmentByType.get(docuType)!=null){
doc.uploaded = true;
Verification_Documents__c existingAttchment = MapAttchmentByType.get
(docuType);
doc.docName = existingAttchment.Name;
doc.reviewed = existingAttchment.Reviewed__c;
doc.attId = existingAttchment.AttachmentId__c;
doc.comment = existingAttchment.Comment__c;
doc.approved = existingAttchment.Approved__c;
doc.docDesc = docuType;
}else{
doc.uploaded = false;
doc.docDesc = docuType;
doc.reviewed = false;
}
docItems.add(doc);
}
return docItems;
}
@AuraEnabled
public static Id saveTheFile(Id parentId, String fileName, String description,
String base64Data, String contentType) {
//insert & upsert logic
System.debug('##########################Into FILE SAVING****************');
System.debug(parentId+' '+fileName);
System.debug(description+' '+contentType);
long t1 = DateTime.Now().getTime();
List<String> fileList = getdocumentTypes(parentId);
System.debug('fileList >> '+fileList);
boolean reset = false;
Map<String,Verification_Documents__c> MapAttchmentByType=new
Map<String,Verification_Documents__c>();
for(Verification_Documents__c attch:[select Id, Name, Reviewed__c,
docType__c
from Verification_Documents__c
where Opportunity__r.Id = :parentId]){
MapAttchmentByType.put(attch.docType__c, attch);
}
system.debug('MapAttchmentByType >> '+MapAttchmentByType);
Verification_Documents__c associatedVd = new Verification_Documents__c();
boolean deleteAtt = false;
for(String docuType:fileList){
system.debug('MapAttchmentByType docuType '+MapAttchmentByType.get(docuType));
system.debug('description '+description);
if(MapAttchmentByType.get(docuType)!=null && MapAttchmentByType.get
(docuType).docType__c == description){
system.debug('Attachment Id--> '+MapAttchmentByType.get(docuType).Id);
associatedVd = MapAttchmentByType.get(docuType);
Attachment existingAttchment = [SELECT Id from Attachment WHERE ParentId
= :associatedVd.Id];
system.debug('existingAttchment Id '+existingAttchment.Id);
system.debug('associatedVd Id '+associatedVd.Id);
associatedVd.Reviewed__c = false;
associatedVd.Approved__c = false;
delete existingAttchment;
deleteAtt = true;
break;
}
/*
if(MapAttchmentByType.get(docuType)!=null && MapAttchmentByType.get
(docuType).docType__c == description){
system.debug('Attachment Id--> '+MapAttchmentByType.get(docuType).Id);
associatedVd = MapAttchmentByType.get(docuType);
Attachment existingAttchment = [SELECT Id from Attachment WHERE ParentId
= :associatedVd.Id];
system.debug('existingAttchment Id '+existingAttchment.Id);
system.debug('associatedVd Id '+associatedVd.Id);
associatedVd.Reviewed__c = false;
associatedVd.Approved__c = false;
delete existingAttchment;
break;
}else{
associatedVd = new Verification_Documents__c();
associatedVd.Reviewed__c = false;
associatedVd.Name = fileName;
associatedVd.docType__c = description;
associatedVd.Opportunity__c = parentId;
insert associatedVd;
break;
}*/
}
if(!deleteAtt){
associatedVd = new Verification_Documents__c();
associatedVd.Reviewed__c = false;
associatedVd.Name = fileName;
associatedVd.docType__c = description;
associatedVd.Opportunity__c = parentId;
associatedVd.Document_Master__c = 'a016C0000017veSQAQ';
insert associatedVd;
system.debug('associatedVd '+associatedVd.Id);
}
associatedVd.Name = fileName;
System.debug(DateTime.Now().getTime()-t1);
long t2 = DateTime.Now().getTime();
base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8');
Attachment a = new Attachment();
a.parentId = associatedVd.Id;
a.Body = EncodingUtil.base64Decode(base64Data);
a.Name = fileName;
a.ContentType = contentType;
a.Description = description;
insert a;
associatedVd.AttachmentId__c = a.Id;
update associatedVd;
system.debug('AttachmentId: '+a.Id);
System.debug(DateTime.Now().getTime()-t2);
for(Verification_Documents__c attch:[select Id, Name, Approved__c, Reviewed__c
from Verification_Documents__c
where Opportunity__r.Id = :parentId]){
if(!attch.Approved__c && attch.Reviewed__c){
reset = true;
break;
}
}
if(!reset){
Opportunity oppRec = new Opportunity();
oppRec.Id = parentId;
oppRec.Stage_Reset__c=false;
update oppRec;
}
return a.Id;
}
@AuraEnabled
public static void approveTheDoc(String approval, Id attachId, String comment, String oppId) {
//insert & upsert logic
Boolean approvalVal;
if(approval=='approve'){
approvalVal = true;
} else if(approval == 'reject') {
approvalVal = false;
}
Attachment att = [select Id, ParentId from Attachment where Id = :attachId];
Verification_Documents__c associatedVd = [select Id from
Verification_Documents__c where Id = :att.ParentId];
associatedVd.Reviewed__c = true;
associatedVd.Approved__c = approvalVal;
if(comment!=null || comment!=''){
associatedVd.Comment__c = comment;
}
update associatedVd;
//code to reset missing flag for blocking the missing popup
Opportunity oppRec = new Opportunity();
oppRec.Id = oppId;
oppRec.Missing_Mandatory_Documents__c = false;
update oppRec;
}
public class DocumentItem{
@AuraEnabled public String docId {set;get;}
@AuraEnabled public Boolean uploaded {set;get;}
@AuraEnabled public Boolean reviewed {set;get;}
@AuraEnabled public Boolean approved {set;get;}
@AuraEnabled public String docDesc {set;get;}
@AuraEnabled public String docName {set;get;}
@AuraEnabled public String attId {set;get;}
@AuraEnabled public String comment {set;get;}
@AuraEnabled public Boolean mandatory {set;get;}
@AuraEnabled public String approvedOrNot {set;get;}
@AuraEnabled public List<String> docTypeList {set;get;}
}
}
I have two custom objects Document master whose api name is TypeWiseDocument__c and verification documents api name is Verification_Documents__c.These two custom objects have master-detail relationship.In my apex class i am hardcoding id to which the documents are getting attached under document master of verification documents.How can i attach respective uploaded documents to respective document master ids of verification documents related list-
- mahesh p 12
- February 01, 2019
- Like
- 0
how to apply standard path styling in lightning
<aura:component controller="TestStagesController" implements="force:hasRecordId,force:lightningQuickAction,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,forceCommunity:availableForAllPageTypes" access="global" >
<aura:dependency resource="markup://force:showToast" type="EVENT" />
<aura:handler event="force:showToast" action="{!c.doInit}" />
<aura:handler event="force:refreshView" action="{!c.doInit}" />
<aura:attribute name="opportunity" type="Opportunity"/>
<aura:attribute name="opportunityRec" type="Object"/>
<aura:attribute name="selectedPricebookId" type="String"/>
<aura:attribute name="pName" type="String"/>
<aura:attribute name="checkProfile" type="boolean" default="true"/>
<aura:attribute name="recordId" type="string"/>
<aura:attribute name="showOppCmps" type="boolean" default="false"/>
<aura:attribute name="oppRec" type="object"/>
<aura:attribute name="stageName" type="string"/>
<!-- for mobile community users -->
<aura:attribute name="nextStageName" type="string" default=""/>
<aura:attribute name="prevStageName" type="string" default=""/>
<!-- for mobile community users end -->
<aura:attribute name="stageIcon" type="string"/>
<aura:attribute name="iconClass" type="string"/>
<aura:attribute name="firstStageName" type="string"/>
<aura:attribute name="lastStageName" type="string"/>
<aura:attribute name="oppStages" type="list"/>
<aura:attribute name="record" type="Object"/>
<aura:attribute name="recordError" type="String"/>
<aura:attribute name="contactId" type="string"/>
<aura:attribute name="accountId" type="string"/>
<aura:attribute name="recodName" type="string"/>
<aura:attribute name="reason" type="string"/>
<aura:attribute name="recordType" type="string" default=""/>
<aura:attribute name="sendToLabel" type="string" default="Send To OPS"/>
<aura:attribute name="aname" type="string"/>
<aura:attribute name="isSuccess" type="boolean" default="false"/>
<aura:attribute name="resetStage" type="boolean" default="false"/>
<aura:attribute name="missedFlag" type="boolean" default="false"/>
<aura:attribute name="breakLoop" type="boolean" default="false"/>
<aura:attribute name="loopId" type="Integer" default="0"/>
<aura:attribute name="startTime" type="Integer" default="0"/>
<aura:attribute name="endTime" type="Integer" default="0"/>
<aura:attribute name="isDisplayDetail" type="boolean" default="false"/>
<aura:attribute name="isDisplayBox" type="boolean" default="false"/>
<aura:attribute name="isDisplayHeader" type="boolean" default="true"/>
<aura:attribute name="valueChanged" type="Integer" default="0"/>
<!-- SeperateBlock -->
<!--<aura:attribute name="oppStages" type="list"/>-->
<!--<aura:attribute name="stageName" type="String"/>-->
<aura:attribute name="tempstageName" type="String"/>
<aura:attribute name="oppStagesProb" type="Map"/>
<!--<aura:attribute name="oppRec" type="object"/>-->
<aura:attribute name="problty" type="Integer" />
<aura:attribute name="customers" type="List" />
<!--<aura:attribute name="showOppCmps" type="boolean" default="false"/>-->
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:if isTrue="{!$Browser.formFactor == 'DESKTOP'}">
<!--<lightning:icon iconName="utility:desktop" size="x-small" alternativeText="Indicates approval"/> -->
<!--<div id="stages" style="pointer-events: auto;">--><!--width:460px;-->
<aura:if isTrue="{!v.showOppCmps}">
<article class="slds-card">
<div class="slds-grid slds-path slds-is-expanded">
<div class="slds-grid slds-path__track">
<div class="slds-grid slds-path__scroller-container">
<div class="slds-path__scroller" role="application">
<div class="slds-path__scroller_inner">
<ul class="slds-region_small slds-path__nav" role="listbox" aria-orientation="horizontal" ><!--style="width:240px;"-->
<aura:iteration items="{!v.customers}" var="cus" indexVar="key">
<aura:if isTrue="{!and(cus.value!=v.stageName,lessthan(cus.key,v.problty))}">
<li onclick="{!c.handleStage}" data-variablename="{!cus.value}" aura:id="{!cus.value}" class="{!cus.value + ' slds-path__item slds-is-complete'}" role="presentation" id="{!cus.value}">
<a data-variablename="{!cus.value}" aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="{!cus.value}" role="option" tabindex="0">
<span class="slds-path__stage">
<lightning:icon iconName="utility:check" size="x-small" variant="inverse" />
<!--<span class="slds-assistive-text">Current Stage:</span>-->
</span>
<span class="slds-path__title">{!cus.value}</span>
</a>
</li>
</aura:if>
<!-- </aura:iteration>
<aura:iteration items="{!v.customers}" var="cus" indexVar="key"> -->
<aura:if isTrue="{!and(cus.value==v.stageName,cus.key==v.problty)}">
<li onclick="{!c.handleStage}" data-variablename="{!cus.value}" aura:id="{!cus.value}" class="{!cus.value + ' slds-path__item slds-is-current slds-is-active'}" role="presentation" id="{!cus.value}">
<a data-variablename="{!cus.value}" aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="{!cus.value}" role="option" tabindex="0">
<span class="slds-path__stage">
<lightning:icon iconName="utility:check" size="x-small" variant="inverse"/>
<!--<span class="slds-assistive-text">Current Stage:</span>-->
</span>
<span class="slds-path__title">{!cus.value}</span>
</a>
</li>
</aura:if>
<aura:if isTrue="{!and(cus.value!=v.stageName,greaterthan(cus.key,v.problty))}">
<li onclick="{!c.handleStage}" data-variablename="{!cus.value}" aura:id="{!cus.value}" class="{!cus.value + ' slds-path__item slds-is-incomplete'}" role="presentation" id="{!cus.value}">
<a data-variablename="{!cus.value}" aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="{!cus.value}" role="option" tabindex="0">
<span class="slds-path__stage">
<lightning:icon iconName="utility:check" size="x-small" variant="inverse"/>
<!--<span class="slds-assistive-text">Current Stage:</span>-->
</span>
<span class="slds-path__title">{!cus.value}</span>
</a>
</li>
</aura:if>
</aura:iteration>
</ul>
</div>
</div>
</div>
</div>
</div>
</article>
</aura:if>
<!--</div>-->
</aura:if>
<lightning:spinner aura:id="mySpinner" variant="brand" size="large" class="slds-hide" />
<!--aura:handler name="change" value="{!v.valueChanged}" action="{!c.valueChangeHappened}"/-->
<aura:attribute name="isOpen" type="boolean" default="false"/>
<aura:handler name="setValue" event="c:setValueChangeEvent" action="{!c.setValueChange}"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
</aura:component>
({
handleStage: function(component,event,helper){
var selectedItem = event.currentTarget;
var yourValueOnclick= selectedItem.dataset.variablename;
var tempArray=[];
tempArray=component.get("v.oppStages");
alert('****'+yourValueOnclick);
component.set("v.firstStageName",tempArray[0]);
alert(component.get("v.firstStageName"));
component.set("v.lastStageName",tempArray[tempArray.length - 1]);
alert(component.get("v.lastStageName"));
var tempIndex = tempArray.indexOf(1);//response.getReturnValue().StageName
alert("-----------------"+tempIndex);
if( tempIndex != tempArray.length){
$A.util.removeClass(selectedItem, 'slds-is-complete');
$A.util.addClass(selectedItem, 'slds-is-current');
component.set("v.nextStageName",tempArray[tempIndex + 1]);
}
if( tempIndex != 0){
$A.util.removeClass(selectedItem, 'slds-is-complete');
$A.util.addClass(selectedItem, 'slds-is-current');
component.set("v.prevStageName",tempArray[tempIndex - 1]);
}
},
})
When i click on any stage it should have 'slds-is-current' styling and the present current stage should have white color in which stage name should get displayed.Can I get the exact styling as standard path in salesforce using my code.Any help is greatly appreciated.
-
- mahesh p 12
- December 05, 2018
- Like
- 0
can i hide stage values in opportunity path after reaching to a particular stage
When i reach to verification stage all the stages after verification should disappear is that possible?
-
- mahesh p 12
- November 29, 2018
- Like
- 0
Salesforce Twitter - Non-200 response code during CRC GET request (i.e. 404, 500, etc)
I have created a Apex Rest Service and enabled the Respective Apex Class under Public Access settings of a Remote site.When i hit this API of twitter with OAuth1 Authorisation
https://api.twitter.com/1.1/account_activity/all/:ENV_NAME/webhooks.json?url=https://{Salesforce_Domain}.com/services/apexrest/{urlMapping}
I am getting the below Error Response
"Non-200 response code during CRC GET request (i.e. 404, 500, etc)"
and i m getting this error while using apex REST services
"METHOD_NOT_ALLOWED errorCode: METHOD_NOT_ALLOWED message: HTTP Method 'POST' not allowed. Allowed are HEAD,GET".
Please help me in registering web hook between twitter and salesforce.
https://api.twitter.com/1.1/account_activity/all/:ENV_NAME/webhooks.json?url=https://{Salesforce_Domain}.com/services/apexrest/{urlMapping}
I am getting the below Error Response
"Non-200 response code during CRC GET request (i.e. 404, 500, etc)"
and i m getting this error while using apex REST services
"METHOD_NOT_ALLOWED errorCode: METHOD_NOT_ALLOWED message: HTTP Method 'POST' not allowed. Allowed are HEAD,GET".
Please help me in registering web hook between twitter and salesforce.

- mahesh p 12
- March 19, 2020
- Like
- 0