Tuesday, 22 February 2022

List value get from Json in D365 F&O

Public static void createAddresses(RefRecId _partyRecId, List _list)

{

ListEnumerator electronicAddressEnumerator;

        str getJsonValue(Newtonsoft.Json.Linq.JObject jsObject, str propName)

      {

const str EmptyValue = '';

if(jsObject != null && jsObject.HasValues)

{

Newtonsoft.Json.Linq.JToken jToken = jsObject.get_Item(propName);

return jToken ? jToken.ToString() : EmptyValue;

}

return null;

      }

electronicAddressEnumerator = _list.getEnumerator();

while (electronicAddressEnumerator.moveNext())

{

Newtonsoft.Json.Linq.JObject electronicAddEnum = electronicAddressEnumerator.current();

this.Description  = getJsonValue(electronicAddEnum, 'Description');

}

}

No comments:

Post a Comment

DefaultDimension in d365 FO X++

 Navigate to PurchTable methods you can find with DefaultDimension this.DefaultDimension = this.mergeDimension(this.getDefaultDimension(),th...