• Swapnil Patne
  • NEWBIE
  • 20 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 23
    Replies
Hi,

I am not a developer but trying to create an extension controller for activity history so as to display/pull account activity histrory/Event records on visualforce page filtered by specific record type activities. i.e. trying to apply filters in the class Activity_Type__c ='Value Pillar'  but doesn't work 

This code may be partially or completely wrong but can someone help me in the right direction with the code?

Here is the code that I have managed to get hold of from community and modified it a bit :


public class ActivityHistoryControllerExten {
    
    private final Account acct;
    
    // The extension constructor initializes the private member  
    // variable acct by using the getRecord method from the standard  
    // controller.
    
    public ActivityHistoryControllerExten(ApexPages.StandardController stdController) {
        this.acct = (Account)stdController.getRecord();
    }
    
    //this is the logic for the extension
    
    public String getName() {
        return 'ActivityHistoryControllerExten';
    }
        
    public Account getAccount() {
        return [select id, name, ownerid, (select subject from ActivityHistories 
                     where Activity_Type__c ='Value Pillar' ) subject //filter out marketing actvities 
                from account
                where id = :ApexPages.currentPage().getParameters().get('id')];
    }

}

Thanks in advance.

Swapnil 
Hi,
Need some help identifying what am I doing wrong here?

With below code, I am trying to display account field  inside the two block sections side by side but for some reasons fields don't show up. surely I am missing something here but can't figure it out. 

Please can someone help?

Code:
<apex:page standardController="Account" sidebar="false">
  <apex:form >
    <apex:pageBlock title="{!account.name}" >
       
           <apex:pageBlockButtons >
              <apex:commandButton value="Edit" action="{!edit}"/>
              <apex:commandButton value="Save" action="{!save}"/>
           </apex:pageBlockButtons>
      
        <apex:pageBlockSection title="Details">
           <apex:pageBlockTable value="{!Account}" var="a" columns="4" >
           <apex:column headerValue="Quantitative" />
           
            <apex:outputField value="{! Account.ownerid }" />
            <apex:outputField value="{! Account.Phone }"/>
            <apex:outputField value="{! Account.Name }"/>
            <apex:outputField value="{! Account.Industry }"/>
            <apex:outputField value="{! Account.Account_flag__c }"/>
            <apex:outputField value="{! Account.Tier_Bucket__c}"/>
            <apex:outputField value="{! Account.NPS__c }"/>
            <apex:outputField value="{! Account.M_A_activity__c}"/>
           </apex:pageBlockTable>
           
           <apex:pageBlockTable value="{!Account}" var="b">
               <apex:column headerValue="Qualitative"/>
            <apex:outputField value="{! Account.TL_score__c }"/>
            <apex:outputField value="{! Account.Missed_calls__c }"/>
            <apex:outputField value="{! Account.Adverse_financial_warnings__c }"/>
            <apex:outputField value="{! Account.Change_of_CEO__c }"/>
            <apex:outputField value="{! Account.Change_of_exec_sponsor__c }"/>
            <apex:inlineEditSupport event="ondblClick" />
            </apex:pageBlockTable>

        </apex:pageBlockSection>
     </apex:pageBlock>        
 </apex:form> 

Many thanks,
Swapnil
I have below code that displays accout detail in a block and different account related lists records in tabs. under those related list tabs I want to show records with specific record type. E.g we have 3 Opportunity record types- Record Type License, Record Type Delegate and Record Type Membership, so opportunity tab on VF page should only display 2 Record Types- License and Membership.

Does anyone know how to filter out unwanted record type from lists? Please can someone help?

Below is my code:

<apex:page standardController="Account" sidebar="false">
<apex:tabPanel >  
        <apex:tab label="Open Tasks" labelWidth="100">
            <apex:relatedList list="OpenActivities"/>
        </apex:tab>
        <apex:tab label="VPP's & PP's" labelWidth="100">
            <apex:relatedList list="Value_Pillars__r"/>
                </apex:tab>
        <apex:tab label="Event Registration" labelWidth="120">
            <apex:relatedList list="ActivityHistories"/>
        </apex:tab>
</apex:tabPanel> 
<apex:tabPanel >  
    <apex:tab label="Key Contacts" labelWidth="100">
        <apex:relatedList list="AccountContactRoles"/>
    </apex:tab>
    <apex:tab label="Opportunities">
        <apex:relatedList list="Opportunities"/>
    </apex:tab>
</apex:tabPanel> 
       
</apex:page>

Many thanks,
Swapnil
I am trying to create a simple visualforce email template that shows information from opportunity and opportunity field history, but struggling with the history fields.. Please can someone help me with the code?

The email will say..

Please note the revenue on this opportunity was updated. Changed Amount from xxx (old value) to xxx (new value).

Account name:  {!Account.Name}

Opportunity type: {!Opportunity.Type}

Opportunity owner: {!Opportunity.OwnerFullName}

Opportunity Name: {!Opportunity.Name}

Closed Date: {!Opportunity.CloseDate}

Total Amount: {!Opportunity.Total_Amount__c}

To see the old value, please click here- {!Opportunity.Link}

Many thanks,
Swapnil
Hi,

I've create a custom lookup field on Opportunity called "Contact__c"  which is used to tag the main contact on that opportunity, however the opportunity doesn't show up under contact because that contact is not a primary under contact roles.

So, how can we make the contact slected in lookup field as a primary contact under opportunity Contact Roles and assign  a default role? 

I understand it requires an apex trigger, so wondering if any one can help me with this?

Much appreciated.

Thanks,
Swapnil
Please can someone help me with how to create a trigger that will add or remove a contact into a specific campagin based on two picklist fields, one on contact object and second on account obbject.

If contact is tagged as CFL or C-Level and Account is active (yes) then add the contact to specific campaign. If account is not active ( = No) then do not add.
If contact is modified and untagged as CFL or C-Level and is a member of the campaign then remove contact from campaign.

If contact is 

Contact picklist field name: Member Tier Type 
Values: CFL, C-Level

Account pick list field name:  Active
Values: Yes, No 

Add contacts to campaign:
Campaign ID = 70111000000GTNQ

I hope someone can help.

Thanks,
Swapnil
Hi,

I hope someone can help me with this-

Auto populate a custom lookup field "Account_Name__C " on opportunity product lineitem with an "Account Name" from the opportunity object or possibliy from Account Object itself, needs to happen when a user selects the opportunity product and saves the record.

Please can someone advise?

Thanks,
Swapnil
Hi,

Need help on writing a trigger to copy details of contact fields from a specific contact to Account fields.

Logic:

If contact Member Suspended = No and SCM Member Type = CWL then,

Copy below field details from that contact to Account fields:

Contact Fields                      Account Fields         Data Type
Member Suspended   >>>      Active                        Picklist
Member Since           >>>      Member Since            Date Field
Date Last Renewed    >>>      Date Last Renewed    Date Field
Expiry Date               >>>      Expiry Date                Date Field
License Term            >>>       License Term             Picklist

Please could someone help me?

Thanks,
Swapnil

Hi,

 

I am looking for someone- developer- who could help me with integrating SF.com and Ektron platform. We currently have an existing API which gets data from Ektron and stores, updates SF.com data (contacts and leads) but we would like to extend the current functionality and improve the API- add more fields and get contact activity data from a community built on Ektron. Ofcourse it would be a paid job- if you are interested we can dicuss this in detail over the call. 

 

Regards,

Swapnil 

Hi,

 

I am looking for someone- developer- who could help me with integrating SF.com and Ektron platform. We currently have an existing API which gets data from Ektron and stores, updates SF.com data (contacts and leads) but we would like to extend the current functionality and improve the API- add more fields and get contact activity data from a community built on Ektron. Ofcourse it would be a paid job- if you are interested we can dicuss this in detail over the call. 

 

Regards,

Swapnil 

Hi,

 

Please can someone show me how to create a trigger that will initiates an action to add or remove a contact into a specific campagin based on picklist field value on contact object. 

 

Picklist Field Name: Add/Remove from Monthly Mailing list

Values: Add, Remove

 

Campaign Name: SCM World Monthly Mailing List

 

Logic:

If picklist value selected = "Add" , then add contact to campagin "SCM World Monthly Mailing List"

If picklist value selected = "Remove" , then remove contact from campaign "SCM World Monthly Mailing List"  

 

Please ask questions if it needs further clarification. 

 

Thanks,

Swapnil

 

Hi,

 

We have an API built to pull our customer data from our community site. It gets details of people ID and Profile data. However, it seems the following error is preventing the API from working- 

 

 

 

24/04/2013 01:03 Future Failed First error: Argument 1 cannot be null 0 0 0 Patne, Swapnil 24/04/2013 01:03 YMMainGetPeopleIdsFuture2 707W0000003O1WN

 

24/04/2013 01:00 Future Failed First error: Argument 1 cannot be null 0 0 0 Patne, Swapnil 24/04/2013 01:00 YMMainGetPeopleIdsFuture 707W0000003O1MU

 

 

Can anyone help me understand what does the error mean and how to resolve this to get the API working. Someone informed me that the ApexMethod GetPeopleIdsFutue in YMMain it requires two parameters- and I need to add two parameters to-  Boolean pIsTest, String pWebsiteId.

 

To be honest I don't know how to do that and what parameters to add. I am an Admin and my expertise is not in development, so can someone help me with the steps to resolve this?

 

 

Here is the YM Main code

 

 
 

/*
Available methods:
1) GetPeopleIdsFuture() - gets a list of peaple IDs and creates YM Import Lines records.
2) GetProfileData(YM_Import_Line__c pYMImportLine) - gets the profile data for the each record.
3) UpdateRelations(Contact pContact) - gets sub members and updates relations.
*/
global class YMMain
{
/*
GetPeopleIdsFuture() - gets a list of peaple IDs and creates YM Import Lines records. Each YM Import
Line contains thr Member ID at this stage and will be updated during the next step. This method is
called at YMGetPeopleIdsSchedulerContext class and runs ...
*/
@future(callout=true)
public static void GetPeopleIdsFuture(Boolean pIsTest, String pWebsiteId)
{
YMWrapper pYMWrapper = new YMWrapper();
Id pYMImportHeaderId;
List<String> pPeopleIds = new List<String>();
List<YM_Import_Line__c> pYMImportLines = new List<YM_Import_Line__c>();
YM_Import_Header__c pYMImportHeader;

// get the latest YM Import Header record
pYMImportHeaderId =
[
SELECT Id
FROM YM_Import_Header__c
ORDER BY YMStartDate__c DESC
LIMIT 1
].Id;

// get a list of Members IDs
if(!pIsTest)
{
pYMWrapper.GetPeopleIDs(pWebsiteId);
}
else
{
pYMWrapper.pResult.pHasError = false;
}

if(pYMWrapper.pResult.pHasError)
{
// update import header status
pYMImportHeader = new YM_Import_Header__c
(
Id = pYMImportHeaderId,
YMGetPeopleIdsStatus__c = 'Error',
YMGetPeopleIdsError__c = pYMWrapper.pResult.pErrorCode + ': ' + pYMWrapper.pResult.pErrorDescription
);
update pYMImportHeader;

return;
}
else
{
// update import header status
pYMImportHeader = new YM_Import_Header__c
(
Id = pYMImportHeaderId,
YMGetPeopleIdsStatus__c = 'Completed'
);
update pYMImportHeader;

// insert YM Import Lines records
pPeopleIds = pYMWrapper.pPeopleIds;
for(String pPeopleId : pPeopleIds)
{
pYMImportLines.add(new YM_Import_Line__c(YMMemberID__c = pPeopleId, YMImportHeader__c = pYMImportHeaderId));
}
insert pYMImportLines;
}
}

@future(callout=true)
public static void GetPeopleIdsFuture2(Boolean pIsTest, String pWebsiteId)
{
YMWrapper pYMWrapper = new YMWrapper();
Id pYMImportHeaderId;
List<String> pPeopleIds = new List<String>();
List<YM_Import_Line__c> pYMImportLines = new List<YM_Import_Line__c>();
YM_Import_Header__c pYMImportHeader;

// get the latest YM Import Header record
pYMImportHeaderId =
[
SELECT Id
FROM YM_Import_Header__c
ORDER BY YMStartDate__c DESC
LIMIT 1
].Id;

// get a list of Members IDs
if(!pIsTest)
{
pYMWrapper.GetPeopleIDs(pWebsiteId);
}
else
{
pYMWrapper.pResult.pHasError = false;
}

if(pYMWrapper.pResult.pHasError)
{
// update import header status
pYMImportHeader = new YM_Import_Header__c
(
Id = pYMImportHeaderId,
YMGetPeopleIdsStatus__c = 'Error',
YMGetPeopleIdsError__c = pYMWrapper.pResult.pErrorCode + ': ' + pYMWrapper.pResult.pErrorDescription
);
update pYMImportHeader;

return;
}
else
{
// insert YM Import Lines records
pPeopleIds = pYMWrapper.pPeopleIds;
for(String pPeopleId : pPeopleIds)
{
pYMImportLines.add(new YM_Import_Line__c(YMMemberID__c = pPeopleId, YMImportHeader__c = pYMImportHeaderId));
}
insert pYMImportLines;
}
}

/*
GetProfileData(YM_Import_Line__c pYMImportLine) - loops through all YM Import Lines and gets the profile
data for the each record (Member ID). It checks the following conditions:
- Is there a contact with the same Member Id in Salesforce.com?
YES - update the contact, NO - go to the next step
- Is there a contact with the same Member Email in Salesforce.com?
YES - update the contact, NO - go to the next step
- Is there an account with the same Name in Salesforce.com?
YES - insert the contact, NO - go to the next step
- Is there a lead with the same Member Id in Salesforce.com?
YES - update the lead, NO - go to the next step
- Is there a lead with the same Member Email in Salesforce.com?
YES - update the lead, NO - go to the next step
- create a new lead

It takes about 10 minutes to process 700 records. This method is called at
YMGetProfileDataBatchableContext class and runs ...
*/
public static void GetProfileData(YM_Import_Line__c pYMImportLine, Boolean isTest)
{
YMWrapper pYMWrapper = new YMWrapper();
String pMemberId, pMemberEmail, pMemberCompany;
YMWrapper.Member pMember = new YMWrapper.Member();
YM_Import_Line__c pYMImportLineToUpdate;
List<Contact> pContactsById = new List<Contact>();
List<Contact> pContactsByEmail = new List<Contact>();
List<Account> pAccounts = new List<Account>();
List<Lead> pLeadsById = new List<Lead>();
List<Lead> pLeadsByEmail = new List<Lead>();

// get a profile data
System.debug('TEST = ' + pYMImportLine.YMMemberID__c);
if(!isTest)
{
pYMWrapper.GetProfileData(pYMImportLine.YMMemberID__c);
}
else
{
pYMWrapper.pResult.pHasError = false;
pYMWrapper.pMember.pMemberID = 'TEST-TEST-TEST';
pYMWrapper.pMember.pEmail = 'TEST@TEST.TEST';
pYMWrapper.pMember.pCompany = 'My Company';
}

if(pYMWrapper.pResult.pHasError)
{
// update import line status
pYMImportLineToUpdate = new YM_Import_Line__c
(
Id = pYMImportLine.Id,
YMStatus__c = 'Error',
YMError__c = pYMWrapper.pResult.pErrorCode + ': ' + pYMWrapper.pResult.pErrorDescription
);
update pYMImportLineToUpdate;

return;
}
else
{
pMemberId = pYMWrapper.pMember.pMemberID;
pMemberEmail = pYMWrapper.pMember.pEmail;
pMemberCompany = pYMWrapper.pMember.pCompany;
pMember = pYMWrapper.pMember;

// select an existing contact by Member Id
pContactsById =
[
SELECT Id
FROM Contact
WHERE Yourmembership_id__c =: pMemberId
];

// select an existing contact by Email
pContactsByEmail =
[
SELECT Id
FROM Contact
WHERE Email =: pMemberEmail
];

// select an existing account by Name
pAccounts =
[
SELECT Id
FROM Account
WHERE Name =: pMemberCompany
];

// select an existing lead by Member Id
pLeadsById =
[
SELECT Id
FROM Lead
WHERE Yourmembership_id__c =: pMemberId
AND isConverted = false
];

// select an existing lead by Email
pLeadsByEmail =
[
SELECT Id
FROM Lead
WHERE Email =: pMemberEmail
AND isConverted = false
];

// Is there a contact with the same Member Id in Salesforce.com?
if(pContactsById.size() != 0 && pMemberId != null)
{
// update the existing contact
UpdateContact(pContactsById[0].Id, pMember, pYMImportLine.Id);
}
// Is there a contact with the same Member Email in Salesforce.com?
else if(pContactsByEmail.size() != 0 && pMemberEmail != null)
{
// update the existing contact
UpdateContact(pContactsByEmail[0].Id, pMember, pYMImportLine.Id);
}
// Is there an account with the same Name in Salesforce.com?
else if(pContactsById.size() == 0 && pContactsByEmail.size() == 0 && pLeadsById.size() == 0 && pLeadsByEmail.size() ==0 && pAccounts.size() != 0)
{
// create a new contact
InsertContact(pAccounts[0].Id, pMember, pYMImportLine.Id);
}
else
{
// Apply almost the same logic for a lead

// Is there a lead with the same Member Id in Salesforce.com?
if(pLeadsById.size() != 0 && pMemberId != null)
{
// update the existing lead
UpdateLead(pLeadsById[0].Id, pMember, pYMImportLine.Id);
}
// Is there a lead with the same Member Email in Salesforce.com?
else if (pLeadsByEmail.size() != 0 && pMemberEmail != null)
{
// update the existing lead
UpdateLead(pLeadsByEmail[0].Id, pMember, pYMImportLine.Id);
}
else
{
// create a new lead
InsertLead(pMember, pYMImportLine.Id);
}
}
}
}

 

 

Thank you,

Swapnil

 

Hi,

This is what I want to achieve, can you help?

Aim-   To create a new Event record after a Task record is created against a contact.

We have a webiste where contacts register for physical events- once a contact registers it creates an  Task against the contact in Salesforce with following fields updated- (All std fields)

Subject: Registered for xx event
Status: Completed
Priority: Low
Comments: Paid xx amount

Now, once this record is created in SF I would like to have a trigger set up to create an Event record assigned to the contact owner and associated to the Contact/Lead.

Fields to update:

Std fields-

Assigned To
 
  
Subject
 
Related To
 
Start
  
Name 
End
 
Phone
 
Location
 
Email
 


Custom Fields-

Event Record Type
Event Registration
Attendee Type
Pick list
Event Speaker
Check box
Registered For Event
Pick list
Presentation Topic
Text
Event Year
Pick list
Replaced By
Text
Registration Date
Date
  
Event Registration Status
Pick list
  
Event Attended
Pick list
  


How do i write a  trigger for this?

Please help me..

Regards,
Swapnil

Hi All,

 

I am trying to deactivate a trigger in production org deploying it through sanbox, but it fails to deactivate the trigger.

Below is the error code, could you please help me understand what the belwo error means and how to tackle the error code and resolve the issue?

 

DeleteRWClient.DelRecs() 

Type: Class Line:79 Column:1

Failure Message: "System.ListException: List index out of bounds: 0", Failure Stack Trace: "Class.DeleteRWClient.DelRecs: line 79, column 1"

 

ManageAppointments.CheckAll()

Type: Class  Line:71 Column: 5 

Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0062000000Knx2YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must add products to this opportunity before saving.: []", Failure Stack Trace: "Class.ManageAppointments.AddNew: line 715, column 1 Class.ManageAppointments.CheckAll: lin...

 

TriggerCodeCoverage.UPDATE_TOTALAPPS_FIXED_REMAINING()

Type: Class  Line:70 Column:1 

Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0062000000Knx2YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must add products to this opportunity before saving.: []", Failure Stack Trace: "Class.TriggerCodeCoverage.UPDATE_TOTALAPPS_FIXED_REMAINING: line 70, column 1"                       

 

Deploy ErrorAverage test coverage across all Apex Classes and Triggers is 67%, at least 75% test coverage is required.

 

Reagards

Swapnil

Sys Admin,

 

Hi All,

 

I am trying to deploy changes to Apex Classes in production org via sandbox using change sets.

But upon hitting validate button or test run, I am getting the following error-

System.ListException: List index out of bounds: 0, Stack Trace-Class.DeleteRWClient.DelRecs: line 79, column 1

 

I haven't got  clue about Apex Classes, the below codes were developed by someone else which unfortunately has errors and I am trying to fix it with your assistance. Can anyone guide me with this please, it would be a massive help.. 

 

public class DeleteRWClient
{
private string mstrSource;
public string mstrClientID;
private string mstrURL ;
public string mstrNoDel = '';
public string mstrClientName;
List<Opportunity> objListOppor = null;
List<RW_Client_Contact__c> objCM = null;

public DeleteRWClient(ApexPages.StandardController controller)
{
mstrClientID = ApexPages.currentPage().getParameters().get('ClientID');
List<RWClientMaster__c> objRWM = [SELECT NAME FROM RWClientMaster__c WHERE ID = : mstrClientID];
if(objRWM.size() !=0)
{
mstrClientName = objRWM[0].Name;
}
if(ApexPages.currentPage().getParameters().get('source') == null)
{
SourcePage='/apex/RWClientMaster?id=' + mstrClientID + '&sfdc.override=1&emessage=You cannot delete the Client, as it has associated Accounts and Contacts to it';
}
else
{
if(ApexPages.currentPage().getParameters().get('ContactID') != null)
{
objListOppor = [SELECT o.Contact__c From Opportunity o
WHERE o.Contact__c =: ApexPages.currentPage().getParameters().get('ContactID') ];
if(objListOppor .size() !=0)
{
mstrNoDel += 'You cannot delete the Contact, as it has associated Appointments set with this Contact Already';
}
else
{

mstrNoDel += 'Contact is no more associated with RWClient' + ' ' + mstrClientName;
}
}
else
{
mstrNoDel += 'You cannot delete the Client, as it has associated Accounts and Contacts to it';
}

SourcePage= ApexPages.currentPage().getParameters().get('source') + '&emessage=' + mstrNoDel;
}


}

public String SourcePage
{
get{return mstrSource;}
set{mstrSource = value;}
}


public DeleteRWClient()
{

}
public PageReference DeleteRec()
{
//return null;

objCM = [Select ID, r.ContactID__c From RW_Client_Contact__c r
WHERE r.ContactID__c =: ApexPages.currentPage().getParameters().get('ContactID')
AND r.RW_Client_Master__r.ID =:mstrClientID];
delete objCM ;
return new PageReference(SourcePage);
}
static testMethod void DelRecs()
{
List<RWClientMaster__c> objLstCl = [SELECT ID FROM RWClientMaster__c ORDER BY CREATEDDATE DESC LIMIT 1];
ApexPages.currentPage().getParameters().put('ClientID',objLstCl[0].ID );
ApexPages.currentPage().getParameters().put('source','');
List<RW_Client_Contact__c> objClCont = [Select r.ContactID__c, r.RW_Client_Master__c from RW_Client_Contact__c r
WHERE RW_Client_Master__c =:objLstCl[0].ID LIMIT 1];
ApexPages.currentPage().getParameters().put('ContactID',objClCont[0].ContactID__c);
ApexPages.StandardController controller;
DeleteRWClient objDw = new DeleteRWClient(controller);
DeleteRWClient objDw1 = new DeleteRWClient();

objDW.SourcePage = ApexPages.currentPage().getParameters().get('source');
objDW.mstrClientID = ApexPages.currentPage().getParameters().get('ClientID');

string strPage = objDW.DeleteRec().getUrl();

ApexPages.currentPage().getParameters().put('ClientID',objLstCl[0].ID );
ApexPages.currentPage().getParameters().put('source','rc');
ApexPages.currentPage().getParameters().put('ContactID',objClCont[0].ContactID__c);

objDw = new DeleteRWClient(controller);
objDw1 = new DeleteRWClient();

objDW.SourcePage = ApexPages.currentPage().getParameters().get('source');
objDW.mstrClientID = ApexPages.currentPage().getParameters().get('ClientID');

strPage = objDW.DeleteRec().getUrl();


}

}

 

Regards,

Swapnil

 

Hi,
Need some help identifying what am I doing wrong here?

With below code, I am trying to display account field  inside the two block sections side by side but for some reasons fields don't show up. surely I am missing something here but can't figure it out. 

Please can someone help?

Code:
<apex:page standardController="Account" sidebar="false">
  <apex:form >
    <apex:pageBlock title="{!account.name}" >
       
           <apex:pageBlockButtons >
              <apex:commandButton value="Edit" action="{!edit}"/>
              <apex:commandButton value="Save" action="{!save}"/>
           </apex:pageBlockButtons>
      
        <apex:pageBlockSection title="Details">
           <apex:pageBlockTable value="{!Account}" var="a" columns="4" >
           <apex:column headerValue="Quantitative" />
           
            <apex:outputField value="{! Account.ownerid }" />
            <apex:outputField value="{! Account.Phone }"/>
            <apex:outputField value="{! Account.Name }"/>
            <apex:outputField value="{! Account.Industry }"/>
            <apex:outputField value="{! Account.Account_flag__c }"/>
            <apex:outputField value="{! Account.Tier_Bucket__c}"/>
            <apex:outputField value="{! Account.NPS__c }"/>
            <apex:outputField value="{! Account.M_A_activity__c}"/>
           </apex:pageBlockTable>
           
           <apex:pageBlockTable value="{!Account}" var="b">
               <apex:column headerValue="Qualitative"/>
            <apex:outputField value="{! Account.TL_score__c }"/>
            <apex:outputField value="{! Account.Missed_calls__c }"/>
            <apex:outputField value="{! Account.Adverse_financial_warnings__c }"/>
            <apex:outputField value="{! Account.Change_of_CEO__c }"/>
            <apex:outputField value="{! Account.Change_of_exec_sponsor__c }"/>
            <apex:inlineEditSupport event="ondblClick" />
            </apex:pageBlockTable>

        </apex:pageBlockSection>
     </apex:pageBlock>        
 </apex:form> 

Many thanks,
Swapnil
I am trying to create a simple visualforce email template that shows information from opportunity and opportunity field history, but struggling with the history fields.. Please can someone help me with the code?

The email will say..

Please note the revenue on this opportunity was updated. Changed Amount from xxx (old value) to xxx (new value).

Account name:  {!Account.Name}

Opportunity type: {!Opportunity.Type}

Opportunity owner: {!Opportunity.OwnerFullName}

Opportunity Name: {!Opportunity.Name}

Closed Date: {!Opportunity.CloseDate}

Total Amount: {!Opportunity.Total_Amount__c}

To see the old value, please click here- {!Opportunity.Link}

Many thanks,
Swapnil
Hi,

I've create a custom lookup field on Opportunity called "Contact__c"  which is used to tag the main contact on that opportunity, however the opportunity doesn't show up under contact because that contact is not a primary under contact roles.

So, how can we make the contact slected in lookup field as a primary contact under opportunity Contact Roles and assign  a default role? 

I understand it requires an apex trigger, so wondering if any one can help me with this?

Much appreciated.

Thanks,
Swapnil
Hi,

I hope someone can help me with this-

Auto populate a custom lookup field "Account_Name__C " on opportunity product lineitem with an "Account Name" from the opportunity object or possibliy from Account Object itself, needs to happen when a user selects the opportunity product and saves the record.

Please can someone advise?

Thanks,
Swapnil
Hi,

Need help on writing a trigger to copy details of contact fields from a specific contact to Account fields.

Logic:

If contact Member Suspended = No and SCM Member Type = CWL then,

Copy below field details from that contact to Account fields:

Contact Fields                      Account Fields         Data Type
Member Suspended   >>>      Active                        Picklist
Member Since           >>>      Member Since            Date Field
Date Last Renewed    >>>      Date Last Renewed    Date Field
Expiry Date               >>>      Expiry Date                Date Field
License Term            >>>       License Term             Picklist

Please could someone help me?

Thanks,
Swapnil
Hi folks , 

Can any one help me on this requirement .

how can i Copy  address fields from corresponding account record to contact while saving.


Thanks in Advance .
  • January 24, 2014
  • Like
  • 0

Hi,

 

Please can someone show me how to create a trigger that will initiates an action to add or remove a contact into a specific campagin based on picklist field value on contact object. 

 

Picklist Field Name: Add/Remove from Monthly Mailing list

Values: Add, Remove

 

Campaign Name: SCM World Monthly Mailing List

 

Logic:

If picklist value selected = "Add" , then add contact to campagin "SCM World Monthly Mailing List"

If picklist value selected = "Remove" , then remove contact from campaign "SCM World Monthly Mailing List"  

 

Please ask questions if it needs further clarification. 

 

Thanks,

Swapnil

 

Hi,

 

I have a custom field on the opportunity object named 'contact__c'. This is a simple lookup field.

If populated I want a trigger that creates an Opportunity contact role for that same contact.

 

Any ideas?

 

I can update the contact__c field based on the primary contact role but I need this work the other way round.

 

Any ideas?

 

Thanks