• Begginer
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 24
    Replies
can we execute a trigger when a button say 'submit' which is on the VF page is clicked, then the trigger should create a record on testobj__c
is it possible to do so? if so could anyone help me with the approach 

Thanks in Advance.
Although the end date is not entered in, I receive the particular error, there is also a picklist on the object(X), the error only occurs for one picklist namely 'post: F' value for rest of the values it is allowing to save the record.

Thank in Advance
Hi all, 

I'm learning triggers in salesforce and want some advice on understanding how to write a trigger for below scenario. what is the approach?

There are two objects ObjectPar__c(Parent) and ObjectCh__c(child) having look-up relationship.

Summary:
ObjectPar__c has record types namely  "A" and "B".
ObjectPar__c has a field (currency) --> Myamount__c
ObjectPar__c has 2 picklislts --> Picklist_a__c and Pciklist_b__c( two values "checked" , "Received")
ObjectCh__c has a field(curreny_ --> amount__c)

Scenario:

if record type is either A||B and Picklst_a__c and picklist__b ("checked") (on parent) is selected and Myamount__c is not entered and record is saved, then user from the related list selects the child object and on the child object if amount__c(on ObjectCh__c(child object)) is blank or null, and saves the record and when user come to parent object and changes the Pciklist_b__c("Received ") then the trigger should fire.
Hi all, 

I'm learning triggers in salesforce and want some advice on understanding how to write a trigger for below scenario. what is the approach?

There are two objects ObjectPar__c(Parent) and ObjectCh__c(child) having look-up relationship.

Summary:
ObjectPar__c has record types namely  "A" and "B".
ObjectPar__c has a field (currency) --> Myamount__c
ObjectPar__c has 2 picklislts --> Picklist_a__c and Pciklist_b__c
ObjectCh__c has a field(curreny_ --> amount__c)

Scenario:

when amount__c(on ObjectCh__c(childobject)) is blank or null, and if record type is either A||B and Picklst_a__c and picklist__b (on parent) is selected then Myamount__c should be required it cannot be blank
 



Hi all, 

I'm learning triggers in salesforce and want some advice on understanding how to write a trigger for below scenario. what is the approach?
There are two objects Object1_c(Parent) and Object__c(child) having look-up relationship.

Summary:
Object__c has record types namely  "A" and "B".
Object__c has a field (currency) --> Myamount__c
Object__c has 2 picklislts --> Picklist_a__c and Pciklist_b__c
object1__c has a field(curreny_ --> amount__c

Scenario:

when amount__c(on Object1__c) is blank or null, and if record type is either A||B and Picklst_a__c and picklist__b is selected then Myamount__c should be required show be the error.

Thanks in advance.
 
I have custom picklist "object_type__c" and in that list when "other" value is selected popup should be dislpayed with message"You have seleceted other". How this can be achived?
Hi all,

Need help figuring out the issue.
I have a VFpage and there are 3tabs on it A B & C respectively, for a user 'X' ,when the user clicks on  C tab the error occures Argument Cannot be Null. The C tabs gives reports based on 2 objects Y and Z lets say are the objects. The issues in only in production it is working fine in sandbox and also the issue is only occuring for that particular user X. I have debuged the logs of the user X and the error is on VFRemoting --> Argument Cannot be Null. how can i slove this issue in prod?


Thanks in Advance.
Hi all,

Im new to salesforce and currently trying to understand test classes. could anyone help me with the test class for below code.
I wrote a bit of  test code and unable to complete the code coverage.

Thanks in Advance.

global class batchcs1 implements  Schedulable {

global void execute(SchedulableContext sc) {
  List<Task> tskLst = [select id,status,ActivityDate,whatid,what.name from Task where what.type='Opportunity' and  What.recordType.name in ('type1', 'type2') and subject like 'test Value%' and status != 'Lost' and ActivityDate >: Date.today().addDays(30)];   
  if(tskLst != null && !tskLst.isEmpty())
  {
    List<batchs__c>  emailLst = [select id,Emails__c from batchs__c];
           List<string> toAddressLst = new List<string>();
            if(emailLst != null && emailLst.size() >0)
             toAddressLst = emailLst[0].Emails__c.split(',');
             
  DateTime d = Date.Today()+1;
  String dateStr =  d.format('MM/dd/yyyy') ;  
   
  List<Messaging.SingleEmailMessage> msgLst = new List<Messaging.SingleEmailMessage>();
  Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
  semail.setToAddresses(toAddressLst);
  semail.setSubject(' Reminder Test ');
  String htmlBody = '<html><body> Date :'+dateStr+' <br/> <p>This is a reminder :</p> <br/> tblStr <br/><p></p><br/></body></html>';
       
  String table =  '<table border="1" width="60%"><tr style="background-color:#4BACC6;color:white;"><td width="20%" align="center">Opportunity Name</td><td width="14%" align="center">Due Date</td></tr>';
  for(Task tsk : tskLst)
 {
   DateTime dt1 = tsk.ActivityDate+1;   
  table += '<tr style="background-color: #D8D8D8">';  
  table += '<td align="left"><a href="'+URL.getSalesforceBaseUrl().toExternalForm() + '/' +tsk.whatid+'">'+tsk.what.name+'</a></td>';
  table += '<td align="left">' + dt1.format('MM/dd/yyyy') + '</td>';
  table += '</tr>';
 }
  table  = table + '</table>';
   htmlBody = htmlBody.replace('tblStr', table);
   semail.setHtmlBody(htmlBody);
   msgLst.add(semail);
   if(msgLst != null && !msgLst.isEmpty())
    Messaging.sendEmail(msgLst);
      
     }    
    }
 
}

--------------------------------------------------------------------------------------

@isTest
private class batchcs1test
{
    public static testmethod void TestOppurtunity()
     {
             RecordType rec = [select id,name from RecordType where name = 'Type1'];
             RecordType rec = [select id,name from RecordType where name = 'Type2'];
  Opportunity opty = new Opportunity(account='test',name='test oppty', SalesStage__c='Closed',status__c = 'Expired',closedate=System.Today());
            insert opty;

     test.startTest();
      
        batchcs1 mar = batchcs1 new ();
         String sch = '0 0 13 30 11 ?';
         system.schedule('Scheduled Job', sch, mar);
     
         test.stopTest();

}
Controllerclass

public class customwrappersample 
{
public List<customerwrapperclass> lstwrapper {get;set;}
public void LoadData()
{
lstwrapper = new list<customerwrapperclass>();
List<Account> lstaccounts = [select id, name, rating, phone, billingcity from account limit 10];
if(!lstaccounts.isEmpty)
 {
     for(account acc : lstaccounts)
     {
    
     lstwrapper.add(new customerwrapperclass(acc , false));
     
     }
 
 }
List<contact> lstcontacts = [select id, firstname, lastname, phone,email, mailingcity from contact limit 10];
if(!lstcontacts.isEmpty)
 {
     for(contact con: lstcontacts)
     {
     
     lstwrapper.add(new customerwrapperclass(con,false));
     
     }
 
 }
 List<lead> lstleads = [select id, firstname, lastname, phone,email, city from lead limit 10];
if(!lstleads.isEmpty)
 {
     for(lead ld: lstleads)
     {
     
     lstwrapper.add(new customerwrapperclass(ld,false));
     
     }
 
 }

}

}

 
Hi Everyone,

Im learning salesforce and  im unable to figure out how to implement the above program, can anyone help me with my querry?


Thanks in advance



Hi all, 

I'm learning triggers in salesforce and want some advice on understanding how to write a trigger for below scenario. what is the approach?
There are two objects Object1_c(Parent) and Object__c(child) having look-up relationship.

Summary:
Object__c has record types namely  "A" and "B".
Object__c has a field (currency) --> Myamount__c
Object__c has 2 picklislts --> Picklist_a__c and Pciklist_b__c
object1__c has a field(curreny_ --> amount__c

Scenario:

when amount__c(on Object1__c) is blank or null, and if record type is either A||B and Picklst_a__c and picklist__b is selected then Myamount__c should be required show be the error.

Thanks in advance.
 
can we execute a trigger when a button say 'submit' which is on the VF page is clicked, then the trigger should create a record on testobj__c
is it possible to do so? if so could anyone help me with the approach 

Thanks in Advance.
Hi all, 

I'm learning triggers in salesforce and want some advice on understanding how to write a trigger for below scenario. what is the approach?

There are two objects ObjectPar__c(Parent) and ObjectCh__c(child) having look-up relationship.

Summary:
ObjectPar__c has record types namely  "A" and "B".
ObjectPar__c has a field (currency) --> Myamount__c
ObjectPar__c has 2 picklislts --> Picklist_a__c and Pciklist_b__c( two values "checked" , "Received")
ObjectCh__c has a field(curreny_ --> amount__c)

Scenario:

if record type is either A||B and Picklst_a__c and picklist__b ("checked") (on parent) is selected and Myamount__c is not entered and record is saved, then user from the related list selects the child object and on the child object if amount__c(on ObjectCh__c(child object)) is blank or null, and saves the record and when user come to parent object and changes the Pciklist_b__c("Received ") then the trigger should fire.



Hi all, 

I'm learning triggers in salesforce and want some advice on understanding how to write a trigger for below scenario. what is the approach?
There are two objects Object1_c(Parent) and Object__c(child) having look-up relationship.

Summary:
Object__c has record types namely  "A" and "B".
Object__c has a field (currency) --> Myamount__c
Object__c has 2 picklislts --> Picklist_a__c and Pciklist_b__c
object1__c has a field(curreny_ --> amount__c

Scenario:

when amount__c(on Object1__c) is blank or null, and if record type is either A||B and Picklst_a__c and picklist__b is selected then Myamount__c should be required show be the error.

Thanks in advance.