• sailaja majji 5
  • NEWBIE
  • 25 Points
  • Member since 2015

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

Below is the code in test class .

 Account acc= new Account( Name= 'testName', Phone ='0987654321', Customer_ID__c='111111111111' );
        insert acc;     
 Id recId2 =[Select Id from RecordType where DeveloperName = 'Card' ].ID;
        system.debug('rec Id2----'+recId2);
            
        Asset assetRec = new Asset(Name='test' ,AccountId = acc.Id, Asset_Number__c='123456789012345',Status='Inactive',RecordTypeId=recId2);
        insert assetRec;
      Asset assetRec2 = new Asset(Name='test2',AccountId = acc1.Id,  Asset_Number__c='456789123852741',Status='Active' );       
        insert assetRec2 ; 

This is giving an error "Invalid field RecordTypeId for SObject Asset"

I am runnign this as System Admin and have all required permissions for record Types
Running on version 37.0

Please help me understand if i am missing anything .

Thanks,
Sailaja
Hi All ,
System Admin profiles are not able to do Inline Edit of encrypted fields on salesforce .I am on summer 16 release
Are there any permission that are required to do this .

Thanks
 
Team ,

I have a requirement  .If a system admin is giving system admin access to another user ,then after 24 hours automaticaly it should be reverted back to original profile .

Can you give different approaches to achieve this  .

Here is my analysis .

I am thinking trigger best suits here ,not a workflow since we need previous profile value to revert it back with time based workflows ,we cant get the prior value of profile

In trigger i was thinking how to revert the profile after 24 hrs .How can  we schedule the time for the profile to revert the change (do we need to write apex class and schedule it thorugh scheduler .)

Please let me know your thoughts 

Thanks,

Team ,

I have a requirement  .If a system admin is giving system admin access to another user ,then after 24 hours automaticaly it should be reverted back to original profile .

Can you give different approaches to achieve this  .

Here is my analysis .

I am thinking trigger best suits here ,not a workflow since we need previous profile value to revert it back  .

In trigger i was thinking how to revert the profile after 24 hrs .How can  we schedule the time for the profile to revert the change (do we need to write apex class and schedule it thorugh scheduler .)

Please let me know your thoughts 

Thanks,




 

Hi All ,

I need suggestion on one of my requirement .
User should be able to associate multiple accounts(known as sposnors) to opportunites and 
And OOB anyways multiple opportunites can be associated to Accounts and to show all of the associated records both in accounts and opportunites

Below is the approach i followed

creating junction object with 2 MD relationships one with account and one with opportunity and provide the junction object layout to associate opportunity to accounts. This is serving my purpose but i just saw in some blogs suggesting to create one more look up relationship with Account in addition to MD's in the junction object so that the fields in both account and opportunity can be selected for the related lists   .I am not able to understand what purpose does the additional look up serves .

Can somebody please help me understand .

Thanks
Hi Team ,

I have got an issue with integration API.One of the integrated system is updating values for salesforce custom object using enterprise WSDL.
However some values are updated but some are blank .

Here are the things i have done to debug  from salesforce side .
1.I created a file and tried to upload with dataloader using integration user .The record successfully inserted with all values
2.Started the trace on salesforce side and could see that the moment Integration system is making a call the values which are shown as blank in UI is actually coming null in before trigger .The same is not the case when doing through data loader .
3.Verified if they are using the same API names as salesforce is expecting .That is all correct .

I  am not able to figure out why the values are not updated in salesforce .
can somebody help me on this .Any pointers would be really helpful .

Thanks,
developer



 
Hi  All ,

Can somebody  please help me out with the below problem .

There is an integration system with salesforce which is trying to update owner name on opportunity and receving below error .
"insufficient access rights on cross-reference id” 

Here is how they are assigning the name 
OPPORTUNITY.Owner.Name = “Oles”

I verified profile permissions and new Owner (Olsen )permissions  and everything seems to be in place .

Here is how the field is exposed in enterprise wsdl
  <element name="Owner" nillable="true" minOccurs="0" type="ens:User"/>

Any help would be greatly appreciated .

Thanks,
Sailaja

 
Hello,

I'm trying to update children records of an account when this one in edited but I keep having an error.
Here is my condition :
AND(CONTAINS([Account].Owner.Profile.Name, "emea"),
OR(ISPICKVAL([Account].emea_Prescriptor_Type__c , "Aiports Management"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Air Base"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport Authority"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport equipment"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Army"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Aviation"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Consultant Company and Architect"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Contractor"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Naval Base"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Parc of exhibition"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port Authority"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port concessionaire"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Ports operator")),
[Account].Must_be_visited_by_Airport_Port_Team__c)

The "[Account].Must_be_visited_by_Airport_Port_Team__c" is a boolean type so I don't know why it don't work correctly.
I also have another condition with NOT([Account].Must_be_visited_by_Airport_Port_Team__c) to test if the box is unchecked.

Thanks for your answers
Hi ,

Below is the code in test class .

 Account acc= new Account( Name= 'testName', Phone ='0987654321', Customer_ID__c='111111111111' );
        insert acc;     
 Id recId2 =[Select Id from RecordType where DeveloperName = 'Card' ].ID;
        system.debug('rec Id2----'+recId2);
            
        Asset assetRec = new Asset(Name='test' ,AccountId = acc.Id, Asset_Number__c='123456789012345',Status='Inactive',RecordTypeId=recId2);
        insert assetRec;
      Asset assetRec2 = new Asset(Name='test2',AccountId = acc1.Id,  Asset_Number__c='456789123852741',Status='Active' );       
        insert assetRec2 ; 

This is giving an error "Invalid field RecordTypeId for SObject Asset"

I am runnign this as System Admin and have all required permissions for record Types
Running on version 37.0

Please help me understand if i am missing anything .

Thanks,
Sailaja
Team ,

I have a requirement  .If a system admin is giving system admin access to another user ,then after 24 hours automaticaly it should be reverted back to original profile .

Can you give different approaches to achieve this  .

Here is my analysis .

I am thinking trigger best suits here ,not a workflow since we need previous profile value to revert it back with time based workflows ,we cant get the prior value of profile

In trigger i was thinking how to revert the profile after 24 hrs .How can  we schedule the time for the profile to revert the change (do we need to write apex class and schedule it thorugh scheduler .)

Please let me know your thoughts 

Thanks,

Team ,

I have a requirement  .If a system admin is giving system admin access to another user ,then after 24 hours automaticaly it should be reverted back to original profile .

Can you give different approaches to achieve this  .

Here is my analysis .

I am thinking trigger best suits here ,not a workflow since we need previous profile value to revert it back  .

In trigger i was thinking how to revert the profile after 24 hrs .How can  we schedule the time for the profile to revert the change (do we need to write apex class and schedule it thorugh scheduler .)

Please let me know your thoughts 

Thanks,




 

Hi,

I'm just wondering which order I should learn these in, and if it matters.

Thanks,
Wyatt
Here my requirment i giving some of my code in that contain if condition's are there i did not know how to write check the if conditions in test class.

if (imulist.size()==0) //&& cs.isCaseDeleted__c==false )
          { 
              updateselected = false;  
              updateseverity=false;
              ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please Select Atleast One Ticket '));
              return null;
          }
          
          else
          
          {
          
            for(case cs:cases)
            {
             if(cs.isCaseDeleted__c==true)
              {
               system.debug('##########'+cases);
               updateselected = true;
               tier.add(cs.Tier_Level__c ); 
      
               if (tier.size()>1)
               { 
                 updateselected = false;  
                 updateseverity=false;
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Tickets Must Have Same Tier Level '));
                 return null;
               }
                 else
              {
                 for(String name : tier)
                    {
                       fname = name;
                    }

                SMTPnew.Tier_Level__c = fname; 
             }
          
         
          }
          
          }
       
        }  
        
        
        
        
       //system.debug('imulist ####'+imulist);
          
     SMTPselected = false;
      //updateselected = true;
      selected1=true;
   
      //selectednew=true;
        return null;
      
      }
and one more thing is in the above code contain apexpage.addmessage() error messsage is there .How to cover this error message in test class please tell me
All,

I need help with Line 28, view below

User-added image

Am I writing my expression incorrectly?
Hi All ,

I need suggestion on one of my requirement .
User should be able to associate multiple accounts(known as sposnors) to opportunites and 
And OOB anyways multiple opportunites can be associated to Accounts and to show all of the associated records both in accounts and opportunites

Below is the approach i followed

creating junction object with 2 MD relationships one with account and one with opportunity and provide the junction object layout to associate opportunity to accounts. This is serving my purpose but i just saw in some blogs suggesting to create one more look up relationship with Account in addition to MD's in the junction object so that the fields in both account and opportunity can be selected for the related lists   .I am not able to understand what purpose does the additional look up serves .

Can somebody please help me understand .

Thanks
Hello all,

I write a test case for trigger, I got code coverage  72% but while pushing into production it showing code coverage is 0% need at least 1 %.

what was the issue please any solutions  
@isTest
public class TestSetIsCopiedToProjectFlagFalse {
static testmethod void TestTriggerIsCopiedToProjectFlag()
    {
      
     Ibanking_Project__c Obj = new  Ibanking_Project__c();      
     
        obj.Id='a0Bj00000031Gu6';
        delete obj;
     
          
        
      
    }
}

 
Hi Everyone,

I am seeing something strage,
I am trying to create a master detail relationship between two abjects the child object has existing data,so i tried 2 ways

1. created a lookup field,populated data in the records then tried to change the field type as master detail ,but no luck,then 
2. i have deleted all the records of the object on which i am trying to create a master detail relationship and tried to create a new master detail field but either ways i am seeing the error "you can not create M D on existing data,

i wonder where is the existing data when i have deleted all the records myself that too 1st i have deleted records in one object and then in both the objects
i have successfully M-D relationship lot of times but dont know why i am unable to do this now.

NOTE: i am not sure if this helps for your reference or not, i have only one standard name field and 1 custom lookup field on the object on which i was trying to create a M-D relationship,however later on i even tried after deleting all the records and that lookup field too and then tried creating a new M-D field because the object no more having any data but no use in all the ways i am seiing same error 

 
Ineed help withthe following Apex Trigger:

trigger ForceSourceCrossRef on Lead (before insert, before update ) {
   
    For (Lead l:Trigger.new) {        
        if(l.Source__c != null) {
           List<CrossRef__c> cr = new List<CrossRef__c>();
           cr = [Select Id from CrossRef__c WHERE
                   CrossRef__c.Name = :l.Source__c ORDER BY Id LIMIT 1];
              if(cr.size()>0){
                    cr.Source_Cross_Reference__c = cr[0].Id;
            }
        }
    }    
}

Attempting to update a custom lookup field on the Lead object called Source_Cross_Reference__c with the value that's imported in a Lead field called Source__c.  (Source__c is a picklist field.)  There is a custom object called CrossRef__c that uses the Source__c picklist value in the CrossRef__c.Name field.  I want to populate the Source_Cross_Reference__c field with the ID value from the CrossRef__c object.  The Devleoper Console is displaying the following Problem: "Initial term of field expression must be a concrete SObject: List&lt;CrossRef__c&gt;".. What is neededto correct this problem?  Will this trigger perform the update described earlier?
Hi  All ,

Can somebody  please help me out with the below problem .

There is an integration system with salesforce which is trying to update owner name on opportunity and receving below error .
"insufficient access rights on cross-reference id” 

Here is how they are assigning the name 
OPPORTUNITY.Owner.Name = “Oles”

I verified profile permissions and new Owner (Olsen )permissions  and everything seems to be in place .

Here is how the field is exposed in enterprise wsdl
  <element name="Owner" nillable="true" minOccurs="0" type="ens:User"/>

Any help would be greatly appreciated .

Thanks,
Sailaja

 

I want to deploy from sandbox to production using change set.  Is there a wayI can push my standard objects using change sets?

  • September 01, 2011
  • Like
  • 0