Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

crm 4.0 code immigrate to crm 2013

$
0
0

Hi all experts,

I am newbie in crm and now we upgrade crm 4.0 to crm 2013. I did not work with crm 4.0 and have very little exprience by crm 2013 (4 Months). I must immigrate Plugin to crm 2013 and there some update code i can't do anything to immigrate 2013.

Can any expert explain or help me what i must do how i must create code?

The code ;

 public static Guid createProjekt(int nr) {
            Entity projekt=new Entity();
            projekt.LogicalName="tqu_projekt";
            //test durch nr ersetuzen mit führende nullen
            if(nr < 10){
                projekt.Attributes["tqu_name"]="P_00000" + nr;
            }else if(nr < 100) {
                projekt.Attributes["tqu_name"]="P_0000" + nr;
            } else if(nr < 1000) {
                projekt.Attributes["tqu_name"]="P_000" + nr;
            } else if(nr < 10000) {
                    projekt.Attributes["tqu_name"]="P_00" + nr;
            } else if(nr < 100000) {
                projekt.Attributes["tqu_name"]="P_0" + nr;
            }
            projekt.Attributes["tqu_projektnummer"]=new CrmNumber(nr);
            TargetCreateDynamic tcd = new TargetCreateDynamic();
            CreateRequest cr=new CreateRequest();
            tcd.Entity=projekt;
            cr.Target=tcd;
            CreateResponse r=(CreateResponse)cs.Execute(cr);
            Guid g=r.id;
            LogicalOperator("Projekt erzeugt");
            return g;

        }

    public static void updateEntity(SqlConnection con, CrmService cs, Entity entity) {
            try {
                TargetUpdateDynamic updateDynamic=new TargetUpdateDynamic();
                updateDynamic.Entity=entit;
                UpdateRequest update=new UpdateRequest();
                update.Target=updateDynamic;
                UpdateResponse updated=(UpdateResponse)cs.Execute(update);

            }catch(Exception e) {
                Log("Create entity failed: " +e.Message;
            }
        }

public static void updateAccount(SqlConnection con, CrmService cs, Entity entity) {
            try {
                //con.Open
                TargetUpdateDynamic updateDynamic=new TargetUpdateDynamic();
                updateDynamic.Entity=entit;
                UpdateRequest update = new UpdateRequest();
                update.Target=updateDynamic;
                UpdateResponse updated=(UpdateResponse)cs.Execute(update);
                //con.Close();

            } catch(Exception e) {
                Log("Create entity failed: " +e.Message);
            }
        }

Thanks a lot who spend time to read this message and going to help me


Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>