0
votes

I'm building an integration that needs to extract data from an Acumatica record and convert it to a json string. My process for doing this is using an export scenario to define what data gets pulled from the record. Is there any way that I can leverage the logic in SYMappingUtils/SYImportProcessor to pull data? Ideally I want to pass the record and the mapping to a method, and it returns the mapped data/formula evaluations from that record. Below is how I've been able to get a portion of the data, but it doesn't work for most PXSelector fields. It pulls the integer key value and doesn't return the CD value like the export scenario does.

Also, if I run this code from an export scenario (scenario calls button on record) or by using the Mass Action GI, it doesn't always load up all of the views/caches so some data isn't returned because the view/cache is null. If I run it from the record itself, it always works.

Base.Views[objectName].Cache.GetValue(Base.Views[objectName].Cache.Current, fieldName);