• Ronty Ahmad
  • NEWBIE
  • 100 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies
Hi Guys

When I Am trying to fetch contact's Record from Account via custom controller, I Am unable to fetch contact's record from an account in vf page.
I feel controller is fine but I Am missing something in VF page.

Here is my controller-

public class AccCustomOppController {

    Public Account Acct {get; set;}

public AccCustomOppController (){

String AcctId = ApexPages.CurrentPage().getParameters().get('id');

Acct= [select name, Rating,  id from Account Where Id =: AcctId];

}
public List<Contact> ContactList{
get{

ContactList = [ select name, Email , Department from Contact where AccountId = :Acct.Id ];

return ContactList;
}
set;
}

Public PageReference Save(){

update Acct;
return new pageReference ('/' + Acct.ID);

}
}

and VF page is-

<apex:page controller="AccCustomOppController">
<apex:form >
<apex:pageblock Title="Account Custom Controller check">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save the updated Account Information"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!Acct.Name}"/>
</apex:pageBlockSection>
</apex:pageblock>

<apex:pageBlock>
<apex:pageBlockTable value="{!ContactList}" var="Con">
<apex:column value="{!con.Name}" title="Contact Name"/>
</apex:pageBlockTable>
</apex:pageBlock>


</apex:form>
</apex:page>


Please let me know what am I doing Wrong.


Thanks in Advance
/*
End Date of subscrition  and total membership fee Calculation :

Term__c is picklist and values are 12,24,36,48
Start_Date__c  is Start Date of  subscrition .
Rate__c  is number field for per month fee

I want have two Formula field should work like
End_date      = Start_Date__c + Term__c
Total_Amount = Rate__c * Term__c
*/

/*Formula for End Date formula(Date) Field is : */

IF(ISPICKVAL(Term__c, "12"), ADDMONTHS(Start_Date__c,12),
  IF(ISPICKVAL(Term__c, "24"), ADDMONTHS(Start_Date__c,24),
      IF(ISPICKVAL(Term__c, "36"), ADDMONTHS(Start_Date__c,36),
           IF(ISPICKVAL(Term__c, "48"), ADDMONTHS(Start_Date__c,48),null))))
           
/*Formula for Total Amount formula(currency) Field is : */

CASE(TEXT(Term__c),
         "12", (12* Rate__c) ,
          "24", (24* Rate__c) ,
          "36", (36* Rate__c) ,
          "48", (48* Rate__c) ,
0)

What is test away to rewrite this two formula function that is more dynamic . like i dont' need to set 12,36 ... in my formula.

 
Hi all SalesForce Experts,
I have a VisualForce (stander registration - http://sitename.cs5.force.com/registration/) page for modern browser like IE10+,Chrome , Firefox 4 and I have another VisualForce (fall-back registration - http://sitename.cs5.force.com/fallbackregistration/) page for IE7,IE8,IE9 (older browser).

I had a JS code to detect browser and depending on browser it redirect user from stander registration page to fall-back registration. It was working fine until we switch on ssl. now when i got to my stander registration (https://sitename.cs5.force.com/registration/) on IE7 or IE9 it show me 'Strong Security is required' message . 

Can any one please help me to find out a solution for older browser (IE7,IE8,IE9) how can i redirect my stander registration page to fall-back registration page instead of showing "Strong Security is required" page.

Thanks
 
I am trying to create a SALESFORCE formula that calculates the "Loan Period" using the following fields:

Interest Rate [ 6.00% ]
Loan Period [ ? ]
Annual Loan Instalments [ 52 ]
Total Loan Instalments [ 1,560 ]
Loan Repayment [ 150 ]

Similar Microsoft Formula:  NPER (rate, pmt, pv, [fv], [type])

Does anyone have the SALESFORCE  formula that can calculate the "Loan Period" using these fields? Thanks
 
II did everything, did double check, but when I submit to verify, the chalenge is wrong: "Challenge Not yet complete... here's what's wrong: 
The initial submission action is not correct for the 'Discount Approval Process'. VP approval does not appear to be required for discounts over 40% for step #2 in the process."

But it's correct, as you can see in diagram:

User-added image
We're using a matching rule for Accounts (aka 'companies') on SF that basically says 'If a company has both the "same name" and an identical company number, consider them duplicates' and a duplicate rule that prevents said duplicates from being created. 

'Same name' uses SF's `FUZZY: COMPANY NAME` logic, which means on creation it's smart enough to recognise eg `Microsoft Inc.` as the same company as `Microsoft` if they share a number.

Unfortunately for us, the SOQL queries don't have the same intelligence - if I run the query "select Id from Account where Name = 'Microsoft'", and I have a company with the name `Microsoft Inc.` I find no results.

Is there a built-in way to do a 'fuzzy search', so that we find any record(s) that would be considered a match according to our matching rules?

Thanks all.
Hi Guys

When I Am trying to fetch contact's Record from Account via custom controller, I Am unable to fetch contact's record from an account in vf page.
I feel controller is fine but I Am missing something in VF page.

Here is my controller-

public class AccCustomOppController {

    Public Account Acct {get; set;}

public AccCustomOppController (){

String AcctId = ApexPages.CurrentPage().getParameters().get('id');

Acct= [select name, Rating,  id from Account Where Id =: AcctId];

}
public List<Contact> ContactList{
get{

ContactList = [ select name, Email , Department from Contact where AccountId = :Acct.Id ];

return ContactList;
}
set;
}

Public PageReference Save(){

update Acct;
return new pageReference ('/' + Acct.ID);

}
}

and VF page is-

<apex:page controller="AccCustomOppController">
<apex:form >
<apex:pageblock Title="Account Custom Controller check">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save the updated Account Information"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!Acct.Name}"/>
</apex:pageBlockSection>
</apex:pageblock>

<apex:pageBlock>
<apex:pageBlockTable value="{!ContactList}" var="Con">
<apex:column value="{!con.Name}" title="Contact Name"/>
</apex:pageBlockTable>
</apex:pageBlock>


</apex:form>
</apex:page>


Please let me know what am I doing Wrong.


Thanks in Advance
While going thru Trailhead and learning many things, I decided to put together my own version of yet another Trailhead Leader board. I've fleshed out an example that keeps track of Name, ID, Badges, Superbadges, Comm Badges and Total Points. Sorting, ID validation are also being done. I did all of this for my own edification and learning to better reinforce the skills that Trailhead provided me. Trailhead is really quite amazing

Link to Dev Org Public Site: http://trailhead-leaderboard-developer-edition.na35.force.com

This App is one VisualSource Page and Apex controller running as a Public Site. Refresh occurs periodically from a .Net Web App using the Partner WSDL API

I'm hoping to move all of that over to Apex once I figure out a bunch of things. I see some other suggestions about dates. It would be nice to incorporate that also. I'm sure that something like this could be incorporated into Salesforce Orgs for folks to keep track of training of their employees with Trailhead. Part of the loader I've built using the Partner WSDL scans thru all of the badges of a profile and can load them into the Org somewhere.