• Ummang Jain
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies
hey my triggerhandler is as follow 

public class WorkOrderTriggerHandler {    
    //Handles On Before UpDate event for this object.
    public static void onBeforeUpdate(List<Service_Order__c> orderList) {
        SubmitforApproval(orderList); 
    }
    
    // Checks if Submit for Approval is clicked then it change the Milestone of Project Phase
    public static void SubmitforApproval(List<Service_Order__c> orderList){
        list<Project_Phase__c> phaselist = new list<Project_Phase__c>();
        for(Service_Order__c workOrder : orderList){
            if(workOrder.IsSubmitforApproval__c){
                if(workOrder.Project_Phase__c != null){
                    Project_Phase__c phase = new Project_Phase__c( id = workOrder.Project_Phase__c);
                    phase.Milestone__c = 'Schedule Requested';
                    phaselist.add(phase);
                }
                workOrder.IsSubmitforApproval__c = false;
            }
        }
        
        update phaselist;
    }
}


Trigger :- 

trigger WorkOrder_Trigger on Service_Order__c (before update,after insert, after update) 
{
    // Handle Before Update event and calling the Handler method.
    if(trigger.isUpdate && trigger.isbefore) {
        WorkOrderTriggerHandler.onBeforeUpdate(Trigger.New);
    }
}

i need help with testclass for this can anyone please help 
hey how should i write test class for this controller

global class AutoCompleteLookupController {
    
    @RemoteAction
    global static SObject[] findSObjects(string obj, string qry,Integer recordCount,String accountId, string addFields) {
        // more than one field can be passed in the addFields parameter
        // split it into an array for later use
        List<String> fieldList;
        if (String.isNotBlank(addFields)) fieldList = addFields.split(',');
       // check to see if the object passed is valid
        Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
        Schema.SObjectType sot = gd.get(obj);
        if (sot == null) {
            // Object name not valid
            return null;
        }
        // create the filter text
        String filter = ' like \'%' + String.escapeSingleQuotes(qry) + '%\'';
        //begin building the dynamic soql query
        String soql = 'select id, Name';
        // if an additional field was passed in add it to the soql
        if (fieldList != null) {
            for (String s : fieldList) {
                soql += ', ' + s;
            }
        }
        // add the object and filter by name to the soql
       if(recordCount > 15){
          soql += ' from ' + obj + ' where Company__c =:accountId AND name' + filter;
       }else{
           soql += ' from ' + obj + ' where Company__c =:accountId';
       }
        // add the filter by additional fields to the soql
        if (fieldList != null && recordCount > 15) {
            for (String s : fieldList) {
                soql += ' or ' + s + filter;
            }
        }
        soql += ' order by Name limit 20';
        List<sObject> L = new List<sObject>();
        try {
            L = Database.query(soql);
        }
        catch (QueryException e) {
            return null;
        }
        return L;
   }
}



 
Hey this is my first page in visual force the scenario is following :- 

1. Create a VF page which can take parameter id of an user,
if no parameter is passed then it should take current logged in used id.
 
2 .Show all the accounts related to above user in drop down list (Label Accounts), Once the user select an account from drop down list, then show another drop down list (Label Notes) which should contain list of all the notes (Title) associated to that Account
 
3. Once user select notes record, it should display record values.
 
4. There should be edit button and once user clicks on edit, user should be able to edit it and save the same (this should happen only for records which are not private)
 
5. Edit button should not be displayed for Notes which are Private.
 
6. Place validations on drop down and record edit using apex page messages to show appropriate error and confirm message on successful edit.


 
Hey, so there is the scenario we are treating custom object contacts as student object we have field in that subject__c which is picklist, totalmarks__c and avgmarks__c(Average marks) then further we need to create marks as related list to contact which will have field subject_name__c and marksobtain__c so for that i created marks object as lookup to contact so now what will be trigger to update the field totalmarks__c and avgmarks__c in contact 
Hey im new to trigger im struck on the question
Create a tracking object which records deletion/ Updation /Addition of student object.(e.g Associated with class, unassociated , Deleted ,Email , Dob , Phone , Name field updated). Record both Old value and New Value.
Hey, so there is the scenario we are treating custom object contacts as student object we have field in that subject__c which is picklist, totalmarks__c and avgmarks__c(Average marks) then further we need to create marks as related list to contact which will have field subject_name__c and marksobtain__c so for that i created marks object as lookup to contact so now what will be trigger to update the field totalmarks__c and avgmarks__c in contact 
Hey im new to trigger im struck on the question
Create a tracking object which records deletion/ Updation /Addition of student object.(e.g Associated with class, unassociated , Deleted ,Email , Dob , Phone , Name field updated). Record both Old value and New Value.
hi all,

I urgently need to edit/delete a post made by me on this discussion forum...But its not allowing me to do so and pops up
saying that 'you cant delete this question as others are interested in it'.
There are no likes and no comments on it still i am unable  to delete it
Any help would be highly appreciated

Its very urgent,
Thanks,