NSSource and UserDefinedFields GetDeleted();
Hello Team,
I am trying to set up a script that will prevent our users to close sales that have depracated Sources or in our case, "Sale Department" (Custom Field).
After reviewing the documentation, I noticed the Source does not have the GetDeleted() method, and I can't seem to find any information on UserDefinedFields, other than getting them from EventData or mapping them via the Sale Entity.
Do you know how I could go about getting the "Deleted" flag for these two?
Thank you!
#setLanguageLevel 3;
EventData ed = getEventData();
/*Source*/
Integer sourceId = ed.getInputValue("SaleEntity.Source.Id").toInteger();
Integer saleId = ed.getInputValue("SaleEntity.SaleId").toInteger();
NSSaleAgent saleAgent;
NSSaleEntity saleEntity = saleAgent.GetSaleEntity(saleId);
NSSource source = saleEntity.GetSource();
String name = source.GetValue();
/*Sale Dpt*/
//“SaleEntity.CustomFields.SuperOffice:3:DisplayText": "1234 SaleDepartment",
//"SaleEntity.CustomFields.SuperOffice:3:DisplayTooltip": "Tolltip",
//"SaleEntity.CustomFields.SuperOffice:3:org": "[I:45]"
String saleAzetsCompany = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:3");
All Replies (4)
Hello,
Will it be possible to make the GetDeleted() method available for CustomFields and source?
Hi Andrei,
With custom tables you can use Search Engine. Examples you can find in
https://docs.superoffice.com/en/automation/crmscript/searchengine/se-insert-update-delete.html
For a sale you can use DeleteSaleEntity
More about this -> https://docs.superoffice.com/en/sale/howto/crmscript/update.html
If I misunderstood your question, maybe you can give us an example.
Carrier objects of list items like Source (or Category, etc), do not include the deleted flag.
If you want to know if a list item is deleted you could use the GetListItem method of the mdo agent.
In case of default lists, the list name can be found here: MDO List Providers
In case of a custom/ud list, the list name is 'udlist[UDListDefinitionId]' (without the brackets)