• Sandrine94748
  • NEWBIE
  • 130 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 4
    Replies
Hello,

I have a usescase where i need to distribute a amount for period of 3 years.
If example total is 36k and if the start date is in Jan 2016 then the amount is dristributed as 12k for 16,17 & 17.
But if the start date is in Oct 2015 then the amount will be
2015 = 3k
2016 = 12k
2017 = 12k
2018 = 9k

Each of the amounts will be stored in the specific field, how cn i create a algo for it.
thank you for suffestion

Hello,

I have a junction object between and contact and a custom object like below

Custom_object_X__C
- Id

Jucntion__c
-Id
- LookUpToJCustom_object_X__c
-LookUpToContact__c

Contact
-Id

On the custom object there is a related list of Jucntion__c, so in page layout it is like below

Record of Custom_object_X
- Name
- Picklist X
- ......
- ....
>Related list 1
>Related list to display Jucntion (This related list will also display the contact it is related to in one of the column)

Use case:
I want a custom button to select few records of junction and send an email to contacts. also if possible to select the emil template of choice

Like below, we are abe to select the quote, simillarly i want to able to select the records on junction object and send email to Quote
User-added image 

thanky you for sugetion
 

Hello,

I have following error:
System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out

My usecase:
I am calling a webservice in a future handler. 

Other workaround i tried:
I tried to call the webservice without a future handler, but as i am calling in trigger it is giving me error.

Can someone please tell me any workaroud ?

thank you
Hello,

I am trying to get a value of custom field using sObject.
Can someone help me with this
          sObject sObj = new QuoteLineItem();

           for (QuoteLineItem q : qli){
               sObj = q;
				
               System.debug('$$$'+q.Product2.Obj1__r.cf1__c);  //output is TRUE as field is a boolean
               System.debug('$$$'+String.valueOf(q.Product2.Obj1__r.cf1__c)); //output is TRUE 
               System.debug('$$$'+string.isNotBlank(String.valueOf(q.Product2.Obj1__r.cf1__c)));  //output is TRUE
               if(string.isNotBlank(String.valueOf(sObj.get(fieldToCompare)))) { //ERROR: Invalid field Product2.Obj1__r.cf1__c)
                   //Do something
			   }	             
            }

I am obliged to use SObject as i have specific use case.
I just want to get the value of Product2.Obj1__r.cf1__c using sObject.
i am able to retrive it using q.Product2.Obj1__r.cf1__c but as in sObject, there is missing q, this can be the reason it is not retriving.

thanks for suggestion