• Sumeet Kore 1
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Hi,
I wish to merge two pdf attachments into a single attachment of any object. Here I am trying to merge two attachments on single account object.
Any help would be appreciated.

 
Hi,

I want to Create a Visual force insert to be inserted as section for object Opportunity.
For each Provider__c in list  I want to create a row with a check box.
A button at the bottom called "Create Date Of Service Request"
On clicking the button I want to create one Dates_Of_Service_Verification__c object for each row.

I am stuck on how to create new objects of each provider records on button click?

This is my code so far.

<apex:page controller="CreateDateofServiceController">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="Provider List">
                <apex:inputCheckbox />
                {!providerList}
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!createObject}" value="Create Date of Service Request"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Controller :
public with sharing class CreateDateofServiceController {
    
    public List<String> providerList {get; private set;}
    
    String recordId = System.currentPageReference().getParameters().get('id');
    
    public CreateDateofServiceController() {
        
        providerList = new List<String>();
        Opportunity provider = [SELECT provider__c
                                FROM opportunity
                                WHERE Id =: recordId];
        providerList.addAll(provider.provider__c.split(';'));
    }
    
    public void createObject() {
        return;
    }
}
Hi,

Here is my code and I am getting error for DMLException and cannot change the setup object
trigger TransferInactiveUsers on User (after update) {
    Integer count = 0;
    List<ID> userids = new List<ID>();
    For (User usr : Trigger.new){
        if (Trigger.oldMap.get(usr.Id).IsActive == true)
            if(Trigger.newMap.get(usr.Id).IsActive == false)
            userids.add(usr.Id);
    }
    
    List<Account> acctList=[SELECT ID FROM Account WHERE OwnerId IN :userids];
    for(Account ac : acctList)
    {
        ac.OwnerId = System.Label.Owner_ID;
        count++;
    }
    
    update acctList;
    
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    mail.setSubject('Owners changed for records ');
    mail.setPlainTextBody('The Total number of records whose owner changed are :'+count);
    mail.toAddresses = new String[] { 'Label.Email_addr_one'};
        Messaging.SingleEmailMessage[] messages = new List<Messaging.SingleEmailMessage> {mail};
            Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
    
    if (results[0].success) {
        System.debug('The email was sent successfully.');
    } else {
        System.debug('The email failed to send: '+ results[0].errors[0].message);
    }
}
 
Hi,
I wish to merge two pdf attachments into a single attachment of any object. Here I am trying to merge two attachments on single account object.
Any help would be appreciated.

 
Hi,

Here is my code and I am getting error for DMLException and cannot change the setup object
trigger TransferInactiveUsers on User (after update) {
    Integer count = 0;
    List<ID> userids = new List<ID>();
    For (User usr : Trigger.new){
        if (Trigger.oldMap.get(usr.Id).IsActive == true)
            if(Trigger.newMap.get(usr.Id).IsActive == false)
            userids.add(usr.Id);
    }
    
    List<Account> acctList=[SELECT ID FROM Account WHERE OwnerId IN :userids];
    for(Account ac : acctList)
    {
        ac.OwnerId = System.Label.Owner_ID;
        count++;
    }
    
    update acctList;
    
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    mail.setSubject('Owners changed for records ');
    mail.setPlainTextBody('The Total number of records whose owner changed are :'+count);
    mail.toAddresses = new String[] { 'Label.Email_addr_one'};
        Messaging.SingleEmailMessage[] messages = new List<Messaging.SingleEmailMessage> {mail};
            Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
    
    if (results[0].success) {
        System.debug('The email was sent successfully.');
    } else {
        System.debug('The email failed to send: '+ results[0].errors[0].message);
    }
}