• SfdcSteven
  • NEWBIE
  • 125 Points
  • Member since 2004

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 24
    Replies

Updated:

 

Hi all,

 

I'm trying to add a custom field to my QuoteLineItem object that will look up a discount value in a custom object (Discounts) per discount code and per product category. My Discounts object is like this:

 

Discount Code, Product Category, Discount Percent

AB01, CAT, 30

AB01, EPI, 20

AB02, CAT, 15

AB02, EPI, 25

etc......

 

My Accounts object has a custom field 'Discount Code' that matches the 'Discount Code' value in my Discounts object. So, account 'Acme Inc' may have a Dicount Code = 'AB01'.

My Products object has a custom field 'Product Category' that matches one of the Prodcut Category field values. So Product A could have a Product Category = 'EPI'.

 

What I want to do is create a custom field in QuoteLineItem that will return the Discount Percent for matching Discount Code > Product Category for the account that's being quoted.

 

This is probably simple, I'm just a noob.

 

Thanks in advance.

  • September 23, 2013
  • Like
  • 0

I am trying to get this trigger to be as efficient as possible.  I can get it to work enough but to get the code coverage I change it slightyly in a way that causes too many SOQL queries.  Its pretty obvious why as I have three for statemenets nested with SOQL queries in them.  Up till now thats the only way I know how to do it.  I think I am supposed to move those queires to Maps but I don't know how to conceptually work with maps.

 

WHAT IT DOES:

When some fields are filled in on the opp it takes those values and insertes them into a new record related to the contact record listed as primary contact on the opp. 

HOW I SEE THE PROCESS

1. Trigger an opp cause the Credit Card fields are filled in

2. find the contact ID listed as priamry contact on the Opportunity Contact Roles

3. Create a new payment method record, fill values from the opp and set the ContactID to whoever was the primary contact Role on the Opp.

 

I think I need to approach my code totally differently.

trigger PaymentMethodCreate on Opportunity (after update) {
 
    try {
        List<Id> list_Opps = new List<Id>();
 
        List<Id> Prime_Contact = new List<Id>();
        ID PrimeContact;
        List<pymt__Payment_Method__c> NewMethod = new List<pymt__Payment_Method__c>();
        
        for (Opportunity NewCard: Trigger.New) {
            if ((NewCard.CC__c != Null && 
                NewCard.CC_Expiration_Month__c != Null &&
                NewCard.CC_Expiration_Year__c !=Null) &&
                (trigger.oldmap.get(NewCard.Id).CC__c != NewCard.CC__c ||
                trigger.oldmap.get(NewCard.Id).CC_Expiration_Month__c != NewCard.CC_Expiration_Month__c ||
                trigger.oldmap.get(NewCard.Id).CC_Expiration_Year__c != NewCard.CC_Expiration_Year__c)){
                    list_Opps.add(NewCard.ID);
                }
        }
 
        for (Opportunity CardInfo:[SELECT Id, Credit_Card_Notes__c, CC__c, Card_Type__c, Name_On_CC__c, CC_Expiration_Month__c, CC_Expiration_Year__c FROM Opportunity WHERE Id in :List_Opps]) {
            for(OpportunityContactRole PrimaryContact:[SELECT ContactId FROM OpportunityContactRole WHERE OpportunityId = :CardInfo.Id]){
                Prime_Contact.add(PrimaryContact.ContactID);
                IF(Prime_Contact.size() < 1 ){
                    CardInfo.Credit_Card_Notes__c = 'There are no primary contacts listed in the Opportunity Contact Role section to apply a payment method.';
                    update CardInfo;
                } else {
                    for(Contact Payee:[SELECT Id, MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry, Phone, Email FROM Contact WHERE Id = :PrimaryContact.ContactId]){
                        //This section sets a name to the TempC__c field if it is null because 
                        //it won't work if it is null.
                        String FullName;
                        IF(CardInfo.Name_On_CC__c == null){
                            FullName = 'NoName';
                        } else {
                            FullName = CardInfo.Name_On_CC__c;
                        }
            
                        //The rest of the variables that will be used are set here.
                        Integer Index = FullName.indexOf(' ',0);
                        String Prefix;
                        String FName;
                        String LName;
                        String SubName;            
            
                        //First check if a common salutation is on the name to pull it out and set the Prefix variable with it. 
                        //Then strip it of the prefix to create a substring of the name without the prefix.
                        IF((FullName.left(Index) == 'Mr.') || 
                           (FullName.left(Index) == 'Mr') || 
                           (FullName.left(Index) == 'Mrs.') || 
                           (FullName.left(Index) == 'Mrs') || 
                           (FullName.left(Index) == 'Ms.') || 
                           (FullName.left(Index) == 'Ms') || 
                           (FullName.left(Index) == 'Dr.') || 
                           (FullName.left(Index) == 'Dr')){
                               Prefix = FullName.left(Index);
                               SubName = FullName.substring(Index + 1,FullName.length());
                               Index = SubName.indexOf(' ',0);
                    
                               //This sub-IF statement exists to process different logic depending 
                               //if there is one or more words after scurbbing the salutation.
                               IF(SubName.contains(' ')){
                                   FName = SubName.left(Index);
                                   LName = SubName.substring(Index,SubName.length());
                                   } else{
                                       FName = '';
                                       LName = SubName;
                                   }
                    
                               //This other half of the if statement processes like the other but 
                               //without the logic to deal with a salutation since there ins't one.
                               //However there may actually be a salutation if it is not one of the 
                               //common ones included in the first If Statement.
                           } else {
                               Prefix = '';
                               IF(FullName.contains(' ')){
                     
                                   FName = FullName.left(Index);
                                   LName = FullName.substring(Index,FullName.length());
                               } else{
                                   FName = '';
                                   LName = FullName;
                               }
                           }
            
                        //Now that the variables for the name has been procecced for different situations the 
                        //next code will create a new payment method record.
                        pymt__Payment_Method__c Method = new pymt__Payment_Method__c();
                        Method.Name = CardInfo.Card_Type__c + ' (' + CardInfo.CC__C.right(4) + ')';
                        Method.pymt__Contact__c = Payee.Id;
                        Method.pymt__Type__c = 'Credit Card';
                        Method.pymt__Card_Type__c = CardInfo.Card_Type__c;
                        Method.pymt__Billing_Salutation__c = Prefix;
                        Method.pymt__Billing_First_Name__c = FName;
                        Method.pymt__Billing_Last_Name__c = LName;
                        Method.pymt__Last_4_Digits__c = CardInfo.CC__C.right(4);
                        Method.ccrd__Card_Number__c = CardInfo.CC__C;
                        Method.pymt__Expiration_Month__c = CardInfo.CC_Expiration_Month__c;
                        Method.pymt__Expiration_Year__c = CardInfo.CC_Expiration_Year__c;
                        Method.pymt__Billing_Street__c = Payee.MailingStreet;
                        Method.pymt__Billing_City__c = Payee.MailingCity;
                        Method.pymt__Billing_State__c = Payee.MailingState;
                        Method.pymt__Billing_Postal_Code__c = Payee.MailingPostalCode;
                        Method.pymt__Billing_Country__c = Payee.MailingCountry;
                        Method.pymt__Billing_Phone__c = Payee.Phone;
                        Method.pymt__Billing_Email__c = Payee.Email;
                        Method.pymt__Default__c = true;
                        NewMethod.add(Method);
                    }
                    insert NewMethod;
                       
                        
                    //Now that the card info is securly stored inside the payment method record and is encryped
                    //we can clear out the exposed CC info on the opportunity.
                    CardInfo.CC__C = '';
                    CardInfo.Name_On_CC__c = '';
                    CardInfo.CC_Expiration_Month__c = '';
                    CardInfo.CC_Expiration_Year__c = '';
                    CardInfo.Card_Type__c = '';
                    CardInfo.Credit_Card_Notes__c = 'Credit Card was stored in a related Payment Method and is ready to use.  Go to the Payment Terminal and apply the existing payment method';
                                 Update CardInfo;
            }
        }
    }
}catch (Exception e) {Trigger.new[0].addError(e.getMessage());}
}

 

 

When compliing the following code:
 
String test = 'test';
Integer len = test.length;
 
I get a compile error on the second line "Initial term of field expression must be an SObject: String".
 
Why can't I use the string length attribute?
 
 
  • September 01, 2007
  • Like
  • 0

Hi Everyone,

We have a requirement where I am trying to setup an approval process and use it to dynamically assign to different queues based on field (queue) values in the record. Basically my record has the group name that it has to be assigned to. Is there a way to set up just one approval process on the field (queue) that is populated in the record.

It would greatly help me out if someone could give me their feedback or suggestions.

 

Thanks!

 

i have may be a hundred objects with autonumber that will be deployed to production.

 

now as i've tested it in our assembly, autonumber will start with zero unless you go those fields one by one and explicitly specify to start it with '1'.

 

considering the number of objects i have, and the awkward way to reset it (change to text, save, change back to autonumber, set starting number), this would be very tedious... and might cause delay to get productive.

 

is there anyway to swiftly done this? why would you have an autonumber in the first place that by default starts with zero?

I am trying to add a status value to the status picklist. But I do not have the "New" button to add a value. Can someone tell how to add this button? 

  • September 26, 2013
  • Like
  • 0

Hi

I want to make a approval process for an detail object in a master detail relationship. Using Q's or groups seems it not possible in a M-D relationship.

But any workaround to bypass it.

 

Using custom code ?

 

  • September 26, 2013
  • Like
  • 0

Hi 

 

I am trying to figure out the way how I can update a field on a Contact object, whenever the contact's account's account team member (User) is created (inserted), edited (updated) or removed (deleted) .

 

I realized that Workflows dont support this.

 

I also realized that it is not possible to create a Trigger on the AccountTeamMember child object as SF doesn't seem to allow creation of triggers on child objects.

 

In that case, what is the best way to handle this scenario? Any suggestions/thoughts?

 

Thanks

 

Updated:

 

Hi all,

 

I'm trying to add a custom field to my QuoteLineItem object that will look up a discount value in a custom object (Discounts) per discount code and per product category. My Discounts object is like this:

 

Discount Code, Product Category, Discount Percent

AB01, CAT, 30

AB01, EPI, 20

AB02, CAT, 15

AB02, EPI, 25

etc......

 

My Accounts object has a custom field 'Discount Code' that matches the 'Discount Code' value in my Discounts object. So, account 'Acme Inc' may have a Dicount Code = 'AB01'.

My Products object has a custom field 'Product Category' that matches one of the Prodcut Category field values. So Product A could have a Product Category = 'EPI'.

 

What I want to do is create a custom field in QuoteLineItem that will return the Discount Percent for matching Discount Code > Product Category for the account that's being quoted.

 

This is probably simple, I'm just a noob.

 

Thanks in advance.

  • September 23, 2013
  • Like
  • 0

Hi I am trying to override New button using S control.

What i am trying to achieve here is open normal salesforce stabdard new page but prepopulate one of the picklist field with profile name.

 

I using this s-control.

 

<html>
<head>
<script src="/soap/ajax/13.0/connection.js">
</script>
<script>
function init()
{
var idVal = ( (window.parent.location).toString() );

idVal = idVal.split('retURL=%2F')[1].substring(0,15);

//alert(idVal.length);
var profile="{!$Profile.Name}";
var hstring = "/a0V/e?retURL=%2Fnooverride=1&a0V&00NW0000000iiaV="+profile;
if(idVal.length ==7)
{
alert(idVal.length);
this.parent.location.href =hstring;
}

}
</script>
</head>
<body onload="init()">
<p>&nbsp;</p>
</body>
</html>

 

But the problem is this is ending up with blank white page. but the same URL which i am trying to create works fine with a custom button. if i try using scontrol & then overeride New button its ends up in blank screen.

 

 

 

Thanks

Ashok

  • September 23, 2013
  • Like
  • 0

I have a flow that I would like to be used through a button on my custom page called "Liaison/Coding".  When the button is opened up I would like the ID from the originating Liaison/Coding page to be inserted into the field of my flow called "liaison coding page name.  I want the page it is creating within my flow which is the "month end" custom object , to be linked back to the parent page "liaison/coding" where the button was clicked. 

 

I do not have much experience with Flow or Visual Force pages so any help on developing this process would be so helpful.

 

Thanks:)

Hello Guys..!!

 

I am getting error "Too many SQL Queries 101". Please help me on how to resolve this. I understood that I have to get the "Select" statement out from loop, but not sure how to do this. Any help will be appreciated,

 

public class uploadCSVcontroller {

public Blob contentFile { get; set; }
public String nameFile { get; set; }
public Integer rowCount { get; set; }
public Integer colCount { get; set; }

//User related variables
public List<User> usr{get;set;}
public Datetime lastlogin;
public Id usrId;
public String username;
public boolean isactive;

public List<List<String>> getResults() {
List<List<String>> parsedCSV = new List<List<String>>();
rowCount = 0;
colCount = 0;
if (contentFile != null){
String fileString = contentFile.toString();

parsedCSV = parseCSV(fileString, false);

system.debug('@@@@parsedCSV.get(0): '+parsedCSV.get(0));
system.debug('@@@@parsedCSV: '+parsedCSV);
rowCount = parsedCSV.size();
for (List<String> row : parsedCSV){
if (row.size() > colCount){
colCount = row.size();
}
}
}
return parsedCSV;
}


public static List<List<String>> parseCSV(String contents,Boolean skipHeaders) {
List<List<String>> allFields = new List<List<String>>();

contents = contents.replaceAll(',"""',',"DBLQT').replaceall('""",','DBLQT",');
contents = contents.replaceAll('""','DBLQT');
List<String> lines = new List<String>();
try {
//lines = contents.split('\n'); //correction: this only accomodates windows files
lines = contents.split('\r'); // using carriage return accomodates windows, unix, and mac files
} catch (System.ListException e) {
System.debug('Limits exceeded?' + e.getMessage());
}
Integer num = 0;
for(String line: lines) {
// check for blank CSV lines (only commas)
if (line.replaceAll(',','').trim().length() == 0) break;

List<String> fields = line.split(',');
List<String> cleanFields = new List<String>();
String compositeField;
Boolean makeCompositeField = false;
for(String field: fields) {
if (field.startsWith('"') && field.endsWith('"')) {
cleanFields.add(field.replaceAll('DBLQT','"'));
} else if (field.startsWith('"')) {
makeCompositeField = true;
compositeField = field;
} else if (field.endsWith('"')) {
compositeField += ',' + field;
cleanFields.add(compositeField.replaceAll('DBLQT','"'));
makeCompositeField = false;
} else if (makeCompositeField) {
compositeField += ',' + field;
} else {
cleanFields.add(field.replaceAll('DBLQT','"'));
}
}

allFields.add(cleanFields);
}
if (skipHeaders) allFields.remove(0);
return allFields;
}

public void resetpwd() {
system.debug('@@@@@ in resetpwd');
List<List<String>> parsedCSV = new List<List<String>>();
if (contentFile != null){
String fileString = contentFile.toString();
parsedCSV = parseCSV(fileString, false);
system.debug('@@@@parsedCSV in resetpwd: '+parsedCSV);
}
Integer count = 0;
system.debug('@@@@parsedCSV.size(): '+ parsedCSV.size());
while(count<parsedCSV.size()) {

usr=[select id,name,LastLoginDate, isactive, Username from User where Username= :parsedCSV.get(count)];
system.debug('_____________________'+usr);

for (User u : usr) {
lastlogin = u.LastLoginDate;
system.debug('@@@@@lastlogin' + lastlogin);
usrId = u.Id;
system.debug('@@@@@usrId' + usrId);
username = u.Username;
system.debug('@@@@@username'+ username);
isactive = u.isactive;
if(lastlogin==null && isactive == true) {

system.resetPassword(usrId, true);
}
}
}
}
}

I am trying to update  a count field on standard object Contact after insert or delete of Lents object. The code is as following but it does not work for deletion:

 

trigger UpdateCount on Lent__c (after insert,after delete) {

List<Contact> counts_toUpdate = new List<Contact>();

Map<String, Integer> contact_newCount_Map=new Map<String, Integer>(); //for each contact the CountNumber

 

if(trigger.isinsert){

List<Lent__c> counts = [select  Contact__c, Contact__r.Count__c

from Lent__c where id IN :Trigger.new FOR UPDATE];

for(Lent__c lent:counts){

contact_newCount_Map.put(lent.Contact__c,  Integer.valueOf(lent.Contact__r.Count__c==null ? 0 : lent.Contact__r.Count__c) + 1);

}

}

else{

List<Lent__c> counts = [select  Contact__c, Contact__r.Count__c

from Lent__c where id IN :Trigger.old FOR UPDATE];

for(Lent__c lent:counts){

contact_newCount_Map.put(lent.Contact__c,  Integer.valueOf(lent.Contact__r.Count__c==null ? 0 : lent.Contact__r.Count__c) - 1);

}

}

 

for(Contact con : [select id, Count__c from Contact WHERE ID IN : contact_newCount_Map.KeySet()]){

con.Count__c=contact_newCount_Map.get(con.id);

counts_toUpdate.add(con);

}

 

update counts_toUpdate;

}

 

Please help in finding the problem.

trigger UpdateCount on Lent__c (after insert,after delete) {
List<Contact> counts_toUpdate = new List<Contact>();
Map<String, Integer> contact_newCount_Map=new Map<String, Integer>(); //for each contact the CountNumber

if(trigger.isinsert){
List<Lent__c> counts = [select  Contact__c, Contact__r.Count__c
from Lent__c where id IN :Trigger.new FOR UPDATE];
for(Lent__c lent:counts){
contact_newCount_Map.put(lent.Contact__c,  Integer.valueOf(lent.Contact__r.Count__c==null ? 0 : lent.Contact__r.Count__c) + 1);
}
}
else{
List<Lent__c> counts = [select  Contact__c, Contact__r.Count__c
from Lent__c where id IN :Trigger.old FOR UPDATE];
for(Lent__c lent:counts){
contact_newCount_Map.put(lent.Contact__c,  Integer.valueOf(lent.Contact__r.Count__c==null ? 0 : lent.Contact__r.Count__c) - 1);
}
}

for(Contact con : [select id, Count__c from Contact WHERE ID IN : contact_newCount_Map.KeySet()]){
con.Count__c=contact_newCount_Map.get(con.id);
counts_toUpdate.add(con);
}

update counts_toUpdate;
}
  • September 01, 2013
  • Like
  • 0

Is there anyway to workaround the 

CalloutException: java.security.cert.CertificateException: No subject alternative DNS name matching found. error when calling out from apex?

 

Thanks,
Jon

Hi,

Anyone have any idea about how we verify the address in apex. i.e. suppose user fill the detail with their address and now i want to verify that address whether this address is valid or valid.

 

PLEASE HELP !!!!!! it's urgent

 

Thanks in advanced

Hi,

 

I  wrote the email handler to append the inbound emails based on case number to the case.

 

I want to count the emails in the parent case. I cant use rollup summary field because case object is not parent.

 

Can anybody help me to count the number of email messages in case.

 

 

Thanks.,

Ambiga

I am trying to get this trigger to be as efficient as possible.  I can get it to work enough but to get the code coverage I change it slightyly in a way that causes too many SOQL queries.  Its pretty obvious why as I have three for statemenets nested with SOQL queries in them.  Up till now thats the only way I know how to do it.  I think I am supposed to move those queires to Maps but I don't know how to conceptually work with maps.

 

WHAT IT DOES:

When some fields are filled in on the opp it takes those values and insertes them into a new record related to the contact record listed as primary contact on the opp. 

HOW I SEE THE PROCESS

1. Trigger an opp cause the Credit Card fields are filled in

2. find the contact ID listed as priamry contact on the Opportunity Contact Roles

3. Create a new payment method record, fill values from the opp and set the ContactID to whoever was the primary contact Role on the Opp.

 

I think I need to approach my code totally differently.

trigger PaymentMethodCreate on Opportunity (after update) {
 
    try {
        List<Id> list_Opps = new List<Id>();
 
        List<Id> Prime_Contact = new List<Id>();
        ID PrimeContact;
        List<pymt__Payment_Method__c> NewMethod = new List<pymt__Payment_Method__c>();
        
        for (Opportunity NewCard: Trigger.New) {
            if ((NewCard.CC__c != Null && 
                NewCard.CC_Expiration_Month__c != Null &&
                NewCard.CC_Expiration_Year__c !=Null) &&
                (trigger.oldmap.get(NewCard.Id).CC__c != NewCard.CC__c ||
                trigger.oldmap.get(NewCard.Id).CC_Expiration_Month__c != NewCard.CC_Expiration_Month__c ||
                trigger.oldmap.get(NewCard.Id).CC_Expiration_Year__c != NewCard.CC_Expiration_Year__c)){
                    list_Opps.add(NewCard.ID);
                }
        }
 
        for (Opportunity CardInfo:[SELECT Id, Credit_Card_Notes__c, CC__c, Card_Type__c, Name_On_CC__c, CC_Expiration_Month__c, CC_Expiration_Year__c FROM Opportunity WHERE Id in :List_Opps]) {
            for(OpportunityContactRole PrimaryContact:[SELECT ContactId FROM OpportunityContactRole WHERE OpportunityId = :CardInfo.Id]){
                Prime_Contact.add(PrimaryContact.ContactID);
                IF(Prime_Contact.size() < 1 ){
                    CardInfo.Credit_Card_Notes__c = 'There are no primary contacts listed in the Opportunity Contact Role section to apply a payment method.';
                    update CardInfo;
                } else {
                    for(Contact Payee:[SELECT Id, MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry, Phone, Email FROM Contact WHERE Id = :PrimaryContact.ContactId]){
                        //This section sets a name to the TempC__c field if it is null because 
                        //it won't work if it is null.
                        String FullName;
                        IF(CardInfo.Name_On_CC__c == null){
                            FullName = 'NoName';
                        } else {
                            FullName = CardInfo.Name_On_CC__c;
                        }
            
                        //The rest of the variables that will be used are set here.
                        Integer Index = FullName.indexOf(' ',0);
                        String Prefix;
                        String FName;
                        String LName;
                        String SubName;            
            
                        //First check if a common salutation is on the name to pull it out and set the Prefix variable with it. 
                        //Then strip it of the prefix to create a substring of the name without the prefix.
                        IF((FullName.left(Index) == 'Mr.') || 
                           (FullName.left(Index) == 'Mr') || 
                           (FullName.left(Index) == 'Mrs.') || 
                           (FullName.left(Index) == 'Mrs') || 
                           (FullName.left(Index) == 'Ms.') || 
                           (FullName.left(Index) == 'Ms') || 
                           (FullName.left(Index) == 'Dr.') || 
                           (FullName.left(Index) == 'Dr')){
                               Prefix = FullName.left(Index);
                               SubName = FullName.substring(Index + 1,FullName.length());
                               Index = SubName.indexOf(' ',0);
                    
                               //This sub-IF statement exists to process different logic depending 
                               //if there is one or more words after scurbbing the salutation.
                               IF(SubName.contains(' ')){
                                   FName = SubName.left(Index);
                                   LName = SubName.substring(Index,SubName.length());
                                   } else{
                                       FName = '';
                                       LName = SubName;
                                   }
                    
                               //This other half of the if statement processes like the other but 
                               //without the logic to deal with a salutation since there ins't one.
                               //However there may actually be a salutation if it is not one of the 
                               //common ones included in the first If Statement.
                           } else {
                               Prefix = '';
                               IF(FullName.contains(' ')){
                     
                                   FName = FullName.left(Index);
                                   LName = FullName.substring(Index,FullName.length());
                               } else{
                                   FName = '';
                                   LName = FullName;
                               }
                           }
            
                        //Now that the variables for the name has been procecced for different situations the 
                        //next code will create a new payment method record.
                        pymt__Payment_Method__c Method = new pymt__Payment_Method__c();
                        Method.Name = CardInfo.Card_Type__c + ' (' + CardInfo.CC__C.right(4) + ')';
                        Method.pymt__Contact__c = Payee.Id;
                        Method.pymt__Type__c = 'Credit Card';
                        Method.pymt__Card_Type__c = CardInfo.Card_Type__c;
                        Method.pymt__Billing_Salutation__c = Prefix;
                        Method.pymt__Billing_First_Name__c = FName;
                        Method.pymt__Billing_Last_Name__c = LName;
                        Method.pymt__Last_4_Digits__c = CardInfo.CC__C.right(4);
                        Method.ccrd__Card_Number__c = CardInfo.CC__C;
                        Method.pymt__Expiration_Month__c = CardInfo.CC_Expiration_Month__c;
                        Method.pymt__Expiration_Year__c = CardInfo.CC_Expiration_Year__c;
                        Method.pymt__Billing_Street__c = Payee.MailingStreet;
                        Method.pymt__Billing_City__c = Payee.MailingCity;
                        Method.pymt__Billing_State__c = Payee.MailingState;
                        Method.pymt__Billing_Postal_Code__c = Payee.MailingPostalCode;
                        Method.pymt__Billing_Country__c = Payee.MailingCountry;
                        Method.pymt__Billing_Phone__c = Payee.Phone;
                        Method.pymt__Billing_Email__c = Payee.Email;
                        Method.pymt__Default__c = true;
                        NewMethod.add(Method);
                    }
                    insert NewMethod;
                       
                        
                    //Now that the card info is securly stored inside the payment method record and is encryped
                    //we can clear out the exposed CC info on the opportunity.
                    CardInfo.CC__C = '';
                    CardInfo.Name_On_CC__c = '';
                    CardInfo.CC_Expiration_Month__c = '';
                    CardInfo.CC_Expiration_Year__c = '';
                    CardInfo.Card_Type__c = '';
                    CardInfo.Credit_Card_Notes__c = 'Credit Card was stored in a related Payment Method and is ready to use.  Go to the Payment Terminal and apply the existing payment method';
                                 Update CardInfo;
            }
        }
    }
}catch (Exception e) {Trigger.new[0].addError(e.getMessage());}
}

 

 

 I was wondering if anyone is really taking advantage of large (500 -800) number of fields supported by Salesforce on each table/custom object. I come across  reluctance from designer / developers  to come out of relational data model concept.  I would like to know more about large application schema design.

Hi friends,

so again we had trouble with Jitterbit since there is no Documentation like Salesforce has.  If you are using Salesforce and you are trying to send Outbound messages be aware that they will be send in batch.

 

So in Jitterbit you have to create a Hosted Web Service, copy the URL to the Outbound Message, download the WSDL from the Outbound Message and upload it to the Hosted Web Service you created in Jitterbit.  Bit confusing but when you do it you'll get it right.

 

After the Hosted Web Service you need to create a Transformation that uses a File Format to 'save' in global variables the record.

 

In our case we needed to call a Stored Procedure (using script in jitterbit) afterwards and this is where we had the problems.  It only processed 1 record at a time even if the Outbound Message was sending more than once.

 

So the solution to this is the following:

1. Do no run the script with a 'on success' instruction of the first Operation (the Hosted Web Service).

2. Go back to the transformation where you are 'saving' in the global variables and go to the last one.

3. Run the next operation (the script that executes the SP) with this command: RunOperation("<TAG>Operations/Insert SP</TAG>", false);

 

And that one does the magic.

 

Have fun, Cheers.

  • August 29, 2013
  • Like
  • 2

as of 30 minutes ago, visualforce pages are broken (or, at least, the i.na4.visual.force.com one is, but I assume there's a wildcard cert being used across all instances).

 

 

  • September 12, 2009
  • Like
  • 0