• chaithaly gowda
  • NEWBIE
  • 30 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 7
    Replies
Hi

I am trying to get the result in testclass from SOSL query ,but the SOSL is not returning any values even when there is a matching test data.

Please refer below code:
User user=new User(FirstName='Test',
                             LastName='Contact',
                             Alias='tcont',
                             email='test.contact@xyz.com',
                             Username='test.contact@xyz.com',
                             CommunityNickname='cont',
                                        profileId=sysAd.id,
                             EmailEncodingKey=DummyUser.EmailEncodingKey,
                             TimeZoneSidKey=DummyUser.TimeZoneSidKey,
                             LocaleSidKey=DummyUser.LocaleSidKey,
                             LanguageLocaleKey=DummyUser.LanguageLocaleKey
                            );
                            insert user;
         System.RunAs(user){
        
         Account acc=new Account(Name='Test',
                                 RecordTypeId=accRecMap.get('Con').getRecordTypeId()
                                );
         insert acc;
         Contact cont=new Contact(Account=acc,
                                  FirstName='Test',
                                  LastName='Contact',
                                  AccountId = acc.Id,
                                  RecordTypeId=contRecMap.get(' Contact').getRecordTypeId()
                                 );
         insert cont;
         
        String userName=Userinfo.getName();
        Map<String, Schema.RecordTypeInfo> contactRecMap= Schema.SObjectType.Contact.getRecordTypeInfosByName();
      
                   
        String searchQueryCon = 'FIND \'' + userName + '\' IN ALL Fields RETURNING Contact(Id, Name,FirstName, LastName, Title, Email, Phone, Description)';
        System.debug(searchQueryCon);
        System.debug(cont);
        List<List<Contact>> contactListNew = search.query(searchQueryCon);
        System.debug(contactListNew);
       
         }
Hi All
Is there anyway to get notified about the user license expiration(salesforce,salesforce platform..) through email?

There is object 'UserLicense', but it doesnot have any details on expiration date to use it in workflow or process builder.

Would someone please suggest a way to get notified.
Thanks in advance
Hi

I have a string which is in format ('abc','xyz','efg').
Can someone please suggest how this string can be converted into list<string> with the value abc,xyz,efg.
Any help would be appreciated.

Thanks
Chaithaly
Hi
I have used slds-align_absolute-center slds-text-body_regular to align the texts to centre.
below is the snippet 
<lightning:card >

        <div class="slds-align_absolute-center slds-text-body_regular">

                <ul>

                    <!-- Body set dynamically-->
                </ul>
  
        </div>

    </lightning:card>

Alignment works properly when when texts are short , but when texts are long it is automatically aligning the texts to the left.

Can someone help with this.

Thanks
 
I have a requirement to launch a flow from lightning component using pageReference.
I was able to do it with WebPage pagereference type but domain name cant be consistant across the sandboxes.
So, trying to find out if we can navigate from a lightning page to a flow using lightning:navigation in any other way.

Thanks
Hi

I have a requirement to launch a flow from lightning component using pagreference.
I was able to do it with WebPage pagereference type but domain name cant be consistant across the sandboxes.
So, trying to find out if we can navigate from a lightning page to a flow using lightning:navigation  
Hi All

I am facing this error 'Apex event trigger cannot handle batch operations on recurring event' when trying to update 102 event records through data loader.

Could someone please tell what recurring events mean and why dataloader is throwing error on update .

Thanks in advance.
Chaithaly.
Hi

I have a trigger on event for after update , and inside the trigger i have given the condition if(trigger.isupdate){//statements}.

The scenario is, I am creating an event record , the after update trigger is executing the statements inside isupdate block in the same transaction.

Kindly help if i am missiong something.

Thanks
 
Hi 
I have a visualforce page , where i need to display a text based on the picklist value .
<apex:outputPanel style="color:white"
       rendered="{!IF(Contact.Field1__c='value -WS 25 - A+',true,false)}" >
all other values are working fine except this value .
Please enlighten me if I am wrong.

Thanks
 
Hi

I have a requirement where i have to convert the sobject type to custom object type returned from quering the event object.
code:

global Database.QueryLocator start(Database.BatchableContext BC){
        
        return Database.getQueryLocator('Select Id, RecordTypeId, WhoId, WhatId, Subject, Location, IsAllDayEvent, ActivityDateTime, ActivityDate FROM Event);
        
    }
   
    global void execute(Database.BatchableContext BC, List<SObject> scope){
        for (sObject obj : scope) {
                Audit__c e=(AAudit__c)obj;
                try
                {
                    Database.SaveResult results = Database.insert(e, false);
                }catch(Exception ex){
                }
            }         
        update scope;
    }

this is giving me System.TypeException: Invalid conversion from runtime type Event to Audit__c .
here Audit__c is child of Event
Is it possible to convert this way , please let me know.

Thanks
I have a custom setting 'Licensename__c' where 'license__c' is the only field. I am using the below logic to access the data from it 

List<LicenseName__C> names = LicenseName__c.getall().values();
system.debug(names[0].License__c);
system.debug(names[1].License__c);
system.debug(names[2].License__c);
system.debug(names[3].License__c);

The debug statements are not giving the data in the order that i have entered in custom setting.

Is there any way to bring the data in the code in the same order i entered in custom setting!?

Also please let me know how to count the number of dataset in the custom setting.
Any help is appreciated.

Thank you!
I was analising a code and came across if(sforce.one){ }, not sure what it does. can someone enlighten me about this
I hope it can be done with visualforce page as i read feww comments, but can someone please tell how to start with this!
Hello,

I have this scenario where I have a child object called 'reserve__c'  for an 'opportunity' as a parent.

when a new opportunity is created ,I want to make sure user creates reserve__c record as well.
Can someone please help me with the solution! 

This is the trigger written to add the users to the opportunity team member related list


trigger oppTeammember2 on Opportunity (before insert) {
    
 
    list<opportunityteamMember> opp=new list<opportunityteamMember>();
user u=[select id from user where alias='cgowd' limit 1];
    for(opportunity o:trigger.new)
    {
        if(o.Amount>5000000)
        {
         opportunityteamMember o1=new opportunityteamMember();
           
             o1.TeamMemberRole='Account Manager';
            o1.userId=u.id;
            o1.OpportunityAccessLevel = 'All';
            o1.OpportunityId=o.id;
           
            opp.add(o1);
            
        }
         
        }
   insert opp;
            
    }

I am getting the error as:
oppTeammember2: execution of BeforeInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [OpportunityId]: [OpportunityId] Trigger.oppTeammember2: line 21, column 1
 Any help is appreciable 
Thank you
 
I am trying to create a custom URL button , through which i want to set field value.. is there any way to do it?
 
Hi All
Is there anyway to get notified about the user license expiration(salesforce,salesforce platform..) through email?

There is object 'UserLicense', but it doesnot have any details on expiration date to use it in workflow or process builder.

Would someone please suggest a way to get notified.
Thanks in advance
Hi

I have a requirement to launch a flow from lightning component using pagreference.
I was able to do it with WebPage pagereference type but domain name cant be consistant across the sandboxes.
So, trying to find out if we can navigate from a lightning page to a flow using lightning:navigation  
Hi All

I am facing this error 'Apex event trigger cannot handle batch operations on recurring event' when trying to update 102 event records through data loader.

Could someone please tell what recurring events mean and why dataloader is throwing error on update .

Thanks in advance.
Chaithaly.
Hi

I have a trigger on event for after update , and inside the trigger i have given the condition if(trigger.isupdate){//statements}.

The scenario is, I am creating an event record , the after update trigger is executing the statements inside isupdate block in the same transaction.

Kindly help if i am missiong something.

Thanks
 
Hi 
I have a visualforce page , where i need to display a text based on the picklist value .
<apex:outputPanel style="color:white"
       rendered="{!IF(Contact.Field1__c='value -WS 25 - A+',true,false)}" >
all other values are working fine except this value .
Please enlighten me if I am wrong.

Thanks
 
Hello,

I have this scenario where I have a child object called 'reserve__c'  for an 'opportunity' as a parent.

when a new opportunity is created ,I want to make sure user creates reserve__c record as well.
Can someone please help me with the solution! 

This is the trigger written to add the users to the opportunity team member related list


trigger oppTeammember2 on Opportunity (before insert) {
    
 
    list<opportunityteamMember> opp=new list<opportunityteamMember>();
user u=[select id from user where alias='cgowd' limit 1];
    for(opportunity o:trigger.new)
    {
        if(o.Amount>5000000)
        {
         opportunityteamMember o1=new opportunityteamMember();
           
             o1.TeamMemberRole='Account Manager';
            o1.userId=u.id;
            o1.OpportunityAccessLevel = 'All';
            o1.OpportunityId=o.id;
           
            opp.add(o1);
            
        }
         
        }
   insert opp;
            
    }

I am getting the error as:
oppTeammember2: execution of BeforeInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [OpportunityId]: [OpportunityId] Trigger.oppTeammember2: line 21, column 1
 Any help is appreciable 
Thank you