• Sathish Loganathan
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 9
    Replies
Hi,

I am facing the following issue:

Vf page embedded inside the pagelayout is not updating

Any suggestions would be highly appreciated.

Created a quick Action to call the Visual force page.

Visualforce page upates the child record values.

for example - Quote, Items.

I am calling the visualforce page from Quote that has to process the discount for the items.

After discount is applied. The total is upated on the Quote object and the value is refreshed on the lightning layout. But the details of the items that are embedded in the vf page are not getting refreshed.

Can you someone help me with suggestions ?

Regards,
Sathish Loganathan
Hi,

I am new to Lightning development.

Can someone help me with this:

I get undefined when I try to get the value of a formula field.

var EditPaymentsfieldValue = component.get('v.EditPaymentsRequired__c'); - < formula field.

If I refer other custom field, it is returning the value.

Regards,
Sathish Loganathan
Hi,

Help needed in creating a vf page which displays the input text field dynamically and update the related record based on the input.

For example:

User has an existing quote, with different products. Each product has a picklist field which is a unit of measurement field. 

Quote has products such as A,B,C,D etc.

Products details: A with UOM - units,
B with  UOM - package,
c with UOM - flat rate
and etc.

So when a user clicks a button, he gets the input field to enter based on the UOM related to the Quote.

For example something like this.

Quantity UOM
----------- Units 
----------- Number
_______ package

So if I enter 3 for units, 2 for number and 3 package. My quote's product quantity should be updated with the numbers which gave as input.

I am able to display the fields based on the UOM. but stuck in the part how to get the value and update in the controller.

Kindly please let me know a possible solution to acheive this.

Thanks in Advance.

Regards,
Sathish 
Hi,

Help needed in removing the text which is present after hyphen(--) from a TexBody (EmailMessage field). So my request is to copy only the new Email to case comment.

for Example:

Hello,

This is an example.

--- Original Message--

Previous Email Threads


Copy only "Hello,

This is an example."  to the case comment field.

Kindly please let me know a possible solution to acheive this.

Thanks in Advance.

Regards,
Sathish 
Hi Below is my Batch Class , Scheduler Class and Test Class for it. I don't know  what's wrong in the code, My class is not getting covered even 1 %. 

Please help

Batch Class:
-----------------
global class accountSalesUpdate implements Database.Batchable<sObject> {
    
    global final String query;
    
     global accountSalesUpdate( String q){
         query =q;
       //q='SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
         
    }   

global Database.QueryLocator start(Database.BatchableContext BC)
    {
        //String query = 'SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
        return Database.getQueryLocator(query);
    }   
   
    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
         Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('HE').getRecordTypeId();
         for(Account a : scope)
         {
             if(a.ParentId!=NULL && a.AccountStatusUpdate__c==False && a.RecordTypeId==recordTypeId){
             Account pid=[Select id,AccountStatusUpdate__c from Account where id=:a.ParentId];
                 List<Account> acc= new List<Account> ([Select id ,name, Account_Status_Technology__c,AccountStatusUpdate__c,RecordTypeId,Sales_Team__c,ParentId from Account where ParentId=:pid.id ]);
                 List<Account> accs1 = new List<Account>();
    for(Account ac1:acc){
        accs1.add(ac1); 
    } 
                
                for(Account accounts:accs1){
                     if(accounts.Account_Status_Technology__c=='Active'){
                         accounts.Sales_Team__c='Account Management';
                         pid.AccountStatusUpdate__c=True;
                          pid.Sales_Team__c='Account Management';
                          update pid;
                     }
                    else{
                        accounts.Sales_Team__c='Account Management';
                    }
                    if(accounts.Account_Status_Technology__c=='Inactive' && pid.AccountStatusUpdate__c==False){
                         accounts.Sales_Team__c='New Business';
                        pid.Sales_Team__c='New Business';
                        update pid;
                     }
                    
                 } 
                 update accs1;
                 }
                 }
                 
        
    }   
    global void finish(Database.BatchableContext BC)
    {
    }
}

Test Class:
-----------------------

@isTest
public class AccountSalesUpdateTest {
    
    public Static testmethod void accountUpdate(){
        Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('HE').getRecordTypeId();
        Account parent = New Account(Name ='Parent Account', RecordTypeId=recordTypeId,BillingStreet='Test',BillingCity='Test',BillingState='Test',BillingCountry='Test',BillingPostalCode='22311');
        insert parent;
        Account child1= new Account(Name='Child1',ParentId= parent.id,Account_Status_Technology__c='Active',RecordTypeId=recordTypeId,BillingStreet='Test',BillingCity='Test',BillingState='Test',BillingCountry='Test',BillingPostalCode='22311');
        insert child1;
        Account child2= new Account(Name='Child2',ParentId= parent.id,Account_Status_Technology__c='Inactive',RecordTypeId=recordTypeId,BillingStreet='Test',BillingCity='Test',BillingState='Test',BillingCountry='Test',BillingPostalCode='22311');
        insert child2;
        Test.startTest();
       // String query = 'SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
        accountSalesUpdate c = new accountSalesUpdate('SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account');
       Database.executeBatch(c);
        test.stopTest();
        
    } 
    
}

Scheduler Class:
-------------------------
global class accountSalesUpdateScheduler implements schedulable
{
    global void execute(SchedulableContext sc)
    {
    String query = 'SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
    accountSalesUpdate b = new accountSalesUpdate(query); 
      database.executebatch(b);
    }

 
I created a custom object Task Tracking with 3 custom fields:
1) Lookup to user object.
2) Number of open task (number field) 
3) Number if closed task (number field)
When a task is created by user A with let's stay status is IN PROGRESS, I need to create record in Task Tracking object record with these details :
1) Lookup field = user A
2) Number of open task = 1 
3) Number of closed task = 0;
Now next time, when same user A creates another task, the new Task Tracking record shouldn't be created but it should only increment/decrement Number of task field.

I have tried this much. I was able to create Task Tracking record whenever a Task is created but It was creating new Task Tracking Object for every Task that I am creating
trigger TrackTask2 on Task (before insert) { 
List<sujya__Task_Tracking__c> li = new List<sujya__Task_Tracking__c>(); 
sujya__Task_Tracking__c s = new sujya__Task_Tracking__c();
if(Trigger.isBefore && Trigger.isInsert){
 for(Task t:Trigger.new)
{
 s.sujya__User__c = t.CreatedById;
 li.add(s); 
} 
insert li; 
}
 }
Appreiciate your help :) 
 
Hi there, I've created a public class called RltdEnergyAudits that has a public method ExibirRelatedAudits. Looks like this:
 
public class RltdEnergyAudits 
{
    
    public static void ExibirRelatedAudits(List<Energy_Audit__c> Accounts)
    {
        system.debug('Exibir Audits');
    }

}


The class compiles with no errors. When I try to compile a trigger that has a call to the ExibirRelatedAudits method, I get the message "method does not exist or incorrect signature" on the line that calls the method. The trigger looks like this:
 
trigger AccountUpdate on Account (before update) 
{
    if(Trigger.isUpdate)
    {
        List<Account> listaAccounts = [SELECT ID from Account where Id in :Trigger.new];
        RltdEnergyAudits xx = new RltdEnergyAudits();
        xx.ExibirRelatedAudits(listaAccounts);
    }

}

I got error: Method does not exist or incorrect signature: void ExibirRelatedAudits(List<Account>) from the type RltdEnergyAudits

I tried also code bellow but same error:  

Method does not exist or incorrect signature: void ExibirRelatedAudits(List<Account>) from the type RltdEnergyAudits

trigger AccountUpdate on Account (before update) 
{
    if(Trigger.isUpdate)
    {
        List<Account> listaAccounts = [SELECT ID from Account where Id in :Trigger.new];
        RltdEnergyAudits.ExibirRelatedAudits(listaAccounts);
    }

}
Any guidance would be most appreciated. Thank you!
 
Hi,

I am new to Lightning development.

Can someone help me with this:

I get undefined when I try to get the value of a formula field.

var EditPaymentsfieldValue = component.get('v.EditPaymentsRequired__c'); - < formula field.

If I refer other custom field, it is returning the value.

Regards,
Sathish Loganathan
Hi Team,

Is it possible to display certain fields in the salesforce page layout based on the checkbox?
For eg if ChecboxField = TRUE
Show 10 fields in Page Layout.
if ChecboxField = FALSE
Show 5 fields in Page Layout.

I want to use the same Record Type.

Any constructive suggestion or feedback much appreciated!
Hello,

I am a newbie to Apex triggers and need an advice with the following requirement.

Requirement:

We need to have a report generated out of UserPackageLicense object to track number of managed package licenses being used. With my reasearch, I figured out reporting on UserPackageLicense object is not possible since it is not exposed in reporting.

Hence I decided to have a custom pick list at user object and whenever there is an update to a user object, I tried to fire a trigger to go and check UserPackageLicense object for that user and update the custom pick list in user object. I started with the below code to test

trigger UPackageLicense on User (before update) {
    List<UserPackageLicense> up =new List<UserPackageLicense>();
    for(User u : Trigger.new){
        u.Id=up.UserId;
        u.Trigger__c=up.UserId;
       Update u;
    }
}

But getting a below error
AfterUpdate caused by: System.FinalException: Record is read-only

Any help is much appreciated!

Thanks,
Hi,

Help needed in removing the text which is present after hyphen(--) from a TexBody (EmailMessage field). So my request is to copy only the new Email to case comment.

for Example:

Hello,

This is an example.

--- Original Message--

Previous Email Threads


Copy only "Hello,

This is an example."  to the case comment field.

Kindly please let me know a possible solution to acheive this.

Thanks in Advance.

Regards,
Sathish 
Hi Below is my Batch Class , Scheduler Class and Test Class for it. I don't know  what's wrong in the code, My class is not getting covered even 1 %. 

Please help

Batch Class:
-----------------
global class accountSalesUpdate implements Database.Batchable<sObject> {
    
    global final String query;
    
     global accountSalesUpdate( String q){
         query =q;
       //q='SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
         
    }   

global Database.QueryLocator start(Database.BatchableContext BC)
    {
        //String query = 'SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
        return Database.getQueryLocator(query);
    }   
   
    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
         Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('HE').getRecordTypeId();
         for(Account a : scope)
         {
             if(a.ParentId!=NULL && a.AccountStatusUpdate__c==False && a.RecordTypeId==recordTypeId){
             Account pid=[Select id,AccountStatusUpdate__c from Account where id=:a.ParentId];
                 List<Account> acc= new List<Account> ([Select id ,name, Account_Status_Technology__c,AccountStatusUpdate__c,RecordTypeId,Sales_Team__c,ParentId from Account where ParentId=:pid.id ]);
                 List<Account> accs1 = new List<Account>();
    for(Account ac1:acc){
        accs1.add(ac1); 
    } 
                
                for(Account accounts:accs1){
                     if(accounts.Account_Status_Technology__c=='Active'){
                         accounts.Sales_Team__c='Account Management';
                         pid.AccountStatusUpdate__c=True;
                          pid.Sales_Team__c='Account Management';
                          update pid;
                     }
                    else{
                        accounts.Sales_Team__c='Account Management';
                    }
                    if(accounts.Account_Status_Technology__c=='Inactive' && pid.AccountStatusUpdate__c==False){
                         accounts.Sales_Team__c='New Business';
                        pid.Sales_Team__c='New Business';
                        update pid;
                     }
                    
                 } 
                 update accs1;
                 }
                 }
                 
        
    }   
    global void finish(Database.BatchableContext BC)
    {
    }
}

Test Class:
-----------------------

@isTest
public class AccountSalesUpdateTest {
    
    public Static testmethod void accountUpdate(){
        Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('HE').getRecordTypeId();
        Account parent = New Account(Name ='Parent Account', RecordTypeId=recordTypeId,BillingStreet='Test',BillingCity='Test',BillingState='Test',BillingCountry='Test',BillingPostalCode='22311');
        insert parent;
        Account child1= new Account(Name='Child1',ParentId= parent.id,Account_Status_Technology__c='Active',RecordTypeId=recordTypeId,BillingStreet='Test',BillingCity='Test',BillingState='Test',BillingCountry='Test',BillingPostalCode='22311');
        insert child1;
        Account child2= new Account(Name='Child2',ParentId= parent.id,Account_Status_Technology__c='Inactive',RecordTypeId=recordTypeId,BillingStreet='Test',BillingCity='Test',BillingState='Test',BillingCountry='Test',BillingPostalCode='22311');
        insert child2;
        Test.startTest();
       // String query = 'SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
        accountSalesUpdate c = new accountSalesUpdate('SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account');
       Database.executeBatch(c);
        test.stopTest();
        
    } 
    
}

Scheduler Class:
-------------------------
global class accountSalesUpdateScheduler implements schedulable
{
    global void execute(SchedulableContext sc)
    {
    String query = 'SELECT Id,Name,ParentId,AccountStatusUpdate__c,RecordTypeId FROM Account';
    accountSalesUpdate b = new accountSalesUpdate(query); 
      database.executebatch(b);
    }