• EMaster
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I have started using 'Flows' for the first time and have some questions about it:

1) Showing more than 200 records in a Dynamic Record Choice
I am trying to create a 'Dynamic Record Choice' that lists all Countries that exist in the custom Country__c object. However since there are over 200 records in this table (and the limit that 'Dynamic Record Choices' display is 200), I was trying to do a workaround I found online, by creating separate, smaller 'Dynamic Record Choice' lists, and then merging them.

So I tried to create a 'Dynamic Record Choice' that had all the countries listed from A to J and then another from K to Z, however I cannot seem to add an filter logic to the 'Dynamic Record Choice' to return all Countries whose 'Name' starts with A or B or C,etc. http://screencast.com/t/lPXzcvXg.

Is there any way i can do this, or another approach you can suggest to get my 200+ countries in a picklist for the flow?

2) Setting field value not ID
For the same 'Dynamic Record Choice, i am storing the value of it's ID field. I then use it when i create the new Account (step 2 of the flow) - i actually use it twice in that 'Record Create' step http://screencast.com/t/ZQU5K6lfC.

When it is used to set the 'Country__c' field on the Account, it works as expected (as that field is a lookup). However, when i use it for the 'BillingCountry' field, i want it to set the value of the 'Name' of the Country record, not the ID. Is there any way to do this?

3) Exiting a Flow
After a Flow is finished, how do i get it to return to the new record it just created?

I have tried doing this by adding a hyperlink label on the Finish screen to go to https://eu1.salesforce.com/{!NewAccountID}, however when this is clicked, it just loads the page in a new browser window, and leaves the Finish screen of the Flow open.

4) Replacing the New Account button
Is there any way to replace the 'New' button that appears in the 'Recent Accounts' list, with a custom button that launches this Flow? http://screencast.com/t/ZyrNCq9fF I do not want uses to create New Accounts using the standard process; i only want them to use this Flow. 
Hi

I would like to use the Salesforce Ideas feature on a public website, without the need to use the SF Customer Portal - is this possible, and if so, what is the process?

Basically, we dont use the Customer Portal, but have built our own online 'Client Portal' that 'Contacts' log into via custom credentials we have assigned in each 'Account' in SF. I want to incorporate the Ideas feature in that, so the Contacts can log in via our method and submit/vote Ideas.

I have found other similar requests online, dating back many years ago, and many refer to this page that apparently had the process, but it no longer exists: http://blogs.salesforce.com/ideas/2008/11/ideas-public-si.html

Thanks
 
Hi

I need to edit an existing Trigger on a custom object, and never having had previous experience with Apex code before, i need some help with it.

Basically what i am trying to achieve is, after a custom object is edited, i need to check a value of a field in that object, and if that field has a specific value, then i need to set the value of another field in that same object by doing a lookup to anoter object.

Here is a summary of the 2 custom objects:
User-added image

The logic i need to develop is, after the a record in License_Users__c is edited:
  1. If the value for License_Users__c.Calculate_Supported__c = "No"
    1. Do nothing (just continue on with the rest of the trigger)
  2. If the value for License_Users__c.Calculate_Supported__c = "Yes"
    1. ​Use the License_Users__c.Software_Type__c field to find the matching record in the Software__c object
    2. Get the Software__c.Version__c value for that matching record
    3. Put that value in the License_Users__c.Version_Maximum__c field for the original License_Users__c record

Below is the current Trigger. Can someone please help me on how to edit this to incorporate the above logic?
trigger LicenseUser_Trigger_SaveEdit on License_Users__c (before update, before insert, after insert) {
    if (trigger.isUpdate)
    {
        if (!Software_Webservice_Class.getIgnoreLicenseUserTrigger())
        {
            // Instantiate Map for processing
            Map<Id, Boolean> mapContactId = new Map<Id, Boolean>();
        
            // Get related Contacts
            for (License_Users__c newLicenseUser : Trigger.new) {
                mapContactId.put(newLicenseUser.Contact__c, true);
            }
            
            // Fill an array of related Contacts
            Contact[] relatedContact = [SELECT Id, Name, AccountId
                                          FROM Contact
                                         WHERE Id in :mapContactId.keySet()];
            
            // Logic to ensure Account & Contact is related. Else Error!
            // If no Account specified on Contact, then update Account to Client/Prospect.
            for (License_Users__c newLU : Trigger.new) {
                License_Users__c oldLU = Trigger.oldMap.get(newLU.Id);

                if ((oldLU.Version_Active__c != newLU.Version_Active__c) || (oldLU.Software_Type__c != newLU.Software_Type__c)
                || (oldLU.PCID__c != newLU.PCID__c) || (newLU.Registration_Number__c == '')) {
                    // Blank out Registration Number and call external webservice
                    newLU.Registration_Number__c = '';
                }
                
                if (newLU.Contact__c != null && oldLU.Contact__c != newLU.Contact__c)
                {               
                    for (Integer i = 0; i < relatedContact.size(); i++) 
                    {
                        if (relatedContact[i].Id == newLU.Contact__c) 
                        {
                            if (relatedContact[i].AccountId != null) 
                            {
                                if (relatedContact[i].AccountId != newLU.Account__c) 
                                    newLU.Contact__c.addError('Account/Contact are not related!');
                            } else {
                                relatedContact[i].AccountId = newLU.Account__c;
                            }
                        }
                    }   
                }
            }
            
            // Update(bulk) any Contact changes
            Database.UpsertResult[] updateResults = Database.Upsert(relatedContact, true);
        }   
    }  // end isUpdate

Many Thanks

When using the standard Lead 'Convert' function, and opting to create an Opportunity on conversion, i am receiving a 'required field' exception from my Opportunity Save Trigger.

 

I know what the error is - one of the custom Lookup fields on the 'Account' object is not getting set during the Lead Conversion process, and the Opportunity that is being created during such process needs that field. Therefore, i need to ensure that dureing the lead conversion process, this custom field is updated to the relevant value (it is a lookup to Contacts)

 

  • Am i correct in assuming a 'Before Insert' trigger needs to be added to the Account object, and if so, is there any way to make this trigger only execute if the Account is being inserted from a Lead Conversion?
    OR
  • Does a trigger need to be added on the Lead object, so it is executed on conversion?

 

I am new to force.com development and would like to create a VisualForce page to do the following: 

 

  • Create a list of Contact 'Names' related to an Account, filtered by a partcular checkbox field in the Contact.

 

I want to add that page to a Section in the Account Page layout.

 

Can anyone give me some hints/examples on how i would loop through the related Contacts, apply this filter, and return a list i can display on the VF page.

 

Thanks.

 

Hi

I need to edit an existing Trigger on a custom object, and never having had previous experience with Apex code before, i need some help with it.

Basically what i am trying to achieve is, after a custom object is edited, i need to check a value of a field in that object, and if that field has a specific value, then i need to set the value of another field in that same object by doing a lookup to anoter object.

Here is a summary of the 2 custom objects:
User-added image

The logic i need to develop is, after the a record in License_Users__c is edited:
  1. If the value for License_Users__c.Calculate_Supported__c = "No"
    1. Do nothing (just continue on with the rest of the trigger)
  2. If the value for License_Users__c.Calculate_Supported__c = "Yes"
    1. ​Use the License_Users__c.Software_Type__c field to find the matching record in the Software__c object
    2. Get the Software__c.Version__c value for that matching record
    3. Put that value in the License_Users__c.Version_Maximum__c field for the original License_Users__c record

Below is the current Trigger. Can someone please help me on how to edit this to incorporate the above logic?
trigger LicenseUser_Trigger_SaveEdit on License_Users__c (before update, before insert, after insert) {
    if (trigger.isUpdate)
    {
        if (!Software_Webservice_Class.getIgnoreLicenseUserTrigger())
        {
            // Instantiate Map for processing
            Map<Id, Boolean> mapContactId = new Map<Id, Boolean>();
        
            // Get related Contacts
            for (License_Users__c newLicenseUser : Trigger.new) {
                mapContactId.put(newLicenseUser.Contact__c, true);
            }
            
            // Fill an array of related Contacts
            Contact[] relatedContact = [SELECT Id, Name, AccountId
                                          FROM Contact
                                         WHERE Id in :mapContactId.keySet()];
            
            // Logic to ensure Account & Contact is related. Else Error!
            // If no Account specified on Contact, then update Account to Client/Prospect.
            for (License_Users__c newLU : Trigger.new) {
                License_Users__c oldLU = Trigger.oldMap.get(newLU.Id);

                if ((oldLU.Version_Active__c != newLU.Version_Active__c) || (oldLU.Software_Type__c != newLU.Software_Type__c)
                || (oldLU.PCID__c != newLU.PCID__c) || (newLU.Registration_Number__c == '')) {
                    // Blank out Registration Number and call external webservice
                    newLU.Registration_Number__c = '';
                }
                
                if (newLU.Contact__c != null && oldLU.Contact__c != newLU.Contact__c)
                {               
                    for (Integer i = 0; i < relatedContact.size(); i++) 
                    {
                        if (relatedContact[i].Id == newLU.Contact__c) 
                        {
                            if (relatedContact[i].AccountId != null) 
                            {
                                if (relatedContact[i].AccountId != newLU.Account__c) 
                                    newLU.Contact__c.addError('Account/Contact are not related!');
                            } else {
                                relatedContact[i].AccountId = newLU.Account__c;
                            }
                        }
                    }   
                }
            }
            
            // Update(bulk) any Contact changes
            Database.UpsertResult[] updateResults = Database.Upsert(relatedContact, true);
        }   
    }  // end isUpdate

Many Thanks

When using the standard Lead 'Convert' function, and opting to create an Opportunity on conversion, i am receiving a 'required field' exception from my Opportunity Save Trigger.

 

I know what the error is - one of the custom Lookup fields on the 'Account' object is not getting set during the Lead Conversion process, and the Opportunity that is being created during such process needs that field. Therefore, i need to ensure that dureing the lead conversion process, this custom field is updated to the relevant value (it is a lookup to Contacts)

 

  • Am i correct in assuming a 'Before Insert' trigger needs to be added to the Account object, and if so, is there any way to make this trigger only execute if the Account is being inserted from a Lead Conversion?
    OR
  • Does a trigger need to be added on the Lead object, so it is executed on conversion?

 

I am new to force.com development and would like to create a VisualForce page to do the following: 

 

  • Create a list of Contact 'Names' related to an Account, filtered by a partcular checkbox field in the Contact.

 

I want to add that page to a Section in the Account Page layout.

 

Can anyone give me some hints/examples on how i would loop through the related Contacts, apply this filter, and return a list i can display on the VF page.

 

Thanks.