• ADN
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies

Hi,

I am working on report to group by region.

 

,IF ( OR(
BEGINS ( MailingPostalCode , "NE"), BEGINS ( MailingPostalCode , "DH") ,BEGINS ( MailingPostalCode , "SR"),
BEGINS ( MailingPostalCode , "DL"), BEGINS ( MailingPostalCode , "TS") ,BEGINS ( MailingPostalCode , "HG"),
BEGINS ( MailingPostalCode , "YO"), BEGINS ( MailingPostalCode , "LS") ,BEGINS ( MailingPostalCode , "WF"),
BEGINS ( MailingPostalCode , "DN"), BEGINS ( MailingPostalCode , "HU")
)
,"North East"
, IF ( OR(
BEGINS ( MailingPostalCode , "TR"), BEGINS ( MailingPostalCode , "PL") ,BEGINS ( MailingPostalCode , "TQ"),
BEGINS ( MailingPostalCode , "EX"), BEGINS ( MailingPostalCode , "TA") ,BEGINS ( MailingPostalCode , "DT"),
BEGINS ( MailingPostalCode , "BA"), BEGINS ( MailingPostalCode , "BS") ,BEGINS ( MailingPostalCode , "GL"),
BEGINS ( MailingPostalCode , "SN"), BEGINS ( MailingPostalCode , "SP") ,BEGINS ( MailingPostalCode , "BH")
)
, " South West" , IF(OR( BEGINS ( MailingPostalCode , "BT")
)
, "Northern Ireland", IF ( OR(
BEGINS ( MailingPostalCode , "HR"), BEGINS ( MailingPostalCode , "WR") ,BEGINS ( MailingPostalCode , "DY"),
BEGINS ( MailingPostalCode , "WV"), BEGINS ( MailingPostalCode , "TF") ,BEGINS ( MailingPostalCode , "ST"),
BEGINS ( MailingPostalCode , "WS"), BEGINS ( MailingPostalCode , "B") ,BEGINS ( MailingPostalCode , "CV"),
BEGINS ( MailingPostalCode , "NN"), BEGINS ( MailingPostalCode , "LE") ,BEGINS ( MailingPostalCode , "NG"),
BEGINS ( MailingPostalCode , "DE")
)
, "The Midlands", " " )
)
)

 

Because the formula field text type is very long so I get two formula text fields as the following:

Region 1: formula text field type

Region 2: formula text field type

 

In order to group the report by region, I am thinking about create another field to display the values of Region1 and Region2:

 

the question is how I can display the value of text type in another formula text type as the following:

 

IF ( Region1__c<> null, "Region2__c", "Region__c"): this code will  not disaply the value of field region1 or region2? ??

 

which formula can I use in order to disaply the same value of Region1__c, value??

 

Thanks

 

  • October 21, 2012
  • Like
  • 0

Hi,

 

Does anyone know of particular industries which use Salesforce CRM System, I am System admin CRM Who is out of work and wish to write to some companies speculatively

 

Would really appreciate your help

 

 

  • December 11, 2011
  • Like
  • 0

Can somebody tell me what  is the problem with this trigger: ? I GET the following error message:

SObject row does not allow errors

I am trying to prevent user form save account Record type of Umbrella if it associated with a contact & If else statement: count number of related contacts to that account: a.Updated__c = cons.size();

 

Trigger UmbrellaAccountTrigger on Account (before insert,before update) {

Set<Id> accountIds = new Set<Id>();
for (Account a : trigger.new) {
     accountIds.add(a.Id);
}

for (Account a : [Select Id, Updated__c ,RecordTypeId ,(Select Id from Contacts)From Account Where Id in :accountIds]) {
     Contact[] cons = a.Contacts;
     if ((cons.size()!=0 )&& (a.RecordTypeId =='012A0000000nY0a')) {
         a.addError('You can not save Umbrella Record associated with a contact');
     } else {
         a.Updated__c = cons.size();
     }
}


}



  • October 18, 2011
  • Like
  • 0

I create a trigger  which prevent user form save account if it associated with a recordtype account:

Is the following trigger correct? Do I need to put the query outside the account for loop.

 

Trigger UmbrellaAccountTrigger on Account (before insert,before update) {
private Account[] Acc =Trigger.new;
integer SOQL;
List <contact> Con= New List <Contact>();
For(Account a:Acc){
a.Updated__c=[select count() from contact where accountId=:a.ID];
If((a.Updated__c!= 0)&&(a.RecordTypeC__c==1 )){

a.addError('You can not save Umbrella Record associated with a contact');
}
}
}

 

Note: a.Updated__c is a custom field on account and it display the number of relcated contact



  • October 14, 2011
  • Like
  • 0

Can somebody help me with test the following extension controller;

 

public class AdnExt {

    public AdnExt(ApexPages.StandardSetController controller) {
    Controller.setPageSize(10);
    }

}

The extension controller will specify the number of records which displayed on visualforce page:

<apex:page standardController="Special_event__c" recordSetVar="opportunities"Specialevents"       

tabStyle="" extensions="AdnExt">

  • October 13, 2011
  • Like
  • 0

Hi,

I am working on report to group by region.

 

,IF ( OR(
BEGINS ( MailingPostalCode , "NE"), BEGINS ( MailingPostalCode , "DH") ,BEGINS ( MailingPostalCode , "SR"),
BEGINS ( MailingPostalCode , "DL"), BEGINS ( MailingPostalCode , "TS") ,BEGINS ( MailingPostalCode , "HG"),
BEGINS ( MailingPostalCode , "YO"), BEGINS ( MailingPostalCode , "LS") ,BEGINS ( MailingPostalCode , "WF"),
BEGINS ( MailingPostalCode , "DN"), BEGINS ( MailingPostalCode , "HU")
)
,"North East"
, IF ( OR(
BEGINS ( MailingPostalCode , "TR"), BEGINS ( MailingPostalCode , "PL") ,BEGINS ( MailingPostalCode , "TQ"),
BEGINS ( MailingPostalCode , "EX"), BEGINS ( MailingPostalCode , "TA") ,BEGINS ( MailingPostalCode , "DT"),
BEGINS ( MailingPostalCode , "BA"), BEGINS ( MailingPostalCode , "BS") ,BEGINS ( MailingPostalCode , "GL"),
BEGINS ( MailingPostalCode , "SN"), BEGINS ( MailingPostalCode , "SP") ,BEGINS ( MailingPostalCode , "BH")
)
, " South West" , IF(OR( BEGINS ( MailingPostalCode , "BT")
)
, "Northern Ireland", IF ( OR(
BEGINS ( MailingPostalCode , "HR"), BEGINS ( MailingPostalCode , "WR") ,BEGINS ( MailingPostalCode , "DY"),
BEGINS ( MailingPostalCode , "WV"), BEGINS ( MailingPostalCode , "TF") ,BEGINS ( MailingPostalCode , "ST"),
BEGINS ( MailingPostalCode , "WS"), BEGINS ( MailingPostalCode , "B") ,BEGINS ( MailingPostalCode , "CV"),
BEGINS ( MailingPostalCode , "NN"), BEGINS ( MailingPostalCode , "LE") ,BEGINS ( MailingPostalCode , "NG"),
BEGINS ( MailingPostalCode , "DE")
)
, "The Midlands", " " )
)
)

 

Because the formula field text type is very long so I get two formula text fields as the following:

Region 1: formula text field type

Region 2: formula text field type

 

In order to group the report by region, I am thinking about create another field to display the values of Region1 and Region2:

 

the question is how I can display the value of text type in another formula text type as the following:

 

IF ( Region1__c<> null, "Region2__c", "Region__c"): this code will  not disaply the value of field region1 or region2? ??

 

which formula can I use in order to disaply the same value of Region1__c, value??

 

Thanks

 

  • October 21, 2012
  • Like
  • 0

Can somebody tell me what  is the problem with this trigger: ? I GET the following error message:

SObject row does not allow errors

I am trying to prevent user form save account Record type of Umbrella if it associated with a contact & If else statement: count number of related contacts to that account: a.Updated__c = cons.size();

 

Trigger UmbrellaAccountTrigger on Account (before insert,before update) {

Set<Id> accountIds = new Set<Id>();
for (Account a : trigger.new) {
     accountIds.add(a.Id);
}

for (Account a : [Select Id, Updated__c ,RecordTypeId ,(Select Id from Contacts)From Account Where Id in :accountIds]) {
     Contact[] cons = a.Contacts;
     if ((cons.size()!=0 )&& (a.RecordTypeId =='012A0000000nY0a')) {
         a.addError('You can not save Umbrella Record associated with a contact');
     } else {
         a.Updated__c = cons.size();
     }
}


}



  • October 18, 2011
  • Like
  • 0

I create a trigger  which prevent user form save account if it associated with a recordtype account:

Is the following trigger correct? Do I need to put the query outside the account for loop.

 

Trigger UmbrellaAccountTrigger on Account (before insert,before update) {
private Account[] Acc =Trigger.new;
integer SOQL;
List <contact> Con= New List <Contact>();
For(Account a:Acc){
a.Updated__c=[select count() from contact where accountId=:a.ID];
If((a.Updated__c!= 0)&&(a.RecordTypeC__c==1 )){

a.addError('You can not save Umbrella Record associated with a contact');
}
}
}

 

Note: a.Updated__c is a custom field on account and it display the number of relcated contact



  • October 14, 2011
  • Like
  • 0