• Charline Mitchener
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 7
    Replies
The contacts in our org are required to complete a minimum number of CPD points each year. From Jan 1 - Dec 31.
Previously we have been doing this manually but want to now have a way to record this in Salesforce. 

So far, we have created a CPD Register object, where our contacts can enter their Activities and points gained for that activity.
The fields on this object include;
- Activity Date
- Activity Type
- Lookup to contact
- Lookup to Event Registrations (a seperare object where we have all event registrations for events hosted by us)
- CPD Points gained for activity

We have also created a new custom object called Total CPD Points, where we need to calculate the total cpd points for a contact WHERE the activity date is between Jan 1 to Dec 31 for a particular year.

We need to be able to report by year, e.g. One record will equal one year, and the declarative roll up summary in the record will display total points for that year. 

I am trying trying to work out the best way to go about this, and am looking for suggestions. Currently looking at declarative roll up summary option to have on the TOTAL CPD Points object. 

So far I have come up with two options... but wanted to see if anyone else had any other ideas.

1.  Activity_Date__c = THIS_YEAR
2. Or creating a start date field, and an enda date field, then having a soql 
WHERE createdDate >= startdate field
AND createdDate <= end date field

Thanks!
I have create a visualforce page, using apex that looks up and displays a number of fields from the contact object as well as the account linked to that contact. 

A number of contacts have a 'secondary account', which they are linked to. There is a custom field on the contact layout named secondary_account__c, which is an account lookup field. 

I need to display fields from both accounts within the visualforce page, i.e. the Address from both Accounts within the one visualforce page. How would I detail this within the apex code I have created? If I just have , account.billingcity for example, how would I add it, and differentiate it from the first account, to show the billing city for the second account?

 
I have a image hyperlink in site.com where I am trying to make the end of the URL the value of a custom field in the User Object. 

The idea is that the code looks up the custom field from the current User - there is a custom user field which displays the salesforce id. 
The code I am using is - 

<a href="/samplesite/Advisor_Profile?id={!CurremtUser.salesforceid__c}"><img src="https://ap1.salesforce.com/resource/1436458247000/FS1C" height="35" width="164"> 
    
salesforceid__c holds the Salesforce Contact ID. Once it's working, it would create a link like this -    /samplesite/Advisor_Profile?id=348432934234djf  (salesforce id on the end)

I must be doing something wrong within the code - when I test it the URL just keeps the custom field name - https://sitepreview.ap1.force.com/samplesite/Advisor_Profile?id={!User.salesforceid__c}

Any help would be appreciated
We have a training calendar in our Org that I would like to add to a VF page to enable community users to be able to view it. I have tried researching this but from what I can tell it is not possible - hoping for some ideas?
I am trying to work out the best way to go about the below:

We have a event registration form in FormAssembly, that when a invitee fills it out it creates a Registration record in Salesforce 

What we need to happen is that when the record is created, a ‘ticket’ with a unique QR code is generated and emailed to the user. When the user scans the QR code at conference, the Attending tickbox is ticked under their registration in Salesforce and their badge (to go in their lanyard) is printed.

I know there are a number of apps available on app exchange but we don't require the whole kit and kaboodle, we just need to work out how to generate a unique qr code when a registration record is created, email it to the user, and save a copy of the email (or qr code) on the record, and finally, when the qr code is scanned at conference to have a 'attentding box' ticked under their registration.

Any ideas??

Thanks!  
I have created a vf page for Communities that allows a user to view their contact & account details and update them as needed. However, the command save button doesn't seem to work and the updates are not changes.

Anyone have any idea why? The community user has edit/read/write permissions on Accounts & Contacts. 

Below is the VF Code -

<apex:page Controller="MyContactController">
    <apex:form >
        <apex:pageBlock title="Update Company Details for {!$User.CommunityNickname}">
            <apex:pageMessages />
            <apex:pageBlockSection >
                <apex:inputField id="title" value="{!contact.title}" />
                <apex:inputField id="firstname" value="{!contact.firstname}" />
                <apex:inputField id="lastname" value="{!contact.lastname}" />
                <apex:inputField id="email" value="{!contact.email}" />             
                <apex:inputField id="mobilephone" value="{!contact.mobilephone}" />
                <apex:inputField id="Publish_Mobile_No_on_Website__c" value="{!contact.Publish_Mobile_No_on_Website__c}" />
                <apex:inputField id="Website_Bio__c" value="{!contact.Website_Bio__c}" />
                <apex:inputField id="Specialty__c" value="{!contact.Specialty__c}" />
                <apex:inputField id="Qualifications__c" value="{!contact.Qualifications__c}" />
                <apex:inputField id="photo__c" value="{!contact.Photo__c}" />
                <apex:inputField value="{!contact.account.phone}"/>
                <apex:inputField value="{!contact.account.fax}"/>
                <apex:inputField value="{!contact.account.Website_Info__c}"/>
                <apex:inputField value="{!contact.account.Nominated_Email_Contact_Website__c}"/>
                <apex:inputField value="{!contact.account.Company_Logo__c}"/>
                 <br><br></br></br>
                 <apex:commandButton action="{!save}" value="Save" id="theButton" immediate="true"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection >
            <em>
            </em>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
I have created a custom search bad for the community however when I try and search for something I am receiving an erorr 'this URL no longer exists'

Any ideas what the issue could be? Below is the code

 <form action="/<community>/Search/SmartSearch" method="get">
                <input type="text" class="tftextinput" name="q" size="100" maxlength="120"></input><input type="submit" value="Search" class="tfbutton"></input>
       </form>
I have created a VF Page that allowed users to submit a case. When I saved it, Salesforce prompted me to create controllers for this page.
I have very limited experience when it comes to Apex Classes and although I understand the basics of what a test class is, I have no idea how to write one.. can someone please help! 

The VF Page will be used in our community to allows Community users to submit a case to support. 

Below is the controller that Salesforce created for me - 

public class SubmitCaseController {

    public String parentId { get; set; }

    public String Attach { get; set; }

    public String contentType { get; set; }

    public String showAttach { get; set; }

    public PageReference UploadFile() {
        return null;
    }


    public String fileBody { get; set; }

    public String fileName { get; set; }
    
    public Case c { get; set; }
    
    public String acctNum { get; set; }
    
    public SubmitCaseController() {
        c = new Case();
    }
    
    public PageReference submitCase() {
        List<Account> accts = [SELECT Id FROM Account WHERE AccountNumber = :acctNum];
        if (accts.size() != 1) {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Invalid account number');
            ApexPages.addMessage(msg);
            return null;
        } else {
            try {
                c.AccountId = accts.get(0).Id;
                
                // now look for an associated contact with the same email
                Contact cnt = [SELECT Id FROM Contact WHERE AccountId = :c.AccountId AND Email = :c.SuppliedEmail LIMIT 1];
                if (cnt != null) 
                    c.ContactId = cnt.Id;
                    
                // Specify DML options to ensure the assignment rules are executed
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.useDefaultRule = true;
                c.setOptions(dmlOpts);

                // Insert the case
                INSERT c;
                return new PageReference('/thanks');
            } catch (Exception e) {
                ApexPages.addMessages(e);
                return null;
            }
        }
    }
}
I am trying to work out how to display data categories in a list on my side bar.

I found the below code in the Visualforce Guide and it works great, but I don't want the 'select/drop down' method, I want it to display in a list, can someone let me know how to change it to a listing instead? - 


<select name="category"> <knowledge:categoryList categoryVar="category" categoryGroup="product" rootCategory="phone" level="-1"> <option value="{!category.name}">{!category.label}</option> </knowledge:categoryList> </select>
 
I have created a VF page where I want the user logged into the community to be able to update certain fields under their contact as well as the account they are linked to. To clarify, we have Authorised Rep's that will all have access to our community, each rep (contact) is also linked to an account (their name of the company), and I need them to be able to update their details for both sections.

I have worked out how to lookup details from the Contact, but my knowledge with APEX is limited, and I have no idea how to extend this to lookup the associated Account. So far I have the Custom Controller as:

public class MyContactController {

    public String account { get; set; }
    public Contact contact {get; private set;}

    public MyContactController() {
        User user = [select ContactId from User where id = :UserInfo.getUserId()];
        Id id = user.ContactId;
        contact = (id == null) ? new Contact() :
        [SELECT id,email,title,firstname,lastname,mobilephone,Publish_Mobile_No_on_Website__c,Website_Bio__c,Specialty__c,Qualifications__c,photo__c FROM contact WHERE id = :id];
    }
}


And my VF page as - 

<apex:page Controller="MyContactController">
    <apex:form >
        <apex:pageBlock title="Update Company Details for {!$User.CommunityNickname}">
            <apex:pageMessages />
            <apex:pageBlockSection >
                <apex:inputField id="title" value="{!contact.title}" />
                <apex:inputField id="firstname" value="{!contact.firstname}" />
                <apex:inputField id="lastname" value="{!contact.lastname}" />
                <apex:inputField id="email" value="{!contact.email}" />             
                <apex:inputField id="mobilephone" value="{!contact.mobilephone}" />
                <apex:inputField id="Publish_Mobile_No_on_Website__c" value="{!contact.Publish_Mobile_No_on_Website__c}" />
                <apex:inputField id="Website_Bio__c" value="{!contact.Website_Bio__c}" />
                <apex:inputField id="Specialty__c" value="{!contact.Specialty__c}" />
                <apex:inputField id="Qualifications__c" value="{!contact.Qualifications__c}" />
                <apex:inputField id="photo__c" value="{!contact.Photo__c}" />
                 <br><br></br></br>
            </apex:pageBlockSection>
            <apex:pageBlockSection >
            <em>
            </em>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>



Really appreciate any help I can get! An example of the fields I need to link to from accounts is, 

                <apex:inputField id="phone" value="{!account.phone}" />
                <apex:inputField id="fax" value="{!account.fax}" />
                <apex:inputField id="Company_Logo__c" value="{!account.Company_Logo__c}" />
I have used the Salesforce Knowledge Developer guide to create a Knowledge Article Page with a search function - http://www.salesforce.com/us/developer/docs/knowledge_dev/salesforce_knowledge_dev_guide.pdf. I would like to limit the search function to only search a specific data category, rather than all of them. 

The reason for this is because I am creating a number of subpages, and I want each page to search a different data category, than one page searching all of them. 

I can't work out how to do this? Any help is appreciated!
I have added a custom HTML header to my community. I have the html coding from Salesforce to add the 'search function' back in, but I was after something a little more fancy, like what the Napili template uses. I have no real experience with Visualforce/HTML so am treading blindly. 

Can anyone provide help with coding or how I would go about this? Thanks in advance!

Napili Global Search
I have created a 'Submit a Case' page in visualforce to allow users to submit cases. I would like to add case deflection so that when they go to submit a case, they get recommended articles from knowledge.

Any ideas on how I can do this? 

Thanks
Hi, I want to create a mouse rollover effect on my images in a visualforce page. Below is a sample of my code for one of the images. Can someone please let me know what I need to do/add to create a 'highlight' effect on the image? Thanks so much!

<td align="center" valign="center">
<img src="https://cs5.salesforce.com/resource/1415592831000/FINANCIAL" />
<br />
Hi,

I need to add a rotating banner to a visualforce page to display images for our community. Is this possible and if so how? I am new to this so any help would be appreciated!
I have added a custom HTML header to my community. I have the html coding from Salesforce to add the 'search function' back in, but I was after something a little more fancy, like what the Napili template uses. I have no real experience with Visualforce/HTML so am treading blindly. 

Can anyone provide help with coding or how I would go about this? Thanks in advance!

Napili Global Search
I have create a visualforce page, using apex that looks up and displays a number of fields from the contact object as well as the account linked to that contact. 

A number of contacts have a 'secondary account', which they are linked to. There is a custom field on the contact layout named secondary_account__c, which is an account lookup field. 

I need to display fields from both accounts within the visualforce page, i.e. the Address from both Accounts within the one visualforce page. How would I detail this within the apex code I have created? If I just have , account.billingcity for example, how would I add it, and differentiate it from the first account, to show the billing city for the second account?

 
I have a image hyperlink in site.com where I am trying to make the end of the URL the value of a custom field in the User Object. 

The idea is that the code looks up the custom field from the current User - there is a custom user field which displays the salesforce id. 
The code I am using is - 

<a href="/samplesite/Advisor_Profile?id={!CurremtUser.salesforceid__c}"><img src="https://ap1.salesforce.com/resource/1436458247000/FS1C" height="35" width="164"> 
    
salesforceid__c holds the Salesforce Contact ID. Once it's working, it would create a link like this -    /samplesite/Advisor_Profile?id=348432934234djf  (salesforce id on the end)

I must be doing something wrong within the code - when I test it the URL just keeps the custom field name - https://sitepreview.ap1.force.com/samplesite/Advisor_Profile?id={!User.salesforceid__c}

Any help would be appreciated
We have a training calendar in our Org that I would like to add to a VF page to enable community users to be able to view it. I have tried researching this but from what I can tell it is not possible - hoping for some ideas?
I have created a vf page for Communities that allows a user to view their contact & account details and update them as needed. However, the command save button doesn't seem to work and the updates are not changes.

Anyone have any idea why? The community user has edit/read/write permissions on Accounts & Contacts. 

Below is the VF Code -

<apex:page Controller="MyContactController">
    <apex:form >
        <apex:pageBlock title="Update Company Details for {!$User.CommunityNickname}">
            <apex:pageMessages />
            <apex:pageBlockSection >
                <apex:inputField id="title" value="{!contact.title}" />
                <apex:inputField id="firstname" value="{!contact.firstname}" />
                <apex:inputField id="lastname" value="{!contact.lastname}" />
                <apex:inputField id="email" value="{!contact.email}" />             
                <apex:inputField id="mobilephone" value="{!contact.mobilephone}" />
                <apex:inputField id="Publish_Mobile_No_on_Website__c" value="{!contact.Publish_Mobile_No_on_Website__c}" />
                <apex:inputField id="Website_Bio__c" value="{!contact.Website_Bio__c}" />
                <apex:inputField id="Specialty__c" value="{!contact.Specialty__c}" />
                <apex:inputField id="Qualifications__c" value="{!contact.Qualifications__c}" />
                <apex:inputField id="photo__c" value="{!contact.Photo__c}" />
                <apex:inputField value="{!contact.account.phone}"/>
                <apex:inputField value="{!contact.account.fax}"/>
                <apex:inputField value="{!contact.account.Website_Info__c}"/>
                <apex:inputField value="{!contact.account.Nominated_Email_Contact_Website__c}"/>
                <apex:inputField value="{!contact.account.Company_Logo__c}"/>
                 <br><br></br></br>
                 <apex:commandButton action="{!save}" value="Save" id="theButton" immediate="true"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection >
            <em>
            </em>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
I have created a custom search bad for the community however when I try and search for something I am receiving an erorr 'this URL no longer exists'

Any ideas what the issue could be? Below is the code

 <form action="/<community>/Search/SmartSearch" method="get">
                <input type="text" class="tftextinput" name="q" size="100" maxlength="120"></input><input type="submit" value="Search" class="tfbutton"></input>
       </form>
I have created a VF Page that allowed users to submit a case. When I saved it, Salesforce prompted me to create controllers for this page.
I have very limited experience when it comes to Apex Classes and although I understand the basics of what a test class is, I have no idea how to write one.. can someone please help! 

The VF Page will be used in our community to allows Community users to submit a case to support. 

Below is the controller that Salesforce created for me - 

public class SubmitCaseController {

    public String parentId { get; set; }

    public String Attach { get; set; }

    public String contentType { get; set; }

    public String showAttach { get; set; }

    public PageReference UploadFile() {
        return null;
    }


    public String fileBody { get; set; }

    public String fileName { get; set; }
    
    public Case c { get; set; }
    
    public String acctNum { get; set; }
    
    public SubmitCaseController() {
        c = new Case();
    }
    
    public PageReference submitCase() {
        List<Account> accts = [SELECT Id FROM Account WHERE AccountNumber = :acctNum];
        if (accts.size() != 1) {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Invalid account number');
            ApexPages.addMessage(msg);
            return null;
        } else {
            try {
                c.AccountId = accts.get(0).Id;
                
                // now look for an associated contact with the same email
                Contact cnt = [SELECT Id FROM Contact WHERE AccountId = :c.AccountId AND Email = :c.SuppliedEmail LIMIT 1];
                if (cnt != null) 
                    c.ContactId = cnt.Id;
                    
                // Specify DML options to ensure the assignment rules are executed
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.useDefaultRule = true;
                c.setOptions(dmlOpts);

                // Insert the case
                INSERT c;
                return new PageReference('/thanks');
            } catch (Exception e) {
                ApexPages.addMessages(e);
                return null;
            }
        }
    }
}
I have added a custom HTML header to my community. I have the html coding from Salesforce to add the 'search function' back in, but I was after something a little more fancy, like what the Napili template uses. I have no real experience with Visualforce/HTML so am treading blindly. 

Can anyone provide help with coding or how I would go about this? Thanks in advance!

Napili Global Search