• Firas Taamallah 18
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 7
    Replies
public static List<String> getContactNames(list <Account> accounts){

//
}



how to achieve this ?
Hello , 

i want to assign a string to Map value  like ; 
String SA =    String.valueOf(emailConfigMap.get(c.EmailConfiguration__c).Email__c) ;
its throwing  a NullPointerException - 
 
Hello , 

I have text field contain :  7AM-7PM UTC+1 
i want to convert it to Hours so i can check if current hour is in this range or no - Any help would be appreciated

Thanks
Hello , 

My requirement is to verify if Date.now is in Date (String or no ? 
Example :
  •  String :  7Am-7PM UTC+1  , i want to verify if Date.now is in this period or no  field Business Hour 
i should use Invocable Method because i will call this method in Flow so the signature of my method
 
@InvocableMethod
    public static List<boolean> checkBusinessHours(List<Id> ButtonIds){
List<Entity> ents = [Select BusinessHour from Tntity where Id in ButtonIds];
// i should return list of boolean because InvocableMethod methods do not support return type of Boolean

return new List<boolean>{false};

}

Any help would be appreciated
Hello , 

How can i recover the field startdatetime  which is field of event object from the object contentNote?

Thanks,
Hello ,

Example : List<String> contain :  'A' ,'B' , 'C' , 'D' , 'E' 
I want to store in another list only 'A' and 'B' - how to achieve this?
Hello , 

I have text field in Case , i want to test if this field contain less than 5 email addresses - How can i acheieve this?

Thanks,
Firas
Hello ,

I want to assign Read access to managed object  in  Analytics Cloud Security User profile 

User-added imageI can't do it - why ?
Hello ,

I couldn't retrieve the junction object AccountContactRelation  in my Vs code , have someone passed through this situation ? 

Thanks
Hello ,

My goal is when i try to add account throught Add Relationship button in Contact related list , the new account should be part of the Account Hierarchy of the contact's account , if not error message will be displayed

To do this , i need to compare :
  1.  Top account of the contact's account in Account Hierarchy
  2.  Top Account of the new account you are trying to add throughout Add Relationship button
  3.  if top accounts are the same so it means the new account is part of Account Hierarchy of Contact's Account , so in this case i would be able to insert it

How can i achieve this?
Thanks
Hello , 

I'm trying to give Edit access to System Admin but i couldn't
It's an indexing Field

User-added imageHow can i achieve this ?
Thanks,
Hello , 

When i activated SF-Release :  Enforce Access Modifiers on Apex Properties in Lightning Component Markup  ,  and  i runned all Test Class ,  Managed Package test classes didn't pass for some reason .

why ? what's the impact on Org?

Thanks,
Firas
Hello ,

I want to develop an soql which will return number of time a field being changed since september 2020 .
  • Soql : SELECT count(Case.Subject), count(Case.OwnerId)  FROM CaseHistory where case.LastModifiedDate  >= 2020-09-01T00:00:00Z 
Does this soql true? how can i aggregate Checkbox field as i can not use Count on checkbox field .. 

Thanks,
Hello ,

There's Page layout which contain many component in , the goal is to make field (which is present in some of component) Mandatory for certain RecordType - How can i achieve this ? 

Using Aura:if ?
Hi , 

I want the case record type to be changed automatically every time it's related object's field which is picklist change 

Example : 
  • Case A , Record Type  = B
  • Custom Object C , Picklist value = C
In this case , the case record type should be changed to C - How can i achieve this using Apex ? 
Id devRecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByName().get(era.EmailRule__r.CaseRecordType__c).getRecordTypeId();

This line seems doesn't work , i tried to get ID of the custom object's field ( picklist value ) and assign it to Case recordType  ..

Thanks,​​​​​​​
Hello ,

Why i can't find  Apex Classes when i search for it in Setup ?
User-added image
Hi ,

Given this diagram , how can i retrieve case recordtype from Email_Rule object ?

User-added imageThanks,
Firas
Hi , 

There's path in Case record type 
I want to lock field from editing when Path is equal " Distribued" 

How can i achieve this?
Rgds,
Firas
Hi ,
  • My parent objet Test_Campaign__c have lookup Core_Campaign_Model__c on itself.
  • My child object have lookup field Test_Campaign__c to Test_Campaign__c 
My need is to link child records to parent every time new parent is created with Core_Campaign_Model__c   equal child.Test_Campaign__c

Here's my trigger : 
 
trigger TRG_LinkCampaing on Test_Campaign__c (after insert,after update) {

    
    set<Id> ParID = new set<Id>();
    
    
    for(Test_Campaign__c TestCamp : Trigger.new)
    {
      ParID.add(TestCamp.Core_Campaign_Model__c);
    }
    List<Test_Scenario__c> TS = [Select Id , Test_Campaign__c from Test_Scenario__c where  Test_Campaign__c In :ParID ];
    List<Test_Campaign__c> TC = [Select Id,name from Test_Campaign__c where Id = : Trigger.new];

     List<Test_Scenario__c> TestCampaToUpdate = new List<Test_Scenario__c>();
    for (Test_Scenario__c Testsc : TS){
         
       Testsc.Test_Campaign__c = TC[0].Id;
        TestCampaToUpdate.add(Testsc);
        
    }
    update TestCampaToUpdate;
}

This trigger works fine but only one time due to TC[0].Id , how can i avoid this?
Hello ,

I couldn't retrieve the junction object AccountContactRelation  in my Vs code , have someone passed through this situation ? 

Thanks
public static List<String> getContactNames(list <Account> accounts){

//
}



how to achieve this ?
Hello ,

I want to develop an soql which will return number of time a field being changed since september 2020 .
  • Soql : SELECT count(Case.Subject), count(Case.OwnerId)  FROM CaseHistory where case.LastModifiedDate  >= 2020-09-01T00:00:00Z 
Does this soql true? how can i aggregate Checkbox field as i can not use Count on checkbox field .. 

Thanks,
Hi ,
  • My parent objet Test_Campaign__c have lookup Core_Campaign_Model__c on itself.
  • My child object have lookup field Test_Campaign__c to Test_Campaign__c 
My need is to link child records to parent every time new parent is created with Core_Campaign_Model__c   equal child.Test_Campaign__c

Here's my trigger : 
 
trigger TRG_LinkCampaing on Test_Campaign__c (after insert,after update) {

    
    set<Id> ParID = new set<Id>();
    
    
    for(Test_Campaign__c TestCamp : Trigger.new)
    {
      ParID.add(TestCamp.Core_Campaign_Model__c);
    }
    List<Test_Scenario__c> TS = [Select Id , Test_Campaign__c from Test_Scenario__c where  Test_Campaign__c In :ParID ];
    List<Test_Campaign__c> TC = [Select Id,name from Test_Campaign__c where Id = : Trigger.new];

     List<Test_Scenario__c> TestCampaToUpdate = new List<Test_Scenario__c>();
    for (Test_Scenario__c Testsc : TS){
         
       Testsc.Test_Campaign__c = TC[0].Id;
        TestCampaToUpdate.add(Testsc);
        
    }
    update TestCampaToUpdate;
}

This trigger works fine but only one time due to TC[0].Id , how can i avoid this?
I have this method
 
Public void Method(){
for (AccountContactRelation accountContactRelation : (List<AccountContactRelation>) Trigger.new) {
            String oldRoles = (Trigger.isUpdate) ? ((AccountContactRelation) Trigger.oldMap.get(accountContactRelation.Id)).Roles : null;

            if (accountContactRelation.Roles != null && accountContactRelation.Roles.contains(Label1) && (Trigger.isInsert ||
                    (Trigger.isUpdate && (oldRoles == null || !oldRoles.contains(Label1))))) {
                if (!accountContactRelationIdsMap.containsKey(accountContactRelation.AccountId)) {
                    accountContactRelationIdsMap.put(accountContactRelation.AccountId, new List<Id>());
                }
                accountContactRelationIdsMap.get(accountContactRelation.AccountId).add(accountContactRelation.ContactId);
            }
        }

i want to remove Trigger.New and Trigger.Old and replace them with parameters like : 
 
Public void Method(List<AccountContactRelation> NewAccCont , List<AccountContactRelation> OldAccCont){

for (AccountContactRelation accountContactRelation : NewAccCont ) {

//How can i declare OldRoles using the parameter OldAccCont

            String oldRoles = (Trigger.isUpdate) ? ((AccountContactRelation) Trigger.oldMap.get(accountContactRelation.Id)).Roles : null;

            if (accountContactRelation.Roles != null && accountContactRelation.Roles.contains(Label1) && (Trigger.isInsert ||
                    (Trigger.isUpdate && (oldRoles == null || !oldRoles.contains(Label1))))) {
                if (!accountContactRelationIdsMap.containsKey(accountContactRelation.AccountId)) {
                    accountContactRelationIdsMap.put(accountContactRelation.AccountId, new List<Id>());
                }
                accountContactRelationIdsMap.get(accountContactRelation.AccountId).add(accountContactRelation.ContactId);
            }
        }

How can i declare OldRoles using the new parameter OldAccCont
Suppose there is an inputfield/picklist field.........i want to populate an output textbox with the value of input field or value selected in picklist.
how to do this?