function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jordanmjordanm 

Salesforce object: columns to rows

Hello,

 

How would one convert the data in an object in the following way:

 

From this:

 

Object A: 1 record

ContactId,Phone,MobilePhone,HomePhone

a000axb03423xbg,222-222-2222,111-111-1111,000-000-0000

 

To this:

 

Object B: 3 records

ContactId,PhoneToCall

a000axb03423xbg,222-222-2222

a000axb03423xbg,111-111-1111

a000axb03423xbg,000-000-0000

 

This is a data conversion that I'd have to be able to schedule out of SF on a nightly basis.

 

This could be accomplished in SQL pretty easily or if I could replicate my force data down into a SQL database, but I'm not finding a way to do it in SOQL. Any suggestions?

 

Best Answer chosen by Admin (Salesforce Developers) 
sandeep@Salesforcesandeep@Salesforce

This can be achieved easily by writing code in apex scheduled class. now schedule it  by navigating :-

 Goto Setup-> Apex Class -> now you will get a button "Schedule Apex".

All Answers

Arun MKArun MK

Hi,

 

This can be achieved by building reports using Visualforce Page and Apex.

Let me know, if this is what you want?

 

Regards,

Arun.

sandeep@Salesforcesandeep@Salesforce

This can be achieved easily by writing code in apex scheduled class. now schedule it  by navigating :-

 Goto Setup-> Apex Class -> now you will get a button "Schedule Apex".

This was selected as the best answer
jordanmjordanm

I don't so much require a visual (VF) output as I do the correct data in the correct format to be dumped into a custom object so that I can comfortably schedule extracts with the data loader against it.

 

I'll try some custom apex in a schedulable class and post results.

 

Thank you.

sandeep@Salesforcesandeep@Salesforce

Can you please click on Star icon to give me Kudos