Thursday, 22 December 2011

How to use 'Schema- Builder' in Salesforce


Hi All,  while working with salesforce we have to deal with many S-Object and Custom-Objects.we need to set up relation ship (Master/Lookup) among these all.But to keep this relation-ship in mind is very typical.
 To get a rid of this problem Salesforce has provided it's new tool "Schema-Builder".

Specification:-
--------------
In Schema Builder We may observe relation ship among many objects.Different different color lining are used to make it clear and out of any sort of technical-dilemma.
to configure
1.)go to Set up ->App setup->where you will easily 'Schema builder' link.

2.) click on this link you will be redirected t new Page with schema home page where you will get a list of objects.
3.) Select object to view pre-defined relationship among them.


Saturday, 26 November 2011

How to Transfer Attachments from One Sobject to Another One

Here I am giving an example to transfer attachments from Opportunity to case Sobject
 
List insertingAttachments = new List();
List deletingAttachments = new List();
for(Attachment atch :  [select id,name,body from Attachment where parentid = 'your Opportunity id' ]){
   Attachment  newattch = new Attachment();  
   newattch = atch.clone(false);
   newattch.body = atch.body; // required field
  newattch.name = atch.name;// required field  
  newattch .parentId = 'your Case id ';
  insertingAttachments.add(newattch); 
  deletingAttachments.add(atch);
}
insert   insertingAttachments;
delete  deletingAttachments