• SFDCRK
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 11
    Replies
Hi,
I am trying to create a dynamic pick-list values and populate the selectList component, is there a way to show the component as pick-list view instead of list view?
 
OR
 
Basically what I am trying to do create a dynamic pick-list field but looping thru the a table (ratecard).
 
Any help is greatly appreciated.
 
Thanks,
rk
  • October 16, 2008
  • Like
  • 0
Hi all,
I don't know if you have faced this issue, but looks like there is a bug (don't know if it is) is Visual Force page when user hits the tab key I want to send the focus to the next field, since I am rerendering the page/pageblock/pageitems it's losing focus, but on actionSupport "onChange" event I am setting the focus to the specific field that I want i.e. Like this
 

<apex:actionsupport event="onchange" rerender="pbselected, pbsEvents, pbservices,totalprice,totalextendedamt" focus="discountvalue"/>

like this but my problem is it's working fine in FireFox, but it doesn't work in IE. Has anyone faced this issue before? and any solutions/work-arounds? please let me know. This is a critical piece any help is really appreciated.

Thanks,

Rami

 

  • October 13, 2008
  • Like
  • 0
Hi All,
Is it possible to remove the command from the number field? i.e. if the data type is number field, and the value is greater than thousand, then SFDC automatically starts to add comma e.g. 1,096 is it possble to not show the comma OR write a formula so that it would remove the comma? oh I do NOT want to create a text field to overcome this difficulty. Any help would be really great.

Thanks,
RK
  • August 27, 2008
  • Like
  • 0
I am hit with the same issue? any solution for this yet please let me know. Thanks in advance.
 
-RK
All,
In the after insert trigger of case object, I am trying to see if a person account exist based on the supplied email address, if yes then I am linking the case to person account, if no (i.e. if the person account doesn't exist) then I am creating a new person account and linking the case to the person account. The first piece works fine i.e. if the person account already exist then it's linking, the problem is when creating the person account (it's actually creating it, I can see the person account) the return ID has no value. Can anyone help please??? Code below
 

trigger CreateContactOnNewCase on Case (after insert) {

//Returns a list of the new versions of sObject records

for (Case createdCase : Trigger.new) {

//Check if the case & person account is not already linked by web to case

if (createdCase.ContactId == null) {

//Check if the email address is not null, need to use this to check if a person account already exist

Integer intCount = 0;

if ( createdCase.SuppliedEmail != null ) {

intCount = [Select count() From account Where personemail = :createdCase.SuppliedEmail AND account.RecordTypeId = '01240000000DQUpAAO'];

} else { intCount = 0; }

//validate if the person account is present

if ( intCount <= 0 ){

//Provide values from the case to the new person account and create the account.

Account newAccount = new Account();

newAccount.RecordTypeId = '01240000000DQUpAAO';

newAccount.PersonEmail = createdCase.SuppliedEmail;

newAccount.Phone = createdCase.phone_number__c;

newAccount.FirstName = createdCase.First_Name_Billing__c;

//If the case's lastname is null then make the lastname as 'UpdateNeeded'

if ( createdCase.Bill_to_Name__c == null ) {

newAccount.LastName = 'UpdateNeeded';

} else {

newAccount.LastName = createdCase.Bill_to_Name__c;

}

if ( createdCase.Billing_Address_2__c != null && createdCase.Billing_Address_2__c.length() > 0 ) {

newAccount.BillingStreet = createdCase.Billing_Address_1__c + ' ' + createdCase.Billing_Address_2__c;

} else { newAccount.BillingStreet = createdCase.Billing_Address_1__c; }

newAccount.BillingCity = createdCase.Billing_City__c;

newAccount.BillingState = createdCase.Billing_State__c;

newAccount.BillingPostalCode = createdCase.Billing_Zip__c;

try {

insert newAccount;

} catch (System.DmlException e) {

System.debug('Problem creating person account = ' + e.getDmlMessage(0));

}

//Update case with the newly created person account

try {

Id thisId = [SELECT id FROM contact, contact.account Where contact.account.Id = :newAccount.Id].Id;

//UpdateCaseContact.updateCase( createdCase.Id, newAccount.PersonContactId );

UpdateCaseContact.updateCase( createdCase.Id, thisId );

} catch (System.DmlException e) {

System.debug('Problem linking the case to the new person account = ' + e.getDmlMessage(0));

}

} else {

//Query the person account for the above email address, check if the person accont already exist

Id thisPersonAccount = [SELECT id FROM contact, contact.account Where contact.email = :createdCase.SuppliedEmail AND contact.account.RecordTypeId = '01240000000DQUpAAO' limit 1].Id;

//if exist then update the case with the existing person account id.

UpdateCaseContact.updateCase( createdCase.Id, thisPersonAccount );

} }}}

CLASS:

global class UpdateCaseContact {

public static void updateCase(Id strCaseID, Id strPersonID) {

//Lookup the case with the provided case Id

Case newCase = new Case(Id = strCaseID);

//Update the case's contact id with the provided person id (i.e. strPersonID variable)

newCase.ContactId = strPersonID;

update newCase;

} }

THanks,

rk

Hi all,
I don't know if you have faced this issue, but looks like there is a bug (don't know if it is) is Visual Force page when user hits the tab key I want to send the focus to the next field, since I am rerendering the page/pageblock/pageitems it's losing focus, but on actionSupport "onChange" event I am setting the focus to the specific field that I want i.e. Like this
 

<apex:actionsupport event="onchange" rerender="pbselected, pbsEvents, pbservices,totalprice,totalextendedamt" focus="discountvalue"/>

like this but my problem is it's working fine in FireFox, but it doesn't work in IE. Has anyone faced this issue before? and any solutions/work-arounds? please let me know. This is a critical piece any help is really appreciated.

Thanks,

Rami

 

  • October 13, 2008
  • Like
  • 0
Hi All,
Is it possible to remove the command from the number field? i.e. if the data type is number field, and the value is greater than thousand, then SFDC automatically starts to add comma e.g. 1,096 is it possble to not show the comma OR write a formula so that it would remove the comma? oh I do NOT want to create a text field to overcome this difficulty. Any help would be really great.

Thanks,
RK
  • August 27, 2008
  • Like
  • 0
I am hit with the same issue? any solution for this yet please let me know. Thanks in advance.
 
-RK
All,
In the after insert trigger of case object, I am trying to see if a person account exist based on the supplied email address, if yes then I am linking the case to person account, if no (i.e. if the person account doesn't exist) then I am creating a new person account and linking the case to the person account. The first piece works fine i.e. if the person account already exist then it's linking, the problem is when creating the person account (it's actually creating it, I can see the person account) the return ID has no value. Can anyone help please??? Code below
 

trigger CreateContactOnNewCase on Case (after insert) {

//Returns a list of the new versions of sObject records

for (Case createdCase : Trigger.new) {

//Check if the case & person account is not already linked by web to case

if (createdCase.ContactId == null) {

//Check if the email address is not null, need to use this to check if a person account already exist

Integer intCount = 0;

if ( createdCase.SuppliedEmail != null ) {

intCount = [Select count() From account Where personemail = :createdCase.SuppliedEmail AND account.RecordTypeId = '01240000000DQUpAAO'];

} else { intCount = 0; }

//validate if the person account is present

if ( intCount <= 0 ){

//Provide values from the case to the new person account and create the account.

Account newAccount = new Account();

newAccount.RecordTypeId = '01240000000DQUpAAO';

newAccount.PersonEmail = createdCase.SuppliedEmail;

newAccount.Phone = createdCase.phone_number__c;

newAccount.FirstName = createdCase.First_Name_Billing__c;

//If the case's lastname is null then make the lastname as 'UpdateNeeded'

if ( createdCase.Bill_to_Name__c == null ) {

newAccount.LastName = 'UpdateNeeded';

} else {

newAccount.LastName = createdCase.Bill_to_Name__c;

}

if ( createdCase.Billing_Address_2__c != null && createdCase.Billing_Address_2__c.length() > 0 ) {

newAccount.BillingStreet = createdCase.Billing_Address_1__c + ' ' + createdCase.Billing_Address_2__c;

} else { newAccount.BillingStreet = createdCase.Billing_Address_1__c; }

newAccount.BillingCity = createdCase.Billing_City__c;

newAccount.BillingState = createdCase.Billing_State__c;

newAccount.BillingPostalCode = createdCase.Billing_Zip__c;

try {

insert newAccount;

} catch (System.DmlException e) {

System.debug('Problem creating person account = ' + e.getDmlMessage(0));

}

//Update case with the newly created person account

try {

Id thisId = [SELECT id FROM contact, contact.account Where contact.account.Id = :newAccount.Id].Id;

//UpdateCaseContact.updateCase( createdCase.Id, newAccount.PersonContactId );

UpdateCaseContact.updateCase( createdCase.Id, thisId );

} catch (System.DmlException e) {

System.debug('Problem linking the case to the new person account = ' + e.getDmlMessage(0));

}

} else {

//Query the person account for the above email address, check if the person accont already exist

Id thisPersonAccount = [SELECT id FROM contact, contact.account Where contact.email = :createdCase.SuppliedEmail AND contact.account.RecordTypeId = '01240000000DQUpAAO' limit 1].Id;

//if exist then update the case with the existing person account id.

UpdateCaseContact.updateCase( createdCase.Id, thisPersonAccount );

} }}}

CLASS:

global class UpdateCaseContact {

public static void updateCase(Id strCaseID, Id strPersonID) {

//Lookup the case with the provided case Id

Case newCase = new Case(Id = strCaseID);

//Update the case's contact id with the provided person id (i.e. strPersonID variable)

newCase.ContactId = strPersonID;

update newCase;

} }

THanks,

rk

I have a class and a trigger associated with the class... Now, I want to deploy it and I tested it out with a couple of accounts in sandbox where i have the trigger and class... But i keep getting the error Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required... when i try to deploy it from eclipse...
What should I do? How do you test this?