• karhtik palakurthi
  • NEWBIE
  • 0 Points
  • Member since 2018

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

I have two objects Object A and Object B, is it paossible to consider the fields of object A and send them in the jason pay load of object B.

 

Im using Rest services for call outs and Josn Format of the payload. I just the data of the fields in the object A to be passed on to the payload of the object B. 

 

My jason structure is like below.

{

field 1

field 2 

.

.

.

.

Object B :[

{

Field 23

Field25

.

.
}

]

}

I'm getting input values as string for fields like month__c = '4' and year__C = '2009'. now I have to calcuate the the number of months and number of years then save it to the fields months__c and year__c.

example:

user input in lighning page

enter month joined =4 (months__C field)

enter year joined = 2009 (years__c field)

Output should be: 

years__c = 9

months__c = 4

how to do this? 

I also have date(StartDate__c) field which will save the date as 4/1/2009 should I use the formula field? or do I need to work this in controller class. The whole purpose is to send these fields in to the integration payload.