• Fahad-Akhtar
  • NEWBIE
  • 400 Points
  • Member since 2015
  • Technology Architecture Manager
  • Accenture


  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 81
    Replies
Hi, 

Is it possible to expose visual workflow to customers through force.com site or customer communities? (Visual workflow's will perform operation on Contact, Account and Quote standard objects).

If standard objects are going to be an issues then custom objects can be implemented but main design consideration at this point is availability of visual workflow in force.com site and/or customer community. Really appreciate the community help!

Cheers,
Tariq
Hi,
I need help on writing test class for below trigger. I have wrote test class but not any coverage.
Trigger:
trigger sampleTrigger on Object1__c (After Update) {

 if((trigger.IsAfter) && (trigger.Isupdate))
  {
   list<Object1__c> object1List = trigger.new;
 
   list<Object2__c> object2List = new  list<Object2__c > ();
   list<Object2__c> oldObject2List =[select id,name,Marks__c from Object2__c where Object1__c=:trigger.new];
  
   for(Object1__c obj1: trigger.new)
   {
      for(Object2__c obj2:oldObject2List)
      {
    
       obj2.Marks__c=obj1.Marks__c;
          object2List.add(obj2);
      }   
   }
   
    Update object2List;
  
   }

}

______________
Test class:

@isTest
public class sampleTrigger_Test {
    public static testMethod void testUpdate(){
       
        Account acc = new Account(Name = 'Test');
        insert acc;
        Contact con  =new Contact( LastName = 'Test',  AccountId = acc.Id);
        insert Con;
        Order__c ord = new Order__c(Account__c = acc.Id, Contact__c = con.Id);
        insert ord;       
        Object1__c obj1 = new Object1__c(Marks__c = 10.00);
        insert tp;
       
        Object2__c obj2 = new Object2__c ( Name = 'Test',
                                                             Marks__c = 12.12,
                                                            Account__c = acc.Id,
                                                            Object1__c = obj1.Id); // Here object1 has relationship with obj2
        insert obj2;
        obj2.Marks__c = obj1.Marks__c;
        update obj2;
        }
}

Thanks in advance..
 I have  a user list. I need this user list to be passed to sendemail method, so that the user names are displayed in the email body as below:

 "There has been no activity from the following sales people of your team:
1. User1
2. User2
3.User 3 …….  "  


Could you please let me know as of how to achieve this/could yo send any relevent code which would be helpful.


 Thanks in adv
Our org is cleaning up some old objects. What is the best practice? I have 2 questions:
  1. Some dependencies I can think of are: Identifying dependencies such as Workflows or formula fields using these objects? Any other dependencies we should consider?
  2. Rather than manual, is there a way to search/export from eclipse, workbench for all workflows, formula fields that use these objects? 
  3. Whats the best way to mass-query date of last record created/modified for each of these old objects using API names? thanks.
Hello All,

We are using jenkins and SVN for source control. Below are the steps for the issue i am facing. Any help is greatly appreciated.
  1. I used the salesforce ANT tool to retrieve ALL workflow and pageLayout components from production.
  2. I used the retrived folder to deploy the same to production again.
  3. Error thrown: 
    1. Workflow - Question : Cannot create workflow directly; must create the CustomObject first
    2. Workflow - SocialPost : Cannot create workflow directly; must create the CustomObject first
    3. Workflow - Reply : Cannot create workflow directly; must create the CustomObject firs
    4. Page Layout - FeedItem-Feed Item Layout: Layout must have at least 1 section
    5. Page Layout - SocialPost-Social Post Layout: Layout must have at least 1 section
Please note: the page layouts and workflows are not custom, the look like standard ones since they are without the __c.
Hi, 

I'm new to salesforce and trying to develop a Visual Force page that will get inputs and send it somewhere, specifically to our web application where data sent will be going to process.

A simple illustration is;

If my application were to calculate a simple mathematical operation with inputs 11 + 5 these inputs will be send to my web app to where it will be processed and the result for it will be forwarded back to my salesforce app for display which is 16.

 What should be the best way to do it?

Thanks.
Is there a way to find out what is the total attachment size per object in salesforce?
I'm trying to cerate a  VF page and want to add dropdown list. The picklist values will be hardcoded and  do not depend on anything. When the form is submitted , I just want to mail the form values to an email address.  

Thanks for help.
  • July 24, 2015
  • Like
  • 0
Hi, we recently launched our re-designed website and now the "Web-to-Lead" is not working.  I receive this error code:
Reason: common.exception.SfdcSqlException: ORA-20096:
ORA-06512: at "DOC.CSAVEUTILS", line 211
ORA-06512: at "DOC.SLEAD", line 726
ORA-06512: at line 1
 
 
{call sLead.insert_leads(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
 
{call sLead.insert_leads(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
    Lead Capture Page: Not available.
Any thoughts?
Thanks
Doreen
HI, I have a Auto number field ({!Product_Brief__c.Name}). It will generate number after saving the page. If i put this field in my page before saving it will break my page. So i want show this output text field after saving, but i could not use rerendering option. Coz I already used it for editing the page. If i combine with it, it will not work is there any way i can do this. Thanks. 
<apex:page standardController="Product_Brief__c" sidebar="true" showHeader="true" extensions="gibco">
<apex:form id="theForm">
<apex:pageBlock id="myPanel">
<apex:pageBlockSection collapsible="false" title="Section 1: Custom Media Information (Required)" id="thePageBlockSection">
              
     <apex:outputText value="{!Product_Brief__c.Name}"></apex:outputText>
               
    <apex:inputField value="{!Product_Brief__c.Opportunity__r.Account.Name}" rendered="{!bEditMode}"/>
    <apex:outputField value="{!Product_Brief__c.Opportunity__r.Account.Name}" rendered="{!NOT(bEditMode)}"/>
    <apex:inputField value="{!Product_Brief__c.Customer_Number__c}" rendered="{!bEditMode}"/>
    <apex:outputField value="{!Product_Brief__c.Customer_Number__c}" rendered="{!NOT(bEditMode)}"/>
    <apex:inputField value="{!Product_Brief__c.Billing_Address__c}" rendered="{!bEditMode}"/>
    <apex:outputField value="{!Product_Brief__c.Billing_Address__c}" rendered="{!NOT(bEditMode)}"/>
    <apex:outputField value="{!Product_Brief__c.CreatedBy.Name}" rendered="{!NOT(bEditMode)}"/>
    <apex:inputField value="{!Product_Brief__c.Shipping_Address__c}" rendered="{!bEditMode}"/>
    <apex:outputField value="{!Product_Brief__c.Shipping_Address__c}" rendered="{!NOT(bEditMode)}"/></apex:pageBlockSection>

<apex:pageblockButtons >
   <apex:commandButton action="{!doToggleEditMode}" value="Edit" reRender="myPanel" rendered="{!NOT(bEditMode)}"/>
   <apex:commandButton action="{!doSave}" value="Save" reRender="myPanel" rendered="{!bEditMode}"/>
   <apex:commandButton value="Save" action="{!save}" id="c2" rendered="{!NOT(bEditMode)}"/>
   <apex:commandButton value="Print" onclick="window.print();" rendered="{!NOT(bEditMode)}"/>
   <apex:commandButton value="Cancel" action="{!Cancel}" rendered="{!NOT(bEditMode)}"/>
</apex:pageblockButtons>

Extention

public class gibco {
    
    public Product_Brief__c pb {get;set;}
    public User u {get;set;}
    
    private ApexPages.StandardController controller {get;set;}
    public boolean bUpdate {get;set;}
    public string loggedinUserId = UserInfo.getUserId();
    public User u2 = [Select ContactId From User where Id =: '005R0000001Y6h4'];
    
    public String ctId{
        get {
         //   if (ctId==null){
         //   if (bUpdate){
                  ctId = u2.ContactId;
         //       }
              return ctId;
         //   }
        }
        set;
    }
         
    Contact ct = [SELECT AccountId FROM Contact WHERE id=:ctId];
    public string getacct(){
        Account acct = [SELECT Name FROM Account WHERE id=:ct.AccountId];  
        return acct.Name;
        return null;
        }
         
    Opportunity opp = [SELECT Id FROM Opportunity WHERE AccountId=:ct.AccountId LIMIT 1];
    
/* *************** Edit Sec. ************************     */ 
    public Boolean bEditMode {
    get {
      if(bEditMode == null) {
          bEditmode = false;
          }
          return bEditMode;
      }
      set;
    }

    public PageReference doToggleEditMode() {
         bEditMode = !bEditMode;
            return null;
    }
    
    public PageReference doSave() {
        try {
        // Do your stuff to save your record
        controller.save();
        doToggleEditMode();
        }
        catch(Exception ex) {
        // Handle error
        }
    
        return null;
        }


Thanks
Hi All,

I have the below trigger which when few field update happens to contact record it sends a webservice callout. Now i want it to send a webservice call out even when the contact is created in salesforce, can anyone please help me in modying this trigger such that it sends callout after record is newly created in salesforce also and not only on updation like it is currently doing. It should send callout during both update and create actions. Thanks!!
 
trigger Contactcallout on Contact (after update) {
Map<Id, String> m = new Map<Id, String>();
list<Contact> validContacts = new list<Contact>();
set<ID> accIds = new set<ID>();
for (contact c : Trigger.new) {
    if(c.RecordTypeId == '012D0000000BaFA'){
        contact old = Trigger.oldMap.get(c.Id);
         if (c.Email != old.Email||c.FirstName!=old.FirstName||c.LastName!=old.LastName||c.phone!=old.phone||c.Title__c!=old.Title__c||c.status__c!=old.status__c||c.AccountID!=old.AccountID)
         {
             validContacts.add(c);
                accIds.add(c.accountid);
         }
     }
}
map<ID, Account> accMap;
if(!accIds.IsEmpty()) // guard condition for SOQL
    accMap = new map<ID, Account>([select name from account where id in :accIds]);

for (contact c : validContacts) {
    Account acc = accMap.get(c.AccountID);
    string accName = acc == null ? null : acc.Name;
    WebServiceCallout.sendNotification(c.Id,c.Email,c.FirstName,c.LastName,c.phone,c.Title__c,accName,c.status__c);
            
    
    }
}

Many thanks in advance
Abraham
I am using "addPushNotificationListener()" method in my VF page and below is my code 
<apex:page standardController="Case">
    <apex:includeScript value="/support/console/26.0/integration.js"/>    
    <script type="text/javascript">

        var eventHandler = function (result) {
            alert('There is a push notification of object: ' + result.Id);
         };
          alert('I am called');   
         //Add a push notification listener for Case and Account
         sforce.console.addPushNotificationListener(['Case'], eventHandler);
    </script>
</apex:page>

I have also enabled case object and case fields for push notificaiton in service cloud console app.

Thanks for your help in advance!
Hi, 

Is it possible to expose visual workflow to customers through force.com site or customer communities? (Visual workflow's will perform operation on Contact, Account and Quote standard objects).

If standard objects are going to be an issues then custom objects can be implemented but main design consideration at this point is availability of visual workflow in force.com site and/or customer community. Really appreciate the community help!

Cheers,
Tariq
I am trying to get the list of last 10 accounts viewed. The code seems to be working in sandbox and workbench but when I try deploying it in production, I get the error: No such column 'LastViewedDate' on entity 'Account'.

SELECT Id, Name, LastModifiedDate FROM account WHERE LastModifiedDate !=null ORDER BY LastViewedDate DESC limit 10


User-added image<apiVersion>31.0</apiVersion>
Greetings, 

  I have been struggling with achieve record version. My requirement is: system should create a new record by incrementing version number whenever a change made on record. Can anybody help me to achieve this functionlaity. Would be appreciated your help. 

Thanks,
Satya
In Workflow Rules we can define Time Based workflow actions , but when you select Every time record is created or Editied.
In Process builder , Scheduled Actions Appears only when you selected Wehn new Record is Created.

I was wondering , Scheduled Actions when it will be run , for Example.

I have a record has been created and I need a certain action to be executed when Record status is Changed to be Issued , like we need to to Send Email Notification Before 30 Days of Visa expiry.

How this will work on Process builder.

Thanks
Hello all,

First of all I say thank you guys for helping me on my earlier problem. For this task some limitations are there:-
1- Use only one query where ever you want.
2- You can not use sub-query for the problem.

Thank you all in advance.
Hi Floks,

Can any one please share the code(vf,controller) for Multi-select Custom lookup?

Thanks for taking time to help! 
  • September 12, 2015
  • Like
  • 0
I want to create an hour report with 5 mins interval on case object. How can I acheive this using custom formula. Whenever I refresh my refresh my dashbord it has to bring past one hour data with 5 mins interval. It would be really great if I get some help on this. 
  • September 11, 2015
  • Like
  • 0
Hi there i need some hel to create a formula to calculate coomission.
If a deal is 
<=49999 no commission
>=50000 to 99999 $100
>=100000 to 199999 $150
>=200000 to 299999 $200
>=300000 to 399999 $250
Hello. I have built a custom object in our instance of Salesforce that contains the standard note functionality. I would like to be able to have a workflow that will ping the creator of the record if someone enters a new note on the record. I did not see a way to do this with the standard workflow builder and I'm gussing some sort of code or formula will be needed? I would greatly appreciate any suggestions. Thanks!
Hi guys, I need you help with this strange scenario if you can suggest me anything.
We have same profile for Sales Reps and their Managers. We also have multiple record types and page layouts for Activities (Task and Events).
For one of the Record Type we dont want Sales Reps to have Delete Permission. Only thier Managers should be able to Delete Acitivites of this Record Type. We dont want to create seperate Profile for Managers and also dont want to write Trigger for this. Can you please suggest me anything to achieve this without new Profile and Trigger. 
Example: 
Profile Name: Sales Team
Users: Sales Reps        Managers     Directors
Object: Activity (Task and Events)
Record Type: A   B   C
Page Layout: A   B   C
For Record Type B we need to restrict Sales Reps to Delete these Activities but their Managers and above Role can Delete them. 
Sales Reps should still have the ability to Delete Activities of other Record Types A and C 
  • September 11, 2015
  • Like
  • 0
Hello Team,

We started the Project 1 year back, now almost everything is ready also we have huge data in the system. Now is it correct/good to enable Territory Management & Forecast Management in my project because now client is seeking for that.

Or else its better to implement those TM & FM by custom entities and custom functionalities.

Which one is the best option to enable, Please provide your suggestions.
Thanks!!
  • September 11, 2015
  • Like
  • 0
I create a custom object "Vente". This custom object have 2 lookups relation with 2 others custom objects "Mousse" and "Fourniture".
In my custom tab "Ventes" i need to create a picklist related to "Mousse" and "Fourniture". After that I can choose any field from the custom object selected.
For example: Related to [Mousse/Fourniture] [Fields]
 I have  a user list. I need this user list to be passed to sendemail method, so that the user names are displayed in the email body as below:

 "There has been no activity from the following sales people of your team:
1. User1
2. User2
3.User 3 …….  "  


Could you please let me know as of how to achieve this/could yo send any relevent code which would be helpful.


 Thanks in adv
Our org is cleaning up some old objects. What is the best practice? I have 2 questions:
  1. Some dependencies I can think of are: Identifying dependencies such as Workflows or formula fields using these objects? Any other dependencies we should consider?
  2. Rather than manual, is there a way to search/export from eclipse, workbench for all workflows, formula fields that use these objects? 
  3. Whats the best way to mass-query date of last record created/modified for each of these old objects using API names? thanks.
Hi, 
My requirement is like that:
1. We can add/remove any no.of column in table.
2. Position of column should be changable and in sorting order on tha basis of value in column/cell.

Please suggest some idea/workaround on it.