Thursday, 26 July 2018

delegated Administrator in salesforce

The delegated administrator is a concept
that extends certain privileges to non-admin
users in order to allow them to perform
admin functions.The actions that delegated
administrators can perform include the
following

1.User administration
2.Assignable profiles
3.Custom object adminsistration

Look UP relation ship in salesforce

1.You can define a lookup relationship between
any two objects, standard or custom.

2.When a parent object is being deleted,
you can configure a child object to either
clear the parent record value in the child
record or prevent deletion of the parent
record.

3.The child record may not require a
related parent record.

4.Each child record has an owner and is
not related to the parent record.

5. There is no security or inheritance
between related parent and child records.

6.To relate an object to other objects,
there is no condition on the number of records.

7.You cann't create the roll-up summary
field in the lookup relationship.

8.Does not support cross-object workflow.

How to create master-detail relationship in salesforce?

Master detail relationship is like parent
-child relationship where, master represents
a parent and detail represents a child in
which master object controls some
behaviours of the detail object.
Like whenever a master object record is
deleted then the detail object related
to it also gets deleted.


Master-detail relationship can be defined
between custom objects or between a
standard object and a custom object.
The detail object automatically gets the
security and sharing settings given to
the master object.


A child of one master detail relationship
can't become a parent of another object.
To relate an object to another object,no
records should exist in the child object.


Rollup summary fields can only be created
on Master records,which are used to
calculate the count,sum,min,max ect of
child records.

Note :
=========
we can't create a master - detail relationship
on existing records.To do that,we have to
create a lookup relationship for that
record and then convert it into master detail.

The master detail relationship does not
allow for 'orphaned' child records.


To convert a lookup relationship to a
master detail the existing record should
consist of valid lookup field values.

You can build many to many relationships
using two master details relationships in
an object, and it is called as junction object.

Standard objects can't be on a detail side
of a master detail relationship.Access to
detail is determined by the access given
for master.

supports cross-object work flow.you can
configure a field update action to
update a field in the parent record
using a value from the child record.

Limitations :
===============
1.Only upto two master detail relationships
are allowed for an object.
2.you can have only Upto three levels of
custom detail levels.
3.We can't create a master-detail relationship
when the custom object already contains data.

4.Each object is allowed to have one or two
master or upto 8 details.

5.After converting a lookup field into master-
detail relationship,test your custom reports,
whther they are usable or not.
Sometimes upon converting the custom reports
can become unusable due to different standard
report types.

Friday, 19 May 2017

ref vs out parameter in c#

ref tells the compiler that the object is initialized
before entering the function,while out tells
the compiler that the object will be initialized
inside the function.

ex: ref:
=========

public static void Main()
{
 int i = 3; // Variable need to be initialized
 sampleMethod(ref i );
}

public static void sampleMethod(ref int sampleData)
{
 sampleData++;
}

Note :
1.A ref variable needs to be initalized before
passing it in.
2.ref parameters can be thought of as both
input and outup variables.


ex: out :
===========

public static void Main()
{
 int i, j; // Variable need not be initialized
 sampleMethod(out i, out j);
}
public static int sampleMethod(out int sampleData1, out int sampleData2)
{
 sampleData1 = 10;
 sampleData2 = 20;
 return 0;
} 

Saturday, 17 December 2016

Typeof() vs GetType()


 GetType():
====================
if you want to obtain the type from an instance of your class,you can use GetType().

GetType() returns run time type of the instance.

TypeOf():
===============
if you don't have an instance,but you know the type name,you would use typeof().

TypeOf() gives the compile time of class.

Note :
=====
Operator TypeOf(ClassName) is used to obtain the System.Type object for a Type at compile time.

MyObject.GetType() is used to obtain the exact run time type of object.This method uses reflection.

Finalize vs Dispose in C#

Finalize() is called by Garbage Collector to free unmanaged resources.The garbage collector calls this method at some point after there are no longer valid references to the object.

some resources like windows handles,database connections which cannot be collected by the
garbage collector.Therefore the programmer needs to call Dispose() method of IDisposable interface.

Dispose() of IDisposable interface is called by the programmer to explicitly release resources when they are no longer being used.Dispose() can be called even if other references to the object are alive.

Arguments vs Parameters in C#

Parameters :
==================
A parameter is a variable in
a method definition.

ex :
public void MyMethod(string my param)
{
// your coding
}


Arguments :
================
when a method is called,the arguments
are the data you pass into the method's
parameteres.

ex :
string myarg1="This is my argument";
myclass.MyMethod(myarg1);