• Charni Wiggins
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 24
    Replies
I'd like to launch a flow from a button on a vf page... it seems to be working when look at the page fusing the vf url (when logged into sf), but when I look at the site url, where I am using the public profile, I get the following error... I have seen this error for field permissions where I just need to grant the public profile the read access, is there an equivalent flow permission I need to give to the public profile to fix this?
User-added image
I have a simple VF page for a site, styles will not apply to a long text field that I display in either apex:outputtext or a even a div... The field just runs off the page - and does not respect width set by an outer container. Neither of the following will work (using word-break).. Please help!
 
<apex:outputField value="{!o.Description}" style="word-break: breakword;"></apex:outputField> 

<div class="slds-text-title_caps slds-p-top_small" style="word-break: breakword;">{!o.Description}</div>

 
I have a visualforce page which has a datatable displaying a list of records. I would like the last column in this table to be a button which opens a popup/modal which will show further detail of this record. What is the best way to achieve this?
I'm looking to create a couple of visualforce pages for a force.com site, and would like to be able to use Lightning styles. I can see the stylesheet has been applied when I test the VF page, but when I visit the site public url it is definitely classic!

Thank you
I have a trigger on the child object (event regs), which should update the Account on create/update/delete etc. I have an error so am unable to test at the moment, but also unsure if I am following the correct logic. Event regs are Account Contacts, so I only want to count an event where at least 1 related contact has been (if 2 contacts attended, this counts as one event). Please help with my error and logic

Trigger:
trigger CountEventTrigger on Event_Registrants__c(Before Update) {
    if(Trigger.isBefore && Trigger.isUpdate){
        CountEventRegs.CountEventRegs_method(Trigger.New);
    }    
}
Helper class:

public class CountEventRegs{
    public static void CountEventRegs_method(List<Account> accountList){
        set<Id> accountIds = new set<Id>();
        Map<Id, Integer> accountMap = new Map<Id, Integer>();
        for (Account acc : accountList) {
            accountIds.add(acc.Id);
            accountMap.put(acc.Id, 0);
        }
        if(accountIds.size() > 0){
            List<Event_Registrants__c> eventRegList = [SELECT Id, Contact__r.AccountId FROM Event_Registrants__c WHERE Contact__r.AccountId IN: accountIds LIMIT 10000];
            for (Event_Registrants__c regs : eventRegList) {
                if (accountMap.containsKey(regs.Contact__r.AccountId)){
                     accountMap.put(regs.Contact__r.AccountId,accountMap.get(regs.Contact__r.AccountId)+1);
                }
            }
        }
        for(Account accObj : accountList){
            accObj.Events_Attended__c = accountMap.get(accObj.Id);
        }
    }
}


Error: Method does not exist or incorrect signature: void CountEventRegs_method(List<Event_Registrants__c>) from the type CountEventRegs

 

Thank you!

I am trying to write a trigger on Account that is essentially a rollup of related records on the Contact level. Not the most confident with apex so just looking for some guidance.. 

I have created it from the Event Reg object and have a for soql loop to get all Event Reg records, including the Contact and Contacts AccountId, but am stuck at what to do now. 

Any help would be much appreciated! 

I would like to have a formula field show different values based on the last modified by user. 

We need last modified by to update on chatter posts as well as chatter comments, but comments does not update this field at the moment. 

Is there a possible workaround? I know we could build a custom object to do this but before we get stuck into that, if this could work with chatter, that would be great! 

Thank you
Hi all,

I have a flow that is just updating a few field values based on what is selected in screen elements and exisiting data. It seems to stop at the decision down one of the paths - Cand perm or Interim, and I'm not sure why - flow newbie so trying to get to grips with it still. Please let me know if I am overcomplicating too. 
User-added image

User-added image
User-added image
DEBUG:
User-added image

Thank you!
I have changed our compact layouts to not include the record name, now when we view the record in Outlook via the log email button, it doesn't show the persons name. Is it possible to set a custom compact layout for Outlook? We also have record types so will have to be on rec type basis.

Much appreciate any help! 
I have deployed 4 new VF pages, as well as lightning app pages to production. For some reason, only sys admins can see the vf pages despite them being add to enabled vf pages via the profile. Is there a permission I have missed? They have enable for lightning checked too on the vf page settings... 

Much appreciate any help, I am lost with this one! 
Hi All,

I have a simple Val rule that I can't get working...

Cut_Off_INTERNAL_USE_ONLY__c is a formula field created from CreatedDate, gets the 4th day of next month. I need users to not be able to edit after this date... 
 
AND( 
TODAY() > Cut_Off_INTERNAL_USE_ONLY__c, 
ISCHANGED( TR1__Salary__c ),
ISCHANGED( TR1__Fee_Percentage__c ),
ISCHANGED( Extras_Amount__c ),
$Profile.Name != "System Administrator (Finance)", 
$Profile.Name != "Cobalt Finance", 
$Profile.Name != "Talent Rover Administrator", 
$Profile.Name != "UK Manager Backbone" 
)

Appreciate any help! :)
 
I am trying to create a formula that adds a specified time to a date. It keeps returning empty at the moment for some reason. I need it for a process which will send an email at this datetime. This is what I have tried so far. 

Follow Up Time: Time 
Consent Email Sent: DateTime 
DATETIMEVALUE(TEXT( Consent_Email_Sent_INTERNAL_USE_ONLY__c ) +  TEXT(Follow_Up_Time__c))
DATETIMEVALUE(TEXT(Consent_Email_Sent_INTERNAL_USE_ONLY__c)&" "&TEXT(Follow_Up_Time__c))

Follow Up Time: Number 
Consent Email Sent: DateTime 
DATETIMEVALUE(TEXT(Consent_Email_Sent_INTERNAL_USE_ONLY__c) + TEXT(Follow_Up_Time__c) + ':00:00')

Much appreciate any help! 
Hi all,

I can't figure out why I have a syntax error for the following custom button, I just want it to have a link if the users profile name contains the word "Manager", and if not then have no link. (if there is another way to restrict buttons via a profile please let me know)

Button:

{!IF( CONTAINS({!$Profile.Name}, "Manager" ) , /apex/echosign_dev1__AgreementTemplateProcess?masterId={!Contact.Id}&templateID=a8r0Y000000XadDQAS, 0)}


{!$Profile.Name}, is what is highlighted when I click Check Syntax. 

Thank you in advance! 
Hi all,

Is there anyway to not show a visualforce page on a record if a certain field (picklist) has a specific value? Not much exprience with VF and have come across 'Rendered' but this controls elements of the VF page as I understand, not the whole page? Much appreciate any help. 
I would like to only allow access to the link on this button if users profile name contains Manager, I can't quite get it to work though, currently getting 'url does not exist error' even without the contains function... 

Button:

{!IF( $Profile.Name == 'System Administrator', '/apex/echosign_dev1__AgreementTemplateProcess?masterId={!Contact.Id}&templateID=a8r0Y000000Cbld&emailaddress={!Contact.TR1__Secondary_Email__c}', null)}
 

I am trying to construct a map of one object (c2g_codaCompany__C) name with another object (Journal_Stagings__c) id. But I am receiving one error, please help?

Invalid bind expression type of Journal_Staging__c for Id field of SObject c2g__codaCompany__c

Code: 

List<Journal_Staging__c> journals = new List<Journal_Staging__c>();
        // map to get all companies
        Map<Id, c2g__codaCompany__c> companies = New Map<Id, c2g__codaCompany__c>([Select Id, Name FROM c2g__codaCompany__c]);
        // for each company, create a journal, setting that company id on the journal - add this to list
        for(c2g__codaCompany__c c : companies.keySet()) {
			journals.add(new Journal_Staging__c(
            // set company lookup - only put id not name
			Company__c = c.Id));
		}
        // insert journals to get id for jlis
		insert journals;
        // map of company name to journal id
        List<Journal_Staging__c> getNewJournals = [Select Id, Name, Company__c FROM Journal_Staging__c];
        Map<String, Id> companyJournal = New Map<String, Id>();
        for(Journal_Staging__c j : [SELECT Name FROM c2g__codaCompany__c WHERE Id=: getNewJournals]) {
			companyJournal.put(j.Name, j.Id);
		}

I have tried t put together a batch class to update parent Account records with credit scores.. I need to make 2 list variables public so I am able to access them in the finish global batch method, how would I do this? I get errors all lines in the finish method... 

global class BatchCreditReportDelta implements Database.Batchable<sObject> {

    public static void runBatch() {
        BatchCreditReportDelta batch = new BatchCreditReportDelta();
        Database.executeBatch(batch);
    }

    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator(
            [SELECT Id, Name, Wholesale_Last_Month_Negative__c, Wholesale_This_Month_Negative__c, Wholesale_Last_Month_Positive__c, Wholesale_This_Month_Positive__c, VoIP_Last_Month_Negative__c, VoIP_This_Month_Negative__c, VoIP_Last_Month_Positive__c, VoIP_This_Month_Positive__c, (SELECT Name, Credit__c FROM Voip_IDs__r), (SELECT Name, Credit__c FROM Wholesale__r) FROM Account WHERE Account_Branding__c != null ]);
    }

    global void execute(Database.BatchableContext bc, List <Account> scope) {
        // create 2 lists to split negative and positive scores
        List <Account> popNegScores = new List <Account>();
    	List <Account> popPosScores = new List <Account>();
        // List to get VoIP values - should this be map instead? 
        List <VoIP_ID__c> voips = new List<VoIP_ID__c>();
        // List to get Wholesale values - should this be map instead?
        List <Wholesale__c> whsale = new List<Wholesale__c>(); 
        for (Account acc: scope) {
            // populate voip values
            for (VoIP_ID__c v : acc.VoIP_IDs__r) {
                // if scores below zero, assign to neg list
				if (v.Credit__c < 0) {
                    popNegScores.add(new Account(
                    // populate scores on account record
                    id = v.id,
                    VoIP_Last_Month_Negative__c = v.credit__c));
                }
                // what about values = 0? 
                else {
					popPosScores.add(new Account(
                    // populate scores on account record
                    id = v.id,
                    VoIP_Last_Month_Positive__c = v.credit__c));
				}
            }
            for (Wholesale__c w : acc.Wholesale__r) {
                // for negative wholesale values, assign to account
                if (w.Credit__c < 0) {
                    popNegScores.add(new Account(
					id = w.id,
                    Wholesale_Last_Month_Negative__c = w.credit__c));
				}
                // for positive values, assign to account (what about values = 0?)
                else {
					popPosScores.add(new Account(
					id = w.id,
                    Wholesale_Last_Month_Positive__c = w.credit__c));
				}
			}
        }
    }
    global void finish(Database.BatchableContext bc) {
        // do updates in here
        update popNegScores;
        update popPosScores;
        // print out lists
        System.debug(popNegScores);
        System.debug(popPosScores);
    }
}
Thank you!

I am trying to write a batch job that will take values from one field (if another date field falls in the previous month) and populate a new field on the same object, account. However I am getting the error: Variable does not exist: lastRefreshedDate (it is probably something really simple - not the most confident person in Apex). Thanks

Class

global class BatchCreditSafeDelta implements Database.Batchable<SObject> {
    
    DateTime lastRefreshedDate = System.Today().addMonths(-1);

	public static void runBatch() {
        BatchCreditSafeDelta batch = new BatchCreditSafeDelta();
        Database.executeBatch(batch);
    }

    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator(
            [SELECT Id, Name, bottomline__creditSafeScore__c, bottomline__creditSafeLastRefreshed__c, last_month_creditSafe_Score__c 
			FROM Account WHERE bottomline__creditSafeLastRefreshed__c = LAST_MONTH ]);
    }

    global void execute(Database.BatchableContext bc, List <Account> scope) {
        List <Account> populateLastMonthScores = new List <Account>();
        for (Account acc: scope) {
            populateLastMonthScores.add(new Account(
                id = acc.id,
                Last_Month_CreditSafe_Score__c = acc.bottomline__creditSafeScore__c));
        }
        update populateLastMonthScores;
    }
    global void finish(Database.BatchableContext bc) {}
}

TestClass

@isTest public class BatchCreditSafeDeltaTest {
    @isTest static void batchTest() {
        
        sObjectFactory f1 = new sObjectFactory();
        Map<Id, Account> Accounts = new Map<Id, Account>();

        for (Integer i=0; i<10; i++) {
            Account a = (Account) f1.get( new Account(
                name = 'Account ' + i,
                bottomline__creditSafeScore__c = i,
                Last_Month_CreditSafe_Score__c = null,
                // change to one month before today
                bottomline__creditSafeLastRefreshed__c = lastRefreshedDate
            ));
            Accounts.put(a.id, a);
        }

        Set<Id> ids = Accounts.keyset();

        Test.startTest();
            BatchCreditSafeDelta.runBatch();
        Test.stopTest();

        Map<Id, Account> Accounts2 = new Map<Id, Account>();
        for (Account a : [SELECT Id, Name, Last_Month_CreditSafe_Score__c, bottomline__creditSafeLastRefreshed__c, bottomline__creditSafeScore__c,
                            creditSafe_Score_delta__c FROM Account WHERE ID IN :ids])

        {
            System.assertEquals( a.Last_Month_CreditSafe_Score__c, a.bottomline__creditSafeScore__c);
            System.assertEquals( a.CreditSafe_Score_Delta__c != null,  a.CreditSafe_Score_Delta__c != null);
        }       
    }
}
I'd like to launch a flow from a button on a vf page... it seems to be working when look at the page fusing the vf url (when logged into sf), but when I look at the site url, where I am using the public profile, I get the following error... I have seen this error for field permissions where I just need to grant the public profile the read access, is there an equivalent flow permission I need to give to the public profile to fix this?
User-added image
I have a trigger on the child object (event regs), which should update the Account on create/update/delete etc. I have an error so am unable to test at the moment, but also unsure if I am following the correct logic. Event regs are Account Contacts, so I only want to count an event where at least 1 related contact has been (if 2 contacts attended, this counts as one event). Please help with my error and logic

Trigger:
trigger CountEventTrigger on Event_Registrants__c(Before Update) {
    if(Trigger.isBefore && Trigger.isUpdate){
        CountEventRegs.CountEventRegs_method(Trigger.New);
    }    
}
Helper class:

public class CountEventRegs{
    public static void CountEventRegs_method(List<Account> accountList){
        set<Id> accountIds = new set<Id>();
        Map<Id, Integer> accountMap = new Map<Id, Integer>();
        for (Account acc : accountList) {
            accountIds.add(acc.Id);
            accountMap.put(acc.Id, 0);
        }
        if(accountIds.size() > 0){
            List<Event_Registrants__c> eventRegList = [SELECT Id, Contact__r.AccountId FROM Event_Registrants__c WHERE Contact__r.AccountId IN: accountIds LIMIT 10000];
            for (Event_Registrants__c regs : eventRegList) {
                if (accountMap.containsKey(regs.Contact__r.AccountId)){
                     accountMap.put(regs.Contact__r.AccountId,accountMap.get(regs.Contact__r.AccountId)+1);
                }
            }
        }
        for(Account accObj : accountList){
            accObj.Events_Attended__c = accountMap.get(accObj.Id);
        }
    }
}


Error: Method does not exist or incorrect signature: void CountEventRegs_method(List<Event_Registrants__c>) from the type CountEventRegs

 

Thank you!

I am trying to write a trigger on Account that is essentially a rollup of related records on the Contact level. Not the most confident with apex so just looking for some guidance.. 

I have created it from the Event Reg object and have a for soql loop to get all Event Reg records, including the Contact and Contacts AccountId, but am stuck at what to do now. 

Any help would be much appreciated! 

I have deployed 4 new VF pages, as well as lightning app pages to production. For some reason, only sys admins can see the vf pages despite them being add to enabled vf pages via the profile. Is there a permission I have missed? They have enable for lightning checked too on the vf page settings... 

Much appreciate any help, I am lost with this one! 
Hi All,

I have a simple Val rule that I can't get working...

Cut_Off_INTERNAL_USE_ONLY__c is a formula field created from CreatedDate, gets the 4th day of next month. I need users to not be able to edit after this date... 
 
AND( 
TODAY() > Cut_Off_INTERNAL_USE_ONLY__c, 
ISCHANGED( TR1__Salary__c ),
ISCHANGED( TR1__Fee_Percentage__c ),
ISCHANGED( Extras_Amount__c ),
$Profile.Name != "System Administrator (Finance)", 
$Profile.Name != "Cobalt Finance", 
$Profile.Name != "Talent Rover Administrator", 
$Profile.Name != "UK Manager Backbone" 
)

Appreciate any help! :)
 
I am trying to create a formula that adds a specified time to a date. It keeps returning empty at the moment for some reason. I need it for a process which will send an email at this datetime. This is what I have tried so far. 

Follow Up Time: Time 
Consent Email Sent: DateTime 
DATETIMEVALUE(TEXT( Consent_Email_Sent_INTERNAL_USE_ONLY__c ) +  TEXT(Follow_Up_Time__c))
DATETIMEVALUE(TEXT(Consent_Email_Sent_INTERNAL_USE_ONLY__c)&" "&TEXT(Follow_Up_Time__c))

Follow Up Time: Number 
Consent Email Sent: DateTime 
DATETIMEVALUE(TEXT(Consent_Email_Sent_INTERNAL_USE_ONLY__c) + TEXT(Follow_Up_Time__c) + ':00:00')

Much appreciate any help! 
Hi all,

Is there anyway to not show a visualforce page on a record if a certain field (picklist) has a specific value? Not much exprience with VF and have come across 'Rendered' but this controls elements of the VF page as I understand, not the whole page? Much appreciate any help. 
I would like to only allow access to the link on this button if users profile name contains Manager, I can't quite get it to work though, currently getting 'url does not exist error' even without the contains function... 

Button:

{!IF( $Profile.Name == 'System Administrator', '/apex/echosign_dev1__AgreementTemplateProcess?masterId={!Contact.Id}&templateID=a8r0Y000000Cbld&emailaddress={!Contact.TR1__Secondary_Email__c}', null)}
 

We've been struggling with getting a zipped static resource to work for weeks now. We got Salesforce Support involved from the beginning, but they've gotten us nowhere. If we can't get a resolution to this issue soon, we might just find a platform that wastes less of our time...

 

Here is the situation - we are trying to upload a portion of the YUI library as a static resource, but no matter what we try, we can't get the files to render in our VisualForce pages. Salesforce Support can get it to work (sometimes), but we can't. The difference seems to be around the MIME Type that is set when the file is uploaded. When we upload the file, it gets set to a MIME Type of 'application/zip', but when SFDC Support uploads the file, it gets set to a MIME Type of 'application/x-zip-compressed' or 'application/octet-stream'. Salesforce can't explain to us exactly why or how these different MIME Types get set. They're looking into why our uploads don't work, but I'm not expecting much from them at this point.

 

To reproduce our steps:

 

Download the file from here after clicking the radio button labeled "Full developer kit":

Steps:
  1. Download "Full developer kit"
  2. Open zip and remov the documentation and examples folders (to reduce size)
  3. Change file name from "yui_3.0.0.zip" to "yui.zip"
  4. Upload as a static resource named "testyui"
  5. In component "header" (where all other JS files are included) add:
    • <apex:includeScript value="{!URLFOR($Resource.testyui, 'yui/build/yui/yui-min.js')}" />
  6. If we refresh the page we get a 404 error for this resource.
 
If anyone has experienced a similar issue, any help you could provide would be greatly appreciated.