Hi,
in SO Windows with vbscripts by Trigger Sales beforeSave, I can get value of user-defined list item:
division = objSO.GetListItem(currentSale.Udef.ByProgId("SuperOffice:1").ListTableId, division).Text
but in SO CLoud or SO Web with crm script, with this i get ID of List item back:
devision = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:1");
Is there way to get its ListItem Value back, only with SearchEngine?
Thanks!
Alle Antworten (8)
i do it with searchEngine:
divisionID = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:1");
SearchEngine se;
se.addField("UDList.name");
se.addCriteria("UDList.UDList_id", "OperatorEquals", divisionID);
for (se.execute(); !se.eof(); se.next()){
division = se.getField(0);
}
just, There are many userdfined List in Sales to post their Value in scripts.
Hi,
It is possible to use NSMDOAgent to get value of selected item. In my case I have an Userdefined list with ID 99
#setLanguageLevel 3;
EventData ed = getEventData();
String listId = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:1").after(":").before("]");
if(listId != "")
{
NSMDOAgent agent;
NSMDOListItem item = agent.GetListItem("udlist99", listId.toInteger());
String listName = item.GetName();
}
Hi Michel,
yes, works, lernt from you the object of NSMDOListItem.
Just i don't need .after(":").before("]") for return ListId, it returns simple the ID of that ListItem.
and by the way, is there select case of vbs in crm script? to get value by diff. case.
Thanks!
You would need to use If statements to accomplish this in CRMScript.