Discussions

Ask a Question
Back to All

Alternative to EntityManger FindSingle function

We are upgrading a iMIS 2015 Q4 (ver. 20.2.26.3109) site to iMIS 2017 (ver. 20.2.66.1198).

Some custom panels that were created no longer work in 2017.

The code

   var em = new Asi.Soa.ClientServices.EntityManager("Manager");
        
        //Set TnC and PP Accepted for individual

        var p_info = new GenericEntityData  { EntityTypeName = "FF_COMPANY_INFO" };
        var fnd = new CriteriaData("PartyId", OperationData.Equal, ContactID);

        QueryData q = new QueryData();
        q.EntityTypeName = "FF_COMPANY_INFO";
        q.Criteria.Add(fnd);
        p_info = (Asi.Soa.Core.DataContracts.GenericEntityData)em.FindSingle(q);

        p_info["TNCS_ACCEPTED"] = "True";
        p_info["PP_ACCEPTED"] = "True";

The FindSingle function has been deprecated for the Asi.Soa.ClientServices.EntityManager object, and we do not know what is used to replace it. The Find function is not compatible with the Asi.Soa.Core.DataContracts.GenericEntityData object, which the FindSingle result was in 2015.

Ant ideas how this code can be altered to work in 2017?