• samar
  • NEWBIE
  • 109 Points
  • Member since 2010

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 23
    Replies

I am new to creating triggers and was wondering if someone could help me create the following triggers...

 

When a case is assigned to a specific user (meaning it is owned by a queue) and the status is New, Review or Queue, then change Status to Assigned and update Engineer field to the Case Owner.

 

I was told this could be done with a workflow for every Engineer value... very time consuming.

----

 

Also, when the case Status is updated to Reassigned, update the case owner to the Engineer value.

 

More information may be needed so just let me know. 

 

Thanks

 

 

  • January 26, 2011
  • Like
  • 0

Hi,

 

I need to Update my custom fields in Account Object on Reports.

 

I have the query retrieving my data. After i check the condition i need to update my fields.

for one of the custom field it should be updated with the Opportunity ID. 

How should i retrieve it from the query and update the field.

 

And also it should Update as a 15 character ID. 

 

 

 

global class HF_Survey_OneMonth Implements Schedulable 
{
    
    global void execute(SchedulableContext sc)
    {
        sendSurvey();
    }
    
    
    
    public void SendSurvey()
    {
        List<Account> accToUpdate = [Select Survey_Opp_Id__c, Survey_Dt__c, Survey_Code__c, Name, Id
                                           From Account 
                                           where Id IN (Select AccountId from Opportunity o
                                               Where o.StageName='Active'
                                               AND o.Placmnt_Start_Date_Arrive__c < Last_N_days :30
                                               AND o.Placmnt_Start_Date_Arrive__c = Last_N_days :60)];                               
                    
          for(Account a : accToUpdate)
          {
             if(a.Survey_Code__c != 'HF1MoArv')
              {
                a.Survey_Code__c = 'HF1MoArv';
                a.Survey_Dt__c = Date.today().addDays(1);
              }
          }
                
    }
}   

 

 

Please Help.

Thank you.

hi Guys,

 

In one of my requirement

i want  to display record information when mouse is hovered

 

Please any one help me it's very urgent

  • January 03, 2011
  • Like
  • 0

Hi Everyone,

I have a requirement which required to remove newline character before validating the value in textarea. But formula TRIM function only remove white space and tabs unlike apex trim() function. Also I am unable to use SUBSTITILE as \n or \r is not identified in validation rule formula. Please kindly suggest me some way to identify or remove newline character.

 

Regards,

Samarjit

  • September 02, 2011
  • Like
  • 0

Hello guys,

I am facing a challenge while implementing the following scenario.

I want to restrict user to add more than one solution to a case.

My problem is that we can't write any trigger or validation rule in CaseSolution standard object. Is there any way we can restrict user to do this any how?

 

Thanks,

Samarjit

  • January 05, 2011
  • Like
  • 0

Hello guys,

I want to export my SFDC data using dataloader in batch mode using it's CLI. But I want the exported data in TSV(tab separated version/tab delimiter separated file). It is mentioned in the dataloader document that data can be exported in CSV and TSV format both. But I am still unable to find it how. If you guys have any idea then please guide me.

  • November 29, 2010
  • Like
  • 0

Hi,

What I am trying to do is like this. I have an object Quote__c and it has child Quote_Line__c. When I update the currency fields in quote__c it has to update the currency field in the children .So ,in the before update trigger of Quote__c I am trying to update the currency fields in children.But in the Quote__c I have some rollup summary fields. So consequently when the child object get updated it try to update the rollup summary fields in Quote__c(master).As a result it caught in the error 

 

System.DmlException: Update failed. First exception on row 0 with id a0dA0000000rAw4IAE; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = a0fA0000000ki1a) is currently in trigger ChangeQuoteCurrency, therefore it cannot recursively update itself: []

 

I tried some methods but I did not get success. I tried This option without any success.

 

Thanks

Samarjit

  • August 18, 2010
  • Like
  • 0

Hi Everyone,

I have a requirement which required to remove newline character before validating the value in textarea. But formula TRIM function only remove white space and tabs unlike apex trim() function. Also I am unable to use SUBSTITILE as \n or \r is not identified in validation rule formula. Please kindly suggest me some way to identify or remove newline character.

 

Regards,

Samarjit

  • September 02, 2011
  • Like
  • 0

Hi,

 

I am new to APEX development and have been trying every idea I can find from these forums to make this visualforce controller pass the test threshold. 

 

The controller simply holds values for contact information entered in a visual force page, creating a new row for each new entry, and then inserting all entries when done. 

 

I have gotten it up to 72% in testing. But without being able to add a contact Last Name i get the error "System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [LastName]: [LastName]"

 

On the other hand most attempts I have made to add a contact last name have not validated, producing a complie error, "Initial term of field expression must be a concrete SObject: LIST<Contact> at line 35 column 3."

 

Apex Code and TestMethod

 

 

public class multiContactInsert{

    public List<Contact> cont {get; set;}
    
    public multiContactInsert(){
        cont = new List<Contact>();
        cont.add(new Contact());
    }
    
    public void addrow(){
        cont.add(new Contact());
    }
    
    public PageReference save(){
        insert cont;
        PageReference home = new PageReference('/003?fcf=00B800000081Zoh');
        home.setRedirect(true);
        return home;
    }

///////////////////////
///TEST METHOD
//////////////////////


static testMethod void test()
{
  
  PageReference pageRef = Page.multiContactadd;
  Test.setCurrentPage(pageRef);

  multiContactInsert controller = new multiContactInsert();
  controller = new multiContactInsert();
  
  //controller.cont.LastName = 'Smith';
  // Not able to add lastname
  
  controller.addrow();

  controller.save();
}  



}

 

 

Here is the VisualForce page for reference.

 

 

<apex:page controller="multiContactInsert"
           sidebar="false">
    <apex:form >
        <apex:pageBlock >
        
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error"/>
            </apex:pageBlockButtons>
        
            <apex:pageBlockTable value="{!cont}" var="c" id="table">
                <apex:facet name="footer">
                    <apex:commandLink value="Add Another Contact" action="{!addRow}" rerender="table,error"/>
                </apex:facet>
                <apex:column headerValue="First Name">
                    <apex:inputField value="{!c.FirstName}"/>
                </apex:column>
                <apex:column headerValue="Last Name">
                    <apex:inputField value="{!c.LastName}"/>
                </apex:column>
                <apex:column headerValue="Preferred Phone">
                    <apex:inputField value="{!c.npe01__PreferredPhone__c}"/>
                </apex:column>    
                <apex:column headerValue="Home Phone">
                    <apex:inputField value="{!c.HomePhone}"/>
                </apex:column>      
                <apex:column headerValue="Mobile Phone">
                    <apex:inputField value="{!c.MobilePhone}"/>
                </apex:column>     
                <apex:column headerValue="Preferred Email">
                    <apex:inputField value="{!c.npe01__Preferred_Email__c}"/>
                </apex:column>                       
                <apex:column headerValue="Personal Email">
                    <apex:inputField value="{!c.npe01__HomeEmail__c}"/>
                </apex:column>      
                <apex:column headerValue="Relationship to MMP">
                    <apex:inputField value="{!c.Relationship_to_MMP__c}"/>
                </apex:column>                                               
            </apex:pageBlockTable>
            
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

Thanks, any help is greately appreciated.

 

I am new to creating triggers and was wondering if someone could help me create the following triggers...

 

When a case is assigned to a specific user (meaning it is owned by a queue) and the status is New, Review or Queue, then change Status to Assigned and update Engineer field to the Case Owner.

 

I was told this could be done with a workflow for every Engineer value... very time consuming.

----

 

Also, when the case Status is updated to Reassigned, update the case owner to the Engineer value.

 

More information may be needed so just let me know. 

 

Thanks

 

 

  • January 26, 2011
  • Like
  • 0

Hello guys,

I am facing a challenge while implementing the following scenario.

I want to restrict user to add more than one solution to a case.

My problem is that we can't write any trigger or validation rule in CaseSolution standard object. Is there any way we can restrict user to do this any how?

 

Thanks,

Samarjit

  • January 05, 2011
  • Like
  • 0

Hi,

 

I need to Update my custom fields in Account Object on Reports.

 

I have the query retrieving my data. After i check the condition i need to update my fields.

for one of the custom field it should be updated with the Opportunity ID. 

How should i retrieve it from the query and update the field.

 

And also it should Update as a 15 character ID. 

 

 

 

global class HF_Survey_OneMonth Implements Schedulable 
{
    
    global void execute(SchedulableContext sc)
    {
        sendSurvey();
    }
    
    
    
    public void SendSurvey()
    {
        List<Account> accToUpdate = [Select Survey_Opp_Id__c, Survey_Dt__c, Survey_Code__c, Name, Id
                                           From Account 
                                           where Id IN (Select AccountId from Opportunity o
                                               Where o.StageName='Active'
                                               AND o.Placmnt_Start_Date_Arrive__c < Last_N_days :30
                                               AND o.Placmnt_Start_Date_Arrive__c = Last_N_days :60)];                               
                    
          for(Account a : accToUpdate)
          {
             if(a.Survey_Code__c != 'HF1MoArv')
              {
                a.Survey_Code__c = 'HF1MoArv';
                a.Survey_Dt__c = Date.today().addDays(1);
              }
          }
                
    }
}   

 

 

Please Help.

Thank you.

Hi,

 

I have created a visualforce page where i am displaying all the Notes and Attachments.

 

With every record i have also used an Inputcheckbox.. i just want to determine the record id of the selected record on the checkbox click....

 

Hi All,

 

I have an employee object and it contains a field containing email address. I need to send emails to employees to the email address defined in each employee object instance. Can I do this task using the functionality available in the default application or do I need to code it?

 

Would be grateful if you are able to help me on this.

 

Thanks in advance.

 

 

Thanushka.

hi Guys,

 

In one of my requirement

i want  to display record information when mouse is hovered

 

Please any one help me it's very urgent

  • January 03, 2011
  • Like
  • 0

Good day, 

 

I trying to redirect to a custom object(myObject) page when user click on the button from custom VF page, MyObject detail page having required fields which have set in page layout. what i need is do not manual set the required field value and insert myObject into DB before redirect, anyone have idea how can i fulfill this requirement ?

 

the whole purpose and intention is:

in pageA , when user click a button, it bring user to MyObject detail page and some preset value from pageA will carry and fill into MyObject detail page.

 

Thank you !

 

 

public PageReference doSelectContact(){
		
String contactId = ApexPages.currentPage().getParameters().get('selectedContactId');

if(StringUtils.isNotBlank(contactId)){
			myObject= new myObject(); 
		}
//insert myObject;
PageReference myObjectPage= new ApexPages.StandardController(myObject).view();		

 

 

myObjectPage.setRedirect(true);
return myObjectPage;
}

 

 

  • January 02, 2011
  • Like
  • 0

Hi,

 

I am is having one custome object Created in my application. and i have Created Tab of that object...

 

Now i have created one visual force page i want to redirect to that same object. code is below

 

<apex:outputLink value="{!URLFOR('/a08/o')}">Dispute</apex:outputLink>

 

code works good but when installed package into another production org it will give me insufficent Previliges Error. because it is changes object tab id ('/a08/o') to ('003/o') .. 

 

i want to make url fix .... is it possible ????????

 

What to do in This case ??

Help me and Reply me ASPS.

  • December 30, 2011
  • Like
  • 0