Q:

What i need is a trigger?

I'm beginner in salesforce.
So here is my question:
I have a custom field in Accounts where you can choose a day of the week.
When you create a register inside an account type i would like to update an Activity with that info.
How can i do that? Is it a trigger? How would it be?
Thanks all!

A:

There is a few things wrong with Ashas answer:

It is not handling multiple accounts being inserted or updated. It only works on the first one in the list
It is doing a SOQL query that is not needed

See the code below for a modified version of the code that will handle bulk creation of Accounts and will create a task for them all
trigger AccountAfter on Account (after insert) { // Only firing on accounts being inserted

    List <Task> lstTasks = new List<Task>();
    for (Account acc : Trigger.new) {
        if (acc.Day__c == 'Monday') {

            lstTasks.add(new Task(
                        Subject = 'Task for ' + acc.Day__c, 
                        Priority = 'Normal', 
                        WhatId = acc.Id));
        }
    }
    if (lstTasks.size() > 0) {
        insert lstTasks;
    }

}

A:

you can achieve by trigger and Peduo code is below.
trigger Activity on Account (after insert, after update) {

    Account myAccount=trigger.new[0]; 
    List <Account> lstAcc = new List <Account> ([select Id, name from Account where  Id =: myAccount.id and week__c = 'Monday']);
    List <Task> lstTasks = new List<Task>();
    for (Account oAcc : lstAcc)
    {
      task oTask = new Task();
      oTask.Subject = 'Other';
      oTask.Priority = 'Normal';
      oTask.WhatId = oAcc.Id;

     lstTasks.add(oTask);
    }
    upsert lstTasks;

}

