Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Null reference exception

$
0
0

I run into null reference exception when I execute code activity on server.

protected override void Execute(CodeActivityContext context) {
        //IWorkflowContext executionContext = context.GetExtension<IWorkflowContext>();
        //IOrganizationServiceFactory serviceFactory = context.GetExtension<IOrganizationServiceFactory>();
        //IOrganizationService service = serviceFactory.CreateOrganizationService(executionContext.UserId);

        //XmlDocument doc = GetEmbeddedXMLDocument();
        //XDocument xDoc = doc.ToXDocument();

        ////context.SetValue<bool>(IsExist, false);

        ////string ent = context.GetValue(InputEnt);
        ////string searchAtrib = context.GetValue(SearchAttrib);
        //////string condition = context.GetValue(Condition);
        ////string attribValue = context.GetValue(AttribValue);

        ////QueryByAttribute query = new QueryByAttribute(ent);
        ////query.ColumnSet = new ColumnSet(new String[] {searchAtrib});
        ////query.Attributes.Add(searchAtrib);
        ////query.Values.Add(attribValue);

        ////EntityCollection retrived = service.RetrieveMultiple(query);

        ////if (retrived.Entities.Count>0) {
        ////    context.SetValue<bool>(IsExist, true);
        ////}

        //var docData = new JObject();
        //docData = ParseDataStringToObject(context);

        //SysColl.List<DataContainer> entityes = new SysColl.List<DataContainer>();
        //FillEntityes(xDoc, entityes);
        //entityes.OrderBy(x => x.Order).ToList<DataContainer>();

        //CreateEntityesInMemo(entityes,docData, service, context);
    }

calling function. Ordinary XMLHttpRequest behind the scene.

var result = Process.callAction("kr_ParseInitialData",
        [{
            key: "InputEnt",
            type: Process.Type.String,
            value: json_object
        }],
        function () {
            //createAttachment(attachmentData);
            debugger
            clearFormControls();
            alert(result);
        },
        function (errInfo) {
            alert(errInfo);
        });

As you can see, I comment everything, but still get the same exception. In Debug code works fine. Any ideas? Sincerely.


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images