Answered

how to set multiple values in parameter entity in rule expressions?

I have a requirement in which i have to extract values from db using this function CEntityManager.GetEntity("EntityName").GetEntityList("", "", "", "");

what is the way to do that. i am doing some thing like this but it is not working it gives me error.

var instanceObject=CEntityManager.GetEntity("EntityName").GetEntityList("", "", "", "");

for (var i = 0; i < instanceObject.Length; i++) {

if(instanceObject[i].Attributes["CaseId"].Value!=null){

EntityName.AttributeName=instanceObject[i].Attributes["PortCallCaseId"].Value;

}

}

Comments (4)

photo
1

Dear Rahul,

The following code is to loop a parametric entity and add values to a collection:

  1. Int i=0; Object EntFilesList=null;
  2. EntFilesList= CEntityManager.GetEntity("fileEntity").GetEntityList("", "", "", "");
  3. for(i=0; i< EntFilesList.Length; i++)
  4. {
  5. var key=EntFilesList.SurrogateKeyValue;
  6. var newFile= Me.addRelation("credict_request.Files");
  7. newFile.setXPath('fileEntity',key);
  8. }


Regards

photo
1

Hello, I'm not so good with code, but I think the one that you show might be what I need. I'm trying to add the values from a parametric entity to a collection when initiating a case (on enter for the first activity of the process) so the will be populated for the user when he starts to work. The collection name is Habilidades and the parameter entity from which I'm trying to get the values is Habilidad (see attached file), is it possible to use the code above to do what I need, and in case it is could you please tell me how to replace the values in the code so it works for me, thanks.

photo
photo
1

Hello, I´m having a similar issue, I have a set of values from a parametric entity and I need them to be added to a collection table "on enter" when creating a new instance of a case, will this code work for that specific situation? if not how can it be done

photo
1

Dear Daniel,

Yes, it is a similar situation. You can use the following steps from 1 to 3 of the attached article to analyse and change what you need.

Regards

photo