Forum Replies Created

  • Hi Namrata

    global class batchForUserInput implements Database.Batchable<sObject> {
    global batchForUserInput(string inputUser){
    this.inputUser = inputUser;
    }
    global Database.QueryLocator start(Database.BatchableContext BC) {
    String query = 'SELECT Id,Name FROM inputUser';
    return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext BC, List<sObject> scope) {
    for(sObject a : scope)
    {
    a.Name = a.Name + 'Updated';
    }
    update scope;
    }

    global void finish(Database.BatchableContext BC) {
    }
    }

  • Rajan

    Member
    July 30, 2019 at 10:40 am in reply to: What is object specific action and how to create it?

    Hi Abhishek,

    Object-specific create actions create records that are automatically associated with related records. Object-specific actions are only available on page layouts for that object. For example, you can add the New Group Member action only to the group publisher layout.

    1 From the management settings for the object for which you want to create an action, go to Buttons, Links, and Actions.
    2 Click New Action.
    3 Select the type of action to create.
    4 Customize the action.
    A For a Create a Record action, select the type of object to create.
    i - If the object has more than one record type, select the one you want to use for records created through this action.
    ii - If the object for which you’re creating the action has more than one relationship with the target object, select the field you want to populate when a record is created. If the two objects have a master-detail relationship, you can’t select which field to populate. The master-detail Relationship field is selected by default, and you can’t change this setting.
    iii - You can’t choose Quote as a target object from Opportunity. However, you can still create quotes from an opportunity by going to the opportunity’s Quotes related list and clicking New.
    B For a Custom Visualforce action, select the Visualforce page, and then specify the height of the action window. The width is fixed.
    C For a Lightning Component action, select the component called by the action.
    D For a flow action, select the flow to render.
    5 Enter a label for the action. Users see this label as the name of the action.
    6 If necessary, change the name of the action. If you selected a standard label type in the previous step, you must enter the name.
    7 Type a description for the action.
    8 For a Create a Record or Log a Call action, select whether you want a feed item to be created when the action is completed.
    9 For a Create a Record, Update a Record, or Log a Call action, you can add a custom success message that displays after the action executes successfully.
    10 Optionally, click Change Icon to select a different icon for the action.
    11 Click Save.

  • Rajan

    Member
    June 24, 2019 at 11:48 am in reply to: Trigger to prevent Date Overlap #ApexTrigger

    Hi Suman,

    Create two map in your trigger to store start and end date corresponding to the register event of that window. So the first map will contain information about start date for each attendee and second map will store end date for each attendee. Now iterate over the event the attendee is trying to register, if the attendee is already in map and either start and end date of the event false between the start and end date from the map then throw the error other wise create a new entry in the start and end date map.

  • Rajan

    Member
    June 3, 2019 at 2:29 pm in reply to: How to Edit Multiple Records using cURL?

    Hi Parantap,

    You need to create  a PATCH request to Edit existing record in salesforce.

    Thanks,

    Rajan

Popular Salesforce Blogs