Get and set using Plugin in MS Crm

 If you want to set up data immediately then go for the JavaScript. if you want to set or get the data on form save then use the plugin. in this post we will discuss about get and setting of data using plugin.

Fist we discuss about getting the data.

Single and multiple line of text:

return type is string.

string varname= targetobject.Contains(Schemaname)?(string ) targetobject[Schemaname]:null;


Option set:

return type is OptionSetvalue

for getting the value of the option set

OptionSetValue Varname= targetobject.Contains(Schemaname)?(OptionSetValue ) targetobject[Schemaname]:null;

Varname.Value for the value reading


Two Option Set

return type is bool 

bool Varname=  targetobject.Contains(Schemaname)?(bool ) targetobject[Schemaname]:null;


Whole Number 

return type is integer

int Varname=  targetobject.Contains(Schemaname)?(int) targetobject[Schemaname]:null;

Floating number and Decimal number

return type is Dounble

doubleVarname=  targetobject.Contains(Schemaname)?(double) targetobject[Schemaname]:null;


Datetime

Return type is datetime

DateTimeVarname=  targetobject.Contains(Schemaname)?(DateTime) targetobject[Schemaname]:null;


Currency

Return type is money

Money Varname=  targetobject.Contains(Schemaname)?(Money) targetobject[Schemaname]:null;


Multioption set

Retrun type is Optionsetvaluecollection

OptionSetValueCollection Varname=  targetobject.Contains(Schemaname)?(OptionsetValueCollection )

 targetobject[Schemaname]:null;

Lookup and Customer 

EntityReference

EntityRefernce Varname=  targetobject.Contains(Schemaname)?(Entityreference) targetobject[Schemaname]:null;


We will discuss about setting the data using plugin.

Entity Object = new Entity ("Schema name of entity");

Single and multiple line

Object ["Filedschemaname"]= "Data";


OptionSet 

Object ["Filedschemaname"]= new OptionSetValue(pass the Value of the Option);


Two Option Set

Object ["Filedschemaname"]= true/ false;


Lookup and Customer

Object ["Filedschemaname"]= new EntityReference ("EntitySchemaname", new Guid("Record id");


DateTime

DateTime Obje= new DateTime (year,month,date);

Object ["Filedschemaname"]= Obje;


Number type 

Object ["Filedschemaname"]=number;


Currency

Object ["Filedschemaname"]= new Money (value);


These Are the setting and getting the data using plugin.


Thanks for reading my post and follow the blog for the latest Post.


Comments

Popular posts from this blog

Connect MS Crm To Postman For Webapi Calls.

create HTML page show all contact related to specific account, add this webresource as a subgrid in the form

create one PCF control and embed into crm