-
ChatterFeed
-
3Best Answers
-
1Likes Received
-
0Likes Given
-
6Questions
-
31Replies
How display list attachments of Custom object
I am creating a Lightning component to display the list of attachments related to registering a custom object. Could check where I am going wrong, because nothing is displayed.
AttachmentList.cmp --------------------------------------------------------------------------------- <aura:component implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" controller="AttachmentListController"> <aura:attribute name="recordId" type="Id" required="true"/> <aura:attribute name="files" type="List"/> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <span class="text-blue"> <!-- <aura:iteration items="{!v.record.Attachments}" var="obj"> --> <aura:iteration items="{!v.files}" var="obj"> {!obj.Title} <br/> </aura:iteration> </span> </aura:component>
AttachmentListcontroller.js -------------------------------------------------------------------------------------------------- ({ doInit : function(component, event, helper) { $A.enqueueAction(component.get('c.getList')); }, getList: function(component, event, helper) { var action = component.get("c.getContentDocs"); action.setParams( { arecordId : component.get('v.recordId') }); action.setCallback(this, function(actionResult) { component.set('v.files',actionResult.getReturnValue()); }); $A.enqueueAction(action); }, })
AttachmentListController.apxc ------------------------------------------------------------------------------------------------------------ public class AttachmentListController { @AuraEnabled public static List<ContentDocument> getContentDocs(Id arecordId) { List<ContentDocumentLink> CDLs = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :arecordId]; //List<ContentDocumentLink> CDLs = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :'a08M000000BuU4vIAF']; if (CDLs.size() < 1) return new List<ContentDocument>(); // Make a List of ContentDocument IDs List <Id> CDIdList = new List <Id> (); for (ContentDocumentLink nextCDL : CDLs) { CDIdList.add(nextCDL.ContentDocumentId); } List<ContentDocument> entries = [SELECT Id, Title, FileType FROM ContentDocument WHERE ContentDocument.Id IN :CDIdList]; return entries; } }
Thanks
-
- Luciano Roberto
- July 24, 2019
- Like
- 0
- Continue reading or reply
expected boolean and received text
If anything but a check box, I am good. However, the checkboxes I can not get to work.
CODE=
FieldA is a Boolean field
IF( OR(
ISNEW(),
AND(
FieldA = TRUE,
PRIORVALUE(FieldA) = FALSE
)
),
"TRUE",
IF( OR(
ISNEW(),
AND(
[FieldA = FALSE,
PRIORVALUE(FieldA) = TRUE
)
),
"FALSE", FieldA))
ERROR:
The formula expression is invalid: Incorrect parameter type for function 'IF()'. Expected Text, received Boolean
-
- Leonard Silon 16
- June 13, 2019
- Like
- 0
- Continue reading or reply
execution of AfterUpdate caused by: System.TypeException: Invalid id value for this SObject type:
I am trying to create orderitems from OpportunityLine items and also creating order on Opportunity. But I am getting the following error
Error: execution of AfterUpdate caused by: System.TypeException: Invalid id value for this SObject type: 00kq0000008mWXjAAM: Class.Autocreation .CreatingOrders:
at this particular line [ordr1.Id = oli.Id;]
Which Id needs to be take, I don't understand Can anyone help me.Thanks inadvance
public static void CreatingOrders(List<Opportunity> newlist){
set<Id> oppId = new set<Id>();
for(Opportunity opp : newList){
oppId.add(opp.id); //Adding Opportunity's to Set.
}
List<Opportunity> oppList = [select id,name,StageName,Accountid, (select Status,Account.name,enddate from Orders)
from Opportunity where Id =: oppId];
List<OpportunityLineItem> oppList1 = [SELECT id,Quantity,Product2Id,
UnitPrice,Description, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family,
OpportunityId FROM OpportunityLineItem where OpportunityId =: oppId];
List<Order> insrtordrs = new List<Order>();
List<OrderItem> insrtordrs1 = new List<OrderItem>();
for(Opportunity opp1 : oppList){
for(OpportunityLineItem oli : oppList1 ){
if (opp1.Orders.size()>0){
system.debug('Orders exists*******************' +opp1.Orders);
}
else if(opp1.StageName == 'Closed-Won') {
Order ordr =new Order();
ordr.AccountId = opp1.AccountId;
ordr.OpportunityId = opp1.id;
ordr.Status = 'Draft';
ordr.EffectiveDate = system.today();
//ordr.ContractId = opp1.ContractId;
insrtordrs .add(ordr);
OrderItem ordr1 =new OrderItem();
ordr1.Id = oli.Id;
ordr1.PricebookEntryId = oli.PricebookEntryId;
ordr1.UnitPrice = oli.UnitPrice;
ordr1.Description = oli.Description;
ordr1.Quantity = oli.Quantity;
insrtordrs1 .add(ordr1);
}
}
}
insert insrtordrs ;
insert insrtordrs1 ;
}
-
- si ri
- June 04, 2019
- Like
- 0
- Continue reading or reply
I am using force:editRecord, after saving record, record is saved but page is not redirecting to record
var editRecordEvent = $A.get("e.force:editRecord"); editRecordEvent.setParams({ "recordId": conRecord.Id, "nooverride":"1" }); editRecordEvent.fire();
Using this my record is saved but page stucked on blank screen, i want to redirect it to record detail page.
please help on this.
-
- Arun Parmar
- November 28, 2019
- Like
- 0
- Continue reading or reply
Create profile for Deployment USer
i.e. If a user have this profile than user can perform deployment operations else not.
How to achieve this.?
-
- Arun Parmar
- September 20, 2019
- Like
- 0
- Continue reading or reply
Add button in design attribute - lighnting web component
If its not possible thn any other way to implement multiselect picklist in desing attribute in LWC.
-
- Arun Parmar
- September 04, 2019
- Like
- 0
- Continue reading or reply
Restrict Salesforce global search with some custom objects
-
- Arun Parmar
- July 29, 2019
- Like
- 0
- Continue reading or reply
You must send visualforce templates to either a Contact or a Lead.
-
- Arun Parmar
- July 08, 2019
- Like
- 0
- Continue reading or reply
Unable to view my trailhead badges on Partner community.
Please help on this.
-
- Arun Parmar
- June 13, 2019
- Like
- 1
- Continue reading or reply
Unable to view my trailhead badges on Partner community.
Please help on this.
-
- Arun Parmar
- June 13, 2019
- Like
- 1
- Continue reading or reply
Create profile for Deployment USer
i.e. If a user have this profile than user can perform deployment operations else not.
How to achieve this.?
- Arun Parmar
- September 20, 2019
- Like
- 0
- Continue reading or reply
Case RelatedList
Only a maximum of 4 are seen?
- Edgar Pastor
- September 10, 2019
- Like
- 0
- Continue reading or reply
how to restore a lightning component from backup into Salesforce org?
I took back up of lightning AURA components from Salesforce org. I have the zip file containing those AURA components.
The AURA components have been purged from the recycle bin. How do I restore the AURA component back into Salesforce org?
Many Thanks in advance for all your help and support1
- John Manager Training Dep
- September 09, 2019
- Like
- 0
- Continue reading or reply
Fixing Code Coverage on Apex Trigger
I am trying to deploy this apex trigger from sandbox to production but keep getting this error:
Your organization's code coverage is 74%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.
I'm wondering what would be the best way to increase the code coverage with my trigger below. This trigger is used with Dropbox. Any help would be so appreciated!
trigger Dropbox_Trigger_Vendor on Vendor__c (after update, after delete) { if(Trigger.isAfter && Trigger.isUpdate){ Dropbox_for_SF.HandleRecordChange.OnRecordChange(Trigger.old, Trigger.new); } if(Trigger.isAfter && Trigger.isDelete){ Dropbox_for_SF.HandleRecordChange.HandleMerge(Trigger.old); } }
- Sam Epstein
- July 24, 2019
- Like
- 0
- Continue reading or reply
How display list attachments of Custom object
I am creating a Lightning component to display the list of attachments related to registering a custom object. Could check where I am going wrong, because nothing is displayed.
AttachmentList.cmp --------------------------------------------------------------------------------- <aura:component implements="forceCommunity:availableForAllPageTypes,force:hasRecordId" access="global" controller="AttachmentListController"> <aura:attribute name="recordId" type="Id" required="true"/> <aura:attribute name="files" type="List"/> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <span class="text-blue"> <!-- <aura:iteration items="{!v.record.Attachments}" var="obj"> --> <aura:iteration items="{!v.files}" var="obj"> {!obj.Title} <br/> </aura:iteration> </span> </aura:component>
AttachmentListcontroller.js -------------------------------------------------------------------------------------------------- ({ doInit : function(component, event, helper) { $A.enqueueAction(component.get('c.getList')); }, getList: function(component, event, helper) { var action = component.get("c.getContentDocs"); action.setParams( { arecordId : component.get('v.recordId') }); action.setCallback(this, function(actionResult) { component.set('v.files',actionResult.getReturnValue()); }); $A.enqueueAction(action); }, })
AttachmentListController.apxc ------------------------------------------------------------------------------------------------------------ public class AttachmentListController { @AuraEnabled public static List<ContentDocument> getContentDocs(Id arecordId) { List<ContentDocumentLink> CDLs = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :arecordId]; //List<ContentDocumentLink> CDLs = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :'a08M000000BuU4vIAF']; if (CDLs.size() < 1) return new List<ContentDocument>(); // Make a List of ContentDocument IDs List <Id> CDIdList = new List <Id> (); for (ContentDocumentLink nextCDL : CDLs) { CDIdList.add(nextCDL.ContentDocumentId); } List<ContentDocument> entries = [SELECT Id, Title, FileType FROM ContentDocument WHERE ContentDocument.Id IN :CDIdList]; return entries; } }
Thanks
- Luciano Roberto
- July 24, 2019
- Like
- 0
- Continue reading or reply
expected boolean and received text
If anything but a check box, I am good. However, the checkboxes I can not get to work.
CODE=
FieldA is a Boolean field
IF( OR(
ISNEW(),
AND(
FieldA = TRUE,
PRIORVALUE(FieldA) = FALSE
)
),
"TRUE",
IF( OR(
ISNEW(),
AND(
[FieldA = FALSE,
PRIORVALUE(FieldA) = TRUE
)
),
"FALSE", FieldA))
ERROR:
The formula expression is invalid: Incorrect parameter type for function 'IF()'. Expected Text, received Boolean
- Leonard Silon 16
- June 13, 2019
- Like
- 0
- Continue reading or reply
Good Afternoon!!
I don't really know how to crack this. Please help me with the inputs.
- kavya M 28
- June 13, 2019
- Like
- 0
- Continue reading or reply
Issue about use Lightning Design System in visualforce page.
I am stucking in use Rich Text Editor of SLDS https://lightningdesignsystem.com/components/rich-text-editor/#site-main-content, I has completed design experience but I can't click the buttons for action bold, Italic, underline.v.v. Do I have to handle all of button by javascript?
Thanks
- Xuan Tung
- June 13, 2019
- Like
- 0
- Continue reading or reply
Flexipage - LWC with no header
<?xml version="1.0" encoding="UTF-8"?> <FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata"> <flexiPageRegions> <componentInstances> <componentName>myComponent</componentName> </componentInstances> <name>main</name> <type>Region</type> </flexiPageRegions> <masterLabel>Something</masterLabel> <template> <name>flexipage:defaultAppHomeTemplate</name> </template> <type>AppPage</type> </FlexiPage>
I have then set the App Page as a tab for my App.
When my flexipage is rendered, there is a default header with my tab icon and tab name rendered in the UI.
How can i hide that header so that the only thing rendered is my flexipage LWC component?
- Alex Z 16
- June 13, 2019
- Like
- 0
- Continue reading or reply
Quick Save not saving. Visualforce /Apex (Simple example)
My goal is to have the ability to modify data on the Revenue_Amount__c without leaving the Opportunity screen.
To this end I have created a Visualforce page and an Apex class.
The VF:
<apex:page standardController="Opportunity" extensions="OpportunityActualList" sidebar="false" showHeader="false"> <apex:form > <apex:pageBlock > <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="QuickSave" action="{!quicksave}"/> <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockButtons> <input id="theHiddenInput" type="hidden" name="{!Opportunity.Name}" /> <apex:outputPanel layout="block" style="overflow:auto;width:600px;height:606px" > <apex:pageBlockTable value="{!amounts}" var="x" id="list"> <apex:column headerValue="Id"> <apex:inputField value="{!x.Id}"/> </apex:column> <apex:column headerValue="Type"> <apex:inputField value="{!x.Type__c}"/> </apex:column> <apex:column headerValue="Date"> <apex:inputField value="{!x.Fiscal_Date__c}"/> </apex:column> <apex:column headerValue="Amount"> <apex:inputField value="{!x.Dollar_Amount__c}"/> </apex:column> <apex:column headerValue="Show"> <apex:inputField value="{!x.Show_On_Report__c}"/> </apex:column> <apex:column headerValue="Opp"> <apex:inputField value="{!x.Name}"/> </apex:column> </apex:pageBlockTable> </apex:OutputPanel> </apex:pageBlock> </apex:form> </apex:page>Opportunity Controller extension
public class OpportunityActualList { private final Opportunity opp; public OpportunityActualList(ApexPages.StandardController stdController) { this.opp = (Opportunity)stdController.getRecord(); } public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator( [SELECT id, MonthlyRevenueAmounts__r.name , Dollar_Amount__c, type__c, Fiscal_Date__c, Show_On_Report__c, Revenue_Amount__c.Name FROM Revenue_Amount__c WHERE MonthlyRevenueAmounts__r.name = :opp.Name and Show_On_Report__c = 'SHOW' and Type__c = 'Actual' order by Fiscal_Date__c desc ])); } return setCon; } set; } public List<Revenue_Amount__c> getAmounts() { return (List<Revenue_Amount__c>) setCon.getRecords(); } }Opportunity screen image. In reality I only need the Date and Amount column.
the log
46.0 APEX_CODE,DEBUG;APEX_PROFILING,NONE;CALLOUT,NONE;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,NONE 11:08:17.0 (455361)|USER_INFO|[EXTERNAL]|00580000003ZDZy|mmoore@quinstreet.com.mike|(GMT-07:00) Pacific Daylight Time (America/Los_Angeles)|GMT-07:00 11:08:17.0 (497720)|EXECUTION_STARTED 11:08:17.0 (503871)|CODE_UNIT_STARTED|[EXTERNAL]|066220000000ReR|VF: /apex/Opportunity_YoY_Actuals 11:08:17.0 (1228336)|VF_DESERIALIZE_VIEWSTATE_BEGIN|066220000000ReR 11:08:17.0 (8968923)|VF_DESERIALIZE_VIEWSTATE_END 11:08:17.9 (9763059)|SYSTEM_MODE_ENTER|true 11:08:17.10 (10437964)|SYSTEM_MODE_ENTER|true 11:08:17.0 (10999702)|SYSTEM_MODE_ENTER|true 11:08:17.77 (77859418)|SYSTEM_MODE_ENTER|true 11:08:17.0 (85970297)|CODE_UNIT_STARTED|[EXTERNAL]|VF Controller Save 11:08:17.0 (85991440)|SYSTEM_MODE_ENTER|false 11:08:17.0 (134521244)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Opportunity:00622000002jJP3 11:08:17.0 (134542832)|VALIDATION_RULE|03d80000000PY2P|B2B_Campaign_Objectives_Required 11:08:17.0 (134842407)|VALIDATION_FORMULA|Probability >= 0.5 && RecordTypeId = '01280000000BpSv' && isPickVal (Campaign_Objectives__c ,'--None--' )|RecordTypeId=01280000000Hqet , Campaign_Objectives__c=null , Probability=10.0 11:08:17.0 (134851463)|VALIDATION_PASS 11:08:17.0 (134854689)|VALIDATION_RULE|03d80000000PY2F|B2B_Enhancements_Additions_Required 11:08:17.0 (134952606)|VALIDATION_FORMULA|Probability >= 0.50 && RecordTypeId = '01280000000BpSv' && isBlank ( Enhancements_Additions__c )|Enhancements_Additions__c=null , RecordTypeId=01280000000Hqet , Probability=10.0 11:08:17.0 (134958799)|VALIDATION_PASS 11:08:17.0 (134961891)|VALIDATION_RULE|03d800000006Txv|B2B_MustBeNotNullWhenAccountIsAgency 11:08:17.0 (135194241)|VALIDATION_FORMULA|NOT(ISPICKVAL(Account.Originating_System__c, 'ITBE')) && ISPICKVAL(Category__c, 'Business to Business') && LEN(Client_Name__c) = 0 && ISPICKVAL(Account.Type, 'Agency')|Account.Type=null , Client_Name__c=null , Category__c=null , Account.Originating_System__c=<Not Migrated> 11:08:17.0 (135205236)|VALIDATION_PASS 11:08:17.0 (135208369)|VALIDATION_RULE|03d800000006Txq|B2B_MustBeNullWhenAccountIsClient 11:08:17.0 (135401165)|VALIDATION_FORMULA|NOT(ISPICKVAL(Account.Originating_System__c, 'ITBE')) && ISPICKVAL(Category__c, 'Business to Business') && LEN(Client_Name__c) > 0 && ISPICKVAL(Account.Type, 'Client')|Account.Type=null , Client_Name__c=null , Category__c=null , Account.Originating_System__c=<Not Migrated> 11:08:17.0 (135413060)|VALIDATION_PASS 11:08:17.0 (135416218)|VALIDATION_RULE|03d80000000PY2K|B2B_Topic_Segment_Required 11:08:17.0 (135544996)|VALIDATION_FORMULA|and( Probability >= 0.50 , RecordTypeId = '01280000000BpSv', or (isBlank (Topic_Segment__c),isNull(Topic_Segment__c) ) )|RecordTypeId=01280000000Hqet , Probability=10.0 , Topic_Segment__c=null 11:08:17.0 (135552711)|VALIDATION_PASS 11:08:17.0 (135555512)|VALIDATION_RULE|03d80000000Tidg|Check_CompanyId_Value 11:08:17.0 (135653731)|VALIDATION_FORMULA|AND( (LID__LinkedIn_Company_Id__c <> NULL), NOT(ISNUMBER(LID__LinkedIn_Company_Id__c)) )|LID__LinkedIn_Company_Id__c=null 11:08:17.0 (135661258)|VALIDATION_PASS 11:08:17.0 (135664131)|VALIDATION_RULE|03d80000000TfFC|CSD_user_Stage_restriction 11:08:17.0 (137741521)|VALIDATION_FORMULA|( ISPICKVAL( StageName , 'Close Within (1) Week') || ISPICKVAL(StageName, 'Closed Won') ) && $UserRole.Name = 'B2B Tech Rep' && ISCHANGED( StageName )|StageName=Advanced Negotiations , $UserRole.Name=System Admin 11:08:17.0 (137756366)|VALIDATION_PASS 11:08:17.0 (137759931)|VALIDATION_RULE|03d80000000LHtS|EDU_Product_Month_is_Day_1_of_Month 11:08:17.0 (137871970)|VALIDATION_FORMULA|DAY(EDU_Product_Month__c) <> 1|EDU_Product_Month__c=2019-05-01 00:00:00 11:08:17.0 (137885584)|VALIDATION_PASS 11:08:17.0 (137888747)|VALIDATION_RULE|03d80000000Thle|no_change_account_after_platform_push 11:08:17.0 (138000798)|VALIDATION_FORMULA|PRIORVALUE( AccountId ) <> AccountId && billing_io_key__c <> NULL|AccountId=0012200000IrAZe , billing_io_key__c=null 11:08:17.0 (138007160)|VALIDATION_PASS 11:08:17.0 (138009936)|VALIDATION_RULE|03d80000000TXwy|no_change_system_IO_number 11:08:17.0 (138101947)|VALIDATION_FORMULA|PRIORVALUE( I_O__c ) = AutoIO__c && I_O__c != AutoIO__c|AutoIO__c=234955 , I_O__c=234955 11:08:17.0 (138107478)|VALIDATION_PASS 11:08:17.0 (138110350)|VALIDATION_RULE|03d80000000TZ79|Rep_no_change_total_after_contract_sent 11:08:17.0 (138269689)|VALIDATION_FORMULA|ISCHANGED(Opportunity_Total__c ) && $UserRole.Name = 'B2B Tech Rep' && ( ISPICKVAL(StageName , 'Contract Sent') || ISPICKVAL(StageName , 'Close Within (1) Week') || ISPICKVAL(StageName , 'Closed Won') || ISPICKVAL(StageName , 'Closed Lost') || ISPICKVAL(StageName , 'Void/Cancel') )|StageName=Advanced Negotiations , $UserRole.Name=System Admin , Opportunity_Total__c=null 11:08:17.0 (138279929)|VALIDATION_PASS 11:08:17.0 (138282683)|VALIDATION_RULE|03d80000000TUZK|ValueInPickList 11:08:17.0 (138419726)|VALIDATION_FORMULA|NOT(CONTAINS("Business to Business:Careers:Education:Financial Services:Home Services:Medical and Health:Travel:Advertising", TEXT(Category__c)))|Category__c=null 11:08:17.0 (138427087)|VALIDATION_PASS 11:08:17.0 (138429779)|VALIDATION_RULE|03d80000000Tc5i|B2BTech_Closed_Lost_Description_Required 11:08:17.0 (138598236)|VALIDATION_FORMULA|AND( ISPICKVAL(Account.Sub_category__c,'Business to Business - Tech'), Closed_Lost_Description__c ='', OR(ISPICKVAL(StageName, 'Closed Lost')) )|Closed_Lost_Description__c=null , StageName=Advanced Negotiations , Account.Sub_category__c=null 11:08:17.0 (138606373)|VALIDATION_PASS 11:08:17.0 (138609219)|VALIDATION_RULE|03d80000000Tc5Y|B2BTech_Reason_Lost_Required 11:08:17.0 (138783050)|VALIDATION_FORMULA|AND( ISPICKVAL(Account.Sub_category__c,'Business to Business - Tech'), ISPICKVAL(Reason_Lost__c,''), OR(ISPICKVAL(StageName, 'Closed Lost'),ISPICKVAL(StageName,'Void/Cancel')) )|Reason_Lost__c=null , StageName=Advanced Negotiations , Account.Sub_category__c=null 11:08:17.0 (138793120)|VALIDATION_PASS 11:08:17.0 (138797149)|VALIDATION_RULE|03d80000000TUci|Deal_Type_Total 11:08:17.0 (139156264)|VALIDATION_FORMULA|AND ( Probability >= 0.50, RecordTypeId != '01280000000QEuM', RecordTypeId != '01280000000Bp05', RecordTypeId != '01280000000Bp03', RecordTypeId != '01280000000Bp06', RecordTypeId != '01280000000Bp07', RecordType.Name != 'EDU_BUDGET', ISPICKVAL (Account.Sub_category__c , 'Business to Business - Tech'), NOT(ISPICKVAL(Account.Originating_System__c, 'ITBE')), ( NULLVALUE(Deal_Type_Click__c, 0) + NULLVALUE(Deal_Type_CPA__c, 0) + NULLVALUE(Deal_Type_Display__c, 0) + NULLVALUE(Deal_Type_eSeminar_percent__c, 0) + NULLVALUE(Deal_Type_other_percent__c, 0) + NULLVALUE(Deal_Type_Lead__c, 0) ) != 1 )|Deal_Type_CPA__c=null , Deal_Type_other_percent__c=null , RecordTypeId=01280000000Hqet , Deal_Type_Display__c=null , Probability=10.0 , Account.Originating_System__c=<Not Migrated> , RecordType.Name=EDU Budget , Deal_Type_Lead__c=null , Deal_Type_Click__c=null , Account.Sub_category__c=null , Deal_Type_eSeminar_percent__c=null 11:08:17.0 (139178030)|VALIDATION_PASS 11:08:17.0 (139180862)|VALIDATION_RULE|03d80000000TdkB|InvoiceNotesMax240Chars 11:08:17.0 (139246906)|VALIDATION_FORMULA|LEN(Invoice_Notes__c) > 240|Invoice_Notes__c=null 11:08:17.0 (139252236)|VALIDATION_PASS 11:08:17.0 (139254856)|VALIDATION_RULE|03d80000000Aptd|StageNameIsNotNone 11:08:17.0 (139300766)|VALIDATION_FORMULA|ISPICKVAL(StageName , '--None--')|StageName=Advanced Negotiations 11:08:17.0 (139305707)|VALIDATION_PASS 11:08:17.0 (139313558)|CODE_UNIT_FINISHED|Validation:Opportunity:00622000002jJP3 11:08:17.0 (200133293)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Opportunity 11:08:17.0 (227360016)|CODE_UNIT_FINISHED|Workflow:Opportunity 11:08:17.0 (238675011)|CODE_UNIT_FINISHED|VF Controller Save 11:08:17.241 (241425173)|SYSTEM_MODE_ENTER|true 11:08:17.241 (241638407)|SYSTEM_MODE_ENTER|true 11:08:17.0 (242121504)|SYSTEM_MODE_ENTER|true 11:08:17.269 (269720864)|SYSTEM_MODE_ENTER|true 11:08:17.269 (269929739)|SYSTEM_MODE_ENTER|true 11:08:17.0 (339122653)|VF_SERIALIZE_VIEWSTATE_BEGIN|066220000000ReR 11:08:17.0 (342512976)|VF_SERIALIZE_VIEWSTATE_END 11:08:17.0 (346352402)|CODE_UNIT_FINISHED|VF: /apex/Opportunity_YoY_Actuals 11:08:17.0 (347540377)|EXECUTION_FINISHED
- Mike_M_2
- June 12, 2019
- Like
- 0
- Continue reading or reply
Display multipicklist using HTML tags in Visualforce Page
Multipicklist should show some list of contacts belonging to that account.
I already have a big VF page where I want to replace apex:selectlist with html select tag because apex:selectList is not mobile compatible.
Below is my code, it is not returning Contacts on multipicklist (LHS):
<apex:page standardController="Account" extensions="MultiSelectPicklist_HTML" sidebar="false" lightningStylesheets="{!$User.UIThemeDisplayed == 'Theme4t'}">
<apex:form id="frm">
<apex:pagemessages id="pgmsg"/>
<apex:pageBlock mode="edit" id="PB" >
<apex:pageBlockSection columns="2" id="pbs1">
Client Attendee<div style="color:red;font-size:20px;" > * </div>
<apex:actionRegion id="ar">
<apex:panelGrid columns="4" id="grid1" >
<select name="sel1" multiple="multiple" style="width:150px;height:100px;" size="5" value="{!leftselected}">
<apex:repeat value="{!unselectedvalues}" var="con" id="theRepeat1">
<apex:selectOption itemValue="{!con.Id}" itemLabel="{!con.Name}" />
</apex:repeat>
</select>
<apex:panelGroup >
<br/>
<apex:commandButton value=">>" action="{!selectclick}" reRender="grid1"/> <br/><br/>
<apex:commandButton value="<<" action="{!unselectclick}" reRender="grid1"/>
</apex:panelGroup>
<select name="sel2" multiple="multiple" style="width:150px;height:100px;" size="5" value="{!rightselected}">
<apex:repeat value="{!selectedvalues}" var="con" id="theRepeat2">
<apex:selectOption itemValue="{!con.Id}" itemLabel="{!con.Name}" />
</apex:repeat>
</select>
</apex:panelGrid>
</apex:actionRegion>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
..........
public class MultiSelectPicklist_HTML {
Public List<string> leftselected{get;set;}
public SelectOption[] unselectedvalues {get;set;}
Public List<string> rightselected{get;set;}
public SelectOption[] SelectedValues {get;set;}
Private String currentAccountId;
public MultiSelectPicklist_HTML(ApexPages.StandardController controller) {
Account Acc = new Account();
string aid = System.currentPageReference().getParameters().get('id');
currentAccountId = String.valueOf(aid).substring(0, 15);
System.debug(currentAccountId+' '+aid);
List<Contact> conList_Acc = new List<Contact>();
//custom custom multi picklist
leftselected = new List<String>();
rightselected = new List<String>();
selectedvalues=new List<SelectOption>();
unselectedvalues=new List<SelectOption>();
conList_Acc =[Select id,name,Salutation,AccountId,Title from Contact where accountid =:currentAccountId order by Name];
System.debug(conList_Acc);
if(conList_Acc.Size()>0){
unselectedvalues.clear();
for(Contact c : conList_Acc){
System.debug(String.valueOf(c.AccountId).substring(0, 15));
System.debug(currentAccountId);
if(String.valueOf(c.AccountId).substring(0, 15) == currentAccountId){
unselectedvalues.add(new SelectOption(c.Id,c.Name));
}
}
}
System.debug(unselectedvalues);
}
public PageReference selectclick(){
List<SelectOption> templeft = new List<SelectOption>();
system.debug('selectedvalues--');
for(Selectoption s : unselectedvalues)
{
if(leftselected.contains(s.getvalue()))
{
SelectedValues.add (new SelectOption(s.getvalue(),s.getlabel()));
}
else
{
templeft.add (new SelectOption(s.getvalue(),s.getlabel()));
}
}
unselectedvalues = templeft;
return null;
}
public PageReference unselectclick(){
List<SelectOption> tempRight = new List<SelectOption>();
system.debug('selectedvalues--');
for(Selectoption s : selectedvalues)
{
if(rightselected.contains(s.getvalue()))
{
unSelectedValues.add (new SelectOption(s.getvalue(),s.getlabel()));
}
else
{
tempRight.add (new SelectOption(s.getvalue(),s.getlabel()));
}
}
selectedvalues = tempRight;
return null;
}
}
Please help me in figuring out the issue .Please advise.
- Ankita Gupta 26
- June 11, 2019
- Like
- 0
- Continue reading or reply
Lightning Web Component Testing as app
- IamSRN
- June 10, 2019
- Like
- 0
- Continue reading or reply
how to enable and disable picklist values based on onclick javascript button.
Hi,
I have one custom object (gpt__DupesPreventor_Setting__c) & it has one picklist field which contains all sObjects in our org (gpt__Enable_Object__c).
I made one custom Visualforce Page & i want to show this picklist values based on javascript onclick button.
When i select a one sObject from this PickList then it enable (& Emidiatly show "Disable " button in front of these selected sObject).
When i click on this "Disable" button, then these perticular records gets "Disable".
Hopes someone from this community, coz i already wasted my two days to reasrech on this specific task.
Anyone Help greatly appreciate.
Thnaks.
SalesforceDeveloper.
- salesforce developer 348
- June 07, 2019
- Like
- 0
- Continue reading or reply
How can I fix Error ID: 947061604-44277 (-183323947)?
I got this message, how can I fixt it?
We can't save this record because the “Opportunity - Set contracted checkbox at Close/Won” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: FIELD_CUSTOM_VALIDATION_EXCEPTION: You cannot update a Closed opportunity. Please reach out to Sales Operations. (Message 6). You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 947061604-44277 (-183323947)
- Rumiko Shimada
- June 06, 2019
- Like
- 0
- Continue reading or reply
How to show dropdown in slds combobox and put selected item to input textbox?
I converted my lightning:combobox into slds combobox to use data attributes, now, dropdown is not showing. Please help me.
And also, how to put the selected item into input textbox?
<aura:attribute name="myObject" type="List"/> <aura:attribute name="myCustomSettings" type="MyCustomSettings__c[]"/> <aura:iteration items="{!v.myCustomSettings}" var="obj" indexVar="index"> <tr class="slds-hint-parent"> <td role="gridcell" data-label="Object"> <div class="slds-form-element slds-form-element__control"> <div class="slds-combobox_container"> <div aura:id="open" class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click" aria-expanded="true" aria-haspopup="listbox" role="combobox"> <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none"> <input type="text" class="cellField slds-input slds-combobox__input" role="textbox" autocomplete="off" readonly="true" aura:id="allObjects" placeholder="-Select-" data-id="{!'index-' + index + 1}" data-value="{!index + 1}" value="{!obj.Object__c}" onfocus="{!focus}"/> <span class="slds-icon_container slds-icon-utility-down slds-input__icon slds-input__icon_right"> <lightning:icon class="slds-icon slds-icon-text-default slds-icon_xx-small" iconName="utility:down" size="xx-small" variant="brand" /> </span> </div> <div aura:id="options" class="slds-dropdown slds-dropdown_length-5 slds-dropdown_fluid" role="listbox"> <ul class="slds-listbox slds-listbox_vertical" role="presentation"> <aura:iteration items="{!v.myObject}" var="myLst" indexVar="i"> <li aura:id="selectObj" role="presentation" class="slds-listbox__item" onclick="{!c.itemSelected}" data-id="{!'index-' + i + 1}" data-value="{!i + 1}"> <div id="{!i + 1 + '-item'}" aura:id="is-selected" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option"> <span class="slds-media__figure slds-listbox__option-icon"></span> <span class="slds-media__body"> <span class="slds-truncate" title="{!myLst.label}">{!myLst.label}</span> </span> </div> </li> </aura:iteration> </ul> </div> </div> </div> </div> </td> <tr> <aura:iteration/>
focus : function (component, event, helper) { var open = component.find("open"); $A.util.toggleClass(open, 'slds-is-open'); },
itemSelected : function(component, event, helper) { var selectedItem = event.currentTarget; var id = selectedItem.dataset.id; var elements = component.find('selectObj'); for (var i = 0; i < elements.length; i++) { var val = elements[i].getElement().getAttribute('data-id'); if(val == id) { console.log(val); //put the selected item to input textbox } } },
- ForceRookie
- June 05, 2019
- Like
- 0
- Continue reading or reply
how to navigate record crate page of lightning experience from lightning component?
I am new to Salesforce Lightning, Please help me to do this requirement.
I tried by using '$A.get( 'e.force:createRecord' )' this standard event but its not working.
Thanks in advance...
- Shubham Agrawal 13
- June 03, 2019
- Like
- 0
- Continue reading or reply
Change color on the the call log Icon depending on the 'type' field
Please bear in mind I am not a developer so please can we try and give me step by step guide on how this can be achieved if possible?
THANK YOU SO MUCH!
- Jasmin -Not a super admin
- May 30, 2019
- Like
- 0
- Continue reading or reply