Python - Can I use .getSyncInfo().toMultilineHumanReadableString() ?

Stuart Beesley (Mr Toolbox)'s Avatar

Stuart Beesley (Mr Toolbox)

06 Nov, 2020 10:00 AM

I noticed that some scripts have used item.getSyncInfo().toMultilineHumanReadableString() to display/dump the raw contents of an item. E.g. currency.getSyncInfo().toMultilineHumanReadableString().

So at first glance, this looks like a great and easy way to show a record's contents.

However the API description says:
"save this item to a new SyncRecord and return it. This is a shortcut to SyncRecord r = new SyncRecord(); itemWillSync(r); return r;"

Which infers it's doing some kind of record update. Can you advise what this function actually does and whether it is safe to dump/display a record's contents (without doing any updates - i.e. it's readonly).... AND can it be safely called on any object type (e.g. account, txn, currency, etc etc)

If it's actually a record update, perhaps the function/method name is 'misleading'?

Many thanks

  1. 1 Posted by Stuart Beesley ... on 17 Nov, 2020 10:08 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    ??

  2. System closed this discussion on 16 Feb, 2021 10:10 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac