• S_Rath
  • NEWBIE
  • 34 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 19
    Replies
public class C_Tag_Wrapper{
    @AuraEnabled public String value {get; set;}
    @AuraEnabled public Integer count {get; set;}
    @AuraEnabled public String type {get; set;}
    @AuraEnabled public Datetime createdDate {get; set;}
    @AuraEnabled public String tagDescription {get; set;}
    /*
    * Constructor of the class
    *
    * @param String the tag name
    * @param Integer the count of the tag
    * @param String the count o
    * @return none
    */
    public C_Tag_Wrapper(String tagName, Integer count, String type, Datetime createdDate, String tagDescription){
    this.value = tagName;
    this.count = count;
    this.type = type;
    this.createdDate = createdDate;
    this.tagDescription = tagDescription;
    }
    /*
    * Default Constructor of the class
    *
    * @return none
    */
    public C_Tag_Wrapper(){
    }
}
  • November 29, 2018
  • Like
  • 0
User-added image
When i reach to verification stage all the stages after verification should disappear is that possible?
Hi everyone,

I'm trying to render multiple dynamic forms, which have different record types. In my lightning component helper class, I have a method where I defined different parameteres and set in the component list type attribute.

My first problem is, I need the dynamic record type Id for the lightning:recordEditForm where I need to set the record type Id. I called the helper method which can pull the record type Id from the server side Apex controller. In this helper method class, I tried to return the record type Id and tried to set the value as below:
var introLaws = [];
introLaws.push({
                    "key"                    : "DummyKey",
                    "recordType"        : this.getRecordTypeId("Dummy Record Type Name")
});
component.set("v.lawsSections", introLaws);
I checked the console log, the record type id is good, but whenver I tried use the record type id in component loop, I found that the recordType is empty. The key value is okay. Please advise.

The second problem is, in the component I have a aura:iteration loop to render the dynamic form, and it should be as below:
<aura:iteration items="{!v.lawsSections}" var="lawsSection">
<lightning:recordEditForm aura:id="{!lawsSection.key}" recordTypeId="{!lawsSection.recordType}" objectApiName="Dummy_Object__c">
And here is the issue. I can't assign the recordTypeId, please advise.

My third problem is, I need to assign the dynamic aura:id to save the form, so that I can just use the below structure
var localId = event.getSource().getLocalId();
var notificationApp = component.find(localId);
Please advise.

I appreciate your time.

Kind Regards,
Abu Wahid
Hello everyone, I am writing a utility class for a trigger. I'm trying to execute a SOQL query that pulls all opportunities, then filters them out by start date and by specific types of classifications. So, the objects that I'm using are: opportunities, contacts, and a custom object called classification type contacts. 

I need to filter out the opportunities by specific classification type contacts. 

The relationships are as follows: 
  • opportunities has a lookup field called "donors" that relates it to contacts
  • contacts has a master-detail relationship with "classification_type_contacts__c"
So far, my SOQL query looks as follows:
 
String classNames = getAggregateDataUtils.getClassNames('Majors'); //utility method to return string of names to filter by
Date startDate = Date.newInstance(2018, 11, 27);
Date endDate = Date.newInstance(2018, 11, 28);
List<Opportunity> opps = [SELECT opp.id, opp.CloseDate, opp.amount, (SELECT Classification_Name__c FROM Classification_Type_Contact__c) FROM Opportunity opp
                          WHERE (opp.CloseDate >=: startDate and opp.CloseDate <=: endDate)
                          AND classification_name__c IN : classNames];
The error I get is as follows:

User-added image


I'm not really sure how to fix this. I think the biggest problem is that there's no lookup field on the Contact to the "Classification_Type_Contact__c", but since there's a Master-Detail relationship, I should still be able to get there, right? I can pull reports with a custom report type that relates the three different objects. 

Thank you in advance for your help!


Best,
Jon
 
I am not being able to configure the trigger whose fetching childs records . This is the Screen shot , Please help me in it as your earliest possible 

User-added image

This is the Code 

trigger insert12Records on University__c (after insert) {
List<Class__c> classList = new List<Class__c>();
Set<Id> idSet = new Set<Id>();
Map<id,Integer> mapIDcount = new Map<id,Integer>();
for(University__c uni:Trigger.new)
{
idSet.add(uni.Name);
for(University__c u:[Select Id,(Select id from Class__c ) from University__c where Id =:idSet ])
{


for(Integer i = 0; i< 12; i++){
Class__c cls = new Class__c();
cls.Name= 'Test Class'+i;
cls.University__c = uni.Id;
classList.add(cls); 


}
}
insert classList;

}

}
 
Hi,

this query is showing an error : 

for(Project__c objProject : [SELECT Id,Name,(SELECT Id,Estimated_Value__c, Total_Actual_Sales__c 
                                            FROM Opportunities) FROM Project__c WHERE Id IN: set_Opportunity])

Opportunity is a child object to Project , and its a lookup relationship.

I am using this query in a trigger..  but getting below error

Didn't understand relationship 'Opportunities' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 14 column 33

Hello Salesforce developer community! I'm working on my second lightning component and I feel like I'm 95% there but stuck on one thing. Apologies if the answer to this is already posted somewhere or it is in the developer documentation. I'm not sure how to search to ask the right question. 

Scenario: I'm creating a component that will be used in a flow (implements="lightning:availableForFlowScreens"). Part of the component is a Rich Text field and I want to be able to make that rich text field required. 

<div>
     <lightning:inputRichText value="{!v.myVal}" placeholder="Enter text with formatting" messageWhenBadInput="{!v.errorMessage}" valid="{!v.validity}"/>
</div>
This much works but I want to be able to make my field required. In fact as a test, I have temporarily added a button that checks that the field has something in it:
<lightning:button name="validate" label="Validate" onclick="{!c.validate}"/>
validate: function(cmp,event,helper) {
        if(!cmp.get("v.myVal")){
            cmp.set("v.validity", false);
        }
        else{
            cmp.set("v.validity", true);
        }
    }

However, I don't want the button. I want to check that the field is not empty when the user clicks the Next button on the flow screen. 

I know I can do both of the following solutions but I would prefer a more elegant solution:

1. I could write code with a replacement set of navigation buttons. This would allow me to override the functionality of the Next button. I want to use the standard navigation if possible so I'm hoping this is not required.

2. I could pass the result of the lightning:inputRichText to the flow and make the flow do the validation and pass the user back to the same screen with an error message. However I want my component to be self-contained so this is not the ideal solution because it requires work to be done in the flow each time the component is used.

Is there any way to get flow to recognize that a component on the screen is in an invalid state using standard navigation? In other words, I want the lightning:inputRichText to work like any other required field would work where when you click next, it throws an error if the field is not filled in.
 

I have looked everywhere and I can't find a good answer. I have some custom objects with standard lookup fields on them. The users are wanting those lookup fields to be able to select multiple records in the object they are looking up to. I know the functionality is there, because you can do this on the user lookup object, but not in the custom objects. 

Can someone PLEASE tell me how I can create a lookup field that will allow the user to select multiple records from the object that lookup field is looking up to?
Hello All

  Can someone help me in calculating the number of days for the target date to be populated excluding weekends and public holidays

For Instance, if the prority is in the case object is high, then the target date should be populated with +2 days from the case created date but should exclude weekends and public holidays.

I wrote the formula for excluding weekend but not able to figure how to add holidays to it. Here is the formula i wrote how to exclude weekends and add +2 days for created date

CASE( MOD( DATEVALUE( [Case].LastModifiedDate ) - DATE( 1900, 1, 7 ), 7 ), 
0, [Case].LastModifiedDate + 0 + 1,  
4, [Case].LastModifiedDate +  0+ 1, 
5, [Case].LastModifiedDate + 2 + 1,  
6, [Case].LastModifiedDate + 1 + 1, 
[Case].LastModifiedDate + 1 
)

Thanks in Advance
Hello, 
I have quick action - lightning component and I want to control width popup.
Can someone help me.
<!---Component--->
<div class="slds-p-around--large">
        <aura:iteration items="{!v.CommunicatoActivity}" var="Act" indexVar="i">
            <div class="slds-page-header" aura:id="{!i+'activity'}" style="cursor: pointer;" onclick="{!c.sectionOne}">
                <section class="slds-clearfix" >
                    <div class="slds-float--left ">
                        <lightning:icon class="slds-show" aura:id="articleOne" iconName="utility:chevronright" size="xx-small" alternativeText="Indicates add"/>&nbsp;&nbsp;
                        <lightning:icon class="slds-hide" aura:id="articleOne" iconName="utility:chevrondown" size="xx-small" alternativeText="Indicates dash"/>&nbsp;&nbsp;
                    </div>
                    
                    <div class='msgContainer'>
                        <aura:if isTrue="{!v.CommunicatoActivity.Type__c == 'Incoming'}">
                            <div class="iconContainer"><img src="{!$Resource.incomingSMS}" height="20" width="20" /></div>
                            <aura:set attribute="else">
                                <div class="iconContainer"> <img src="{!$Resource.outgoingSMS}" height="20" width="20"  /></div>
                            </aura:set>
                        </aura:if>&nbsp;&nbsp;
                        <div class="numberContainer" ><a>{!Act.Phone_Number__c}</a></div>
                        <div style="margin-left: 15%;">
                            <p>You Sent a Message</p>
                        </div>
                    </div>
                </section>
            </div>
            <div class="slds-hide slds-p-around--medium" aura:id="articleOne">
                <p><strong>Type:</strong>{!Act.Type__c}</p>
                <p><strong>Phone:</strong>{!Act.Phone_Number__c}</p>
                <p><strong>Message:</strong>{!Act.Message__c}</p>
            </div>
        </aura:iteration>
    </div>

<!------------Js----------->
doInit : function(component, event, helper) {
        var action = component.get('c.getCommunicatoActivity');
        action.setParams({ "recordId" : component.get("v.recordId") });
        action.setCallback(this, function(response){
            var state = response.getState();
            if(state ==='SUCCESS'){
                component.set('v.CommunicatoActivity',response.getReturnValue());
            }else{
                console.log('Some Error');
            }
        });
        $A.enqueueAction(action);
        
    },
    
    sectionOne : function(component, event, helper) {
       helper.helperFun(component,event,'articleOne');
    },

<!-------Helper.Js---------------------->
helperFun : function(component,event,secId) {
      var acc = component.find(secId);
            for(var cmp in acc) {
            $A.util.toggleClass(acc[cmp], 'slds-show');  
            $A.util.toggleClass(acc[cmp], 'slds-hide');  
       }
    }

This is my code for expandable section in lightning component i get using aura:iteration
My problem is when i click on single section all section is exapanded 
I am not able to clear challenge 5 of 'Lightning Experience Specialist superbadge'. It keep giving me below error,
User-added image

However I have tested the approval process multiple times and it is working as expected.
Thanks in advance for any help.
Greetings, I've created my external object for the Data Integration Specalist Superbadge and have configured my external ID as seen below, however, the challenge seems to not pass, indicating that the indirect lookup was not properly created. Here's how I set up the projectRef__c field, which was what I used to push data from the external object into the project object in Salesforce. Are there any steps, I need to take. Hope it helps.
User-added image


User-added image
 
What is the order of initialization of Lightning components?
I am building a Customer Community using the Napili Template. I have customized the home page by adding a few custom-built Lightning Components. I want to ensure that all the external JavaScript libraries are loaded last (lazy loading) so that the end-user does not have to stare at a blank page while all those libraries get loaded. For this I thought putting the <ltng:require> tags in my footer will work because I assumed that the components are initialized in order from top to bottom of the page and the Footer will initialize (i.e. fire the init event) all last since I had placed it at the very bottom of the page BUT in practice I am observing that many times the footer initializes before the other components do.
 
I'm getting this error: Challenge Not yet complete... here's what's wrong: 
Opportunities with the stage of 'Awaiting Approval' and a Discount > 0, did not kick off an approval process named 'Approval for Package Deal'.

Here is what I submitted:

Object: Opporunity 
Start Process when created or edit

Criteria 
Conditions are met
[Opportunity].StageName Is Changed True
[Opportunity].StageName= Awaiting Approval
[Opportunity].Discount > 0
All conditions are met (And)

Immediate Actions
Object Opportunity
Approval Proccess: Specific Approval Process- Approval for Package Deal 
Submitter: User field from a record- [Opportunity].Owner.Id

Update Record
Record: [Opportunity]
Criteria: updated records meet all conditions
Filter: Discount Is null= true
New field: Stage=Scheduled

Criteria
Deposit Made
[Opportunity].StageName = Deposit Made

Immediate Action
Update Record
Record: [Opportunity].Fulfillments__r
No criteria
Status= paid deposit

Criteria
Cancelled
[Opportunity].StageName =Cancelled

Immediate Actions
Update Records
[Opportunity].Fulfillments__r
Status= Cancelled

Thank you in advanced!
We would like to avoid to hardcode value in an apex class and use "environment variable". Is the use of custom settings the right way to do that ? 

Today I created a custom settings containing 2 fields, an url and a authorization token. The values are differents from one sandbox to another, so I create one data set for each of my sandbox (dev-int-uat-prod). Now my problem is to know in wich sandbox am I ? To retrieve the right values from my custom setting and of course I don't want to hardcode it. I used UserInfo.getUserName().substringAfterLast('@').substringAfterLast('.') to retrieve the sandbox name but for production this code doesn't work, so can anyone help me on the best way to do that ?

Thanks in advance for your answers and your help.