• Kool_Rud
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

I have a datatable of sObjects that I paginate over. In order to preserve the user information for the selected objects I was capturing the selected objects and placing their values in another map. This was working until i decided to expermient with generic sObjects. This is just quick code as my question is more about how to assign a variable from one wrapped sObject Map from another.

 

..........

for(DeviceDisplay dev:deviceDisplayMap.values()){
        if(CurrentSelectionMap.containskey(dev.proxy_adev.id)){
                  dev.selected = true; //THIS WORKS
                  dev.devicenotes = CurrentselectionMap.get(dev.proxy_adev.id).devicenotes; //THIS WORKS

                  //This is were I get lost. Is this possible?

                  dev.proxy_adev.put('request__c' , CurrentSelectionMap.get(dev.proxy_adev.id) ????????? get('request__c'));

                  .......

 

 

Map<ID,DeviceDisplay> DeviceDisplayMap

Map<ID,DeviceDisplay> CurrentSelectionMap

 

public class DeviceDisplay {

boolean selected {get;set;}

string DeviceNotes{get;set;}

.....

 

Wrapper Class DeviceDisplay (sObject dev){

selected = false;

sObject proxy_adev = dev;

......

}

 

 

 

 

 

 

 

 

Any help is appreciated, even if it is try searching for this or puesdo code. Just looking for some direction here. Thanks, Newbie.

 

I am not sure if i am asking this question correctly or googling it correctly either.

I am trying to do someting as follows but don't want to use nested for loops, unless that is the only way - which in any case I am still not recieving my expected results.

 

For(custObj_A var1 : map1.values()){
 For(custObj_B var2: map2.values(){
   if(var2.field == var1.field){
      new custObj_D from the values of both custObj_A and custObj_B; 

 

 

The problem I am having is that custObj_B has multiple matches to 1 CustObj_A.

 

I am expecting:

1 - 1

1 - 2

2 - 1

2 - 2

 

but receiving:

1 - 1

2 - 1

 

What am I missing here?

 

 

Hi -

I need to cretae a custom field to hold a Dollar amount.  It's for a donation letter for a Non-Profit where most of the amounts are whole dollars.  But some do have decimals.


They want the Conga Letter to print as

$20

OR

$566.23

 

For the bulk of the donations, with no Decimals ($20, $100), they just want to print the amount.  But for those with decimals, they want to print the decimals ($106.87).

 

Is there a way to use a formula field or something in SF so I can put that in my Conga Template to print as they wish?


thanks!

Sara

  • August 06, 2013
  • Like
  • 0

I have a datatable of sObjects that I paginate over. In order to preserve the user information for the selected objects I was capturing the selected objects and placing their values in another map. This was working until i decided to expermient with generic sObjects. This is just quick code as my question is more about how to assign a variable from one wrapped sObject Map from another.

 

..........

for(DeviceDisplay dev:deviceDisplayMap.values()){
        if(CurrentSelectionMap.containskey(dev.proxy_adev.id)){
                  dev.selected = true; //THIS WORKS
                  dev.devicenotes = CurrentselectionMap.get(dev.proxy_adev.id).devicenotes; //THIS WORKS

                  //This is were I get lost. Is this possible?

                  dev.proxy_adev.put('request__c' , CurrentSelectionMap.get(dev.proxy_adev.id) ????????? get('request__c'));

                  .......

 

 

Map<ID,DeviceDisplay> DeviceDisplayMap

Map<ID,DeviceDisplay> CurrentSelectionMap

 

public class DeviceDisplay {

boolean selected {get;set;}

string DeviceNotes{get;set;}

.....

 

Wrapper Class DeviceDisplay (sObject dev){

selected = false;

sObject proxy_adev = dev;

......

}

 

 

 

 

 

 

 

 

Any help is appreciated, even if it is try searching for this or puesdo code. Just looking for some direction here. Thanks, Newbie.

 

I am not sure if i am asking this question correctly or googling it correctly either.

I am trying to do someting as follows but don't want to use nested for loops, unless that is the only way - which in any case I am still not recieving my expected results.

 

For(custObj_A var1 : map1.values()){
 For(custObj_B var2: map2.values(){
   if(var2.field == var1.field){
      new custObj_D from the values of both custObj_A and custObj_B; 

 

 

The problem I am having is that custObj_B has multiple matches to 1 CustObj_A.

 

I am expecting:

1 - 1

1 - 2

2 - 1

2 - 2

 

but receiving:

1 - 1

2 - 1

 

What am I missing here?