Author Topic: Null Values in Custom Script Fragments  (Read 3767 times)

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Null Values in Custom Script Fragments
« on: November 09, 2014, 10:56:38 pm »
Hi!

Is there a way to pass a null value, rather than an empty element, in a custom script XML?

If I define a row without, say a "Name" element, the output from the custom fragment is to show "Name". If I create a <Name/> element, the fragment "prints" the blank - but includes the headings and space I'd like to remove with bookmarks.

Is there any way of having an optional custom field and using bookmarks with it, like you can with normal fragments?

Thanks!

Screwtape.
Screwtape

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Null Values in Custom Script Fragments
« Reply #1 on: January 12, 2016, 08:17:19 pm »
Hi Again!

I'm still trying to find out if this is possible. I note a recent post regarding lists in custom fragments, and that bookmarks for CustomSQL_TITLE_Begin and CustomSQL_LIST_Begin etc. are functional. However, having tried all sorts of combinations of bookmarks such as CustomSQL_Notes_Begin or CustomSQL.Notes.Begin etc., have failed to have any effect. If the value in the custom XML is an empty string, the text between the bookmarks is printed, along with the blank custom field, and if the custom XML is doesn't have the relevant field (in this case Notes) then the default value is displayed, along with all the text between the bookmarks.

That this doesn't work makes the custom fragments much less useful in themselves, since doing any "clever" formatting or optional fields is virtually impossible.

Thanks for any suggestions!

Screwtape.
Screwtape