Xero API > Invoices > PUT > Tracking Categories - xero-api

Following:
https://developer.xero.com/documentation/api/invoices#post
It suggests you can add a Tracking Category when creating an invoice in the XML format:
<Tracking>
<TrackingCategoryID>ABC</TrackingCategoryID>
<Name>Name</TrackingCategoryID>
<Option>Option</Option>
</Tracking>
Within the
<LineItem>
node
Which is within the
<LineItems>
node
However, when doing this, the API returns:
Object reference not set to an instance of an object.
Which I understand to mean it doesn't recognise an element / node within the XML.
Without the node, everythings works fine, so it's the node and nodes within which cause the problem. Individually testing each sub node within results in the same problem.
I'm pretty sure I'm following the structure as per docs at https://developer.xero.com/documentation/api/invoices#post so if anyone can shed some light as to the correct structure to add Tracking Codes to an invoice line item...!
Most appreciated,
Thanks
Rob

I ran into the same issue. When posting XML for Tracking Options in Xero, the tracking data should be inside a TrackingCategory XML element, such as below:
<Tracking>
<TrackingCategory>
<TrackingCategoryID>ABC</TrackingCategoryID>
<Name>Name</Name>
<Option>Option</Option>
</TrackingCategory>
</Tracking>
TrackingCategoryID is optional, and you can have a maximum of 2 TrackingCategory elements.

Related

SSAS TokenizationBehavior

Within the dimension properties for an attribute within SSAS, there is an option called TokenizationBehavior which is defaulted to TokenizationNone. The alternative is TokenizationText.
I tried it out and it gives an error message as per below. There is little content on the internet about anybody trying this out or what it is actually for. Any ideas? I'm not sure if this Tokenization is for parsing text or a security mechanism? And why it doesn't work or how it's supposed to work in SSAS?
The ddl500:TokenizationBehavior element (namespacehttp://schemas.microsoft.com/analysisservices/2013/engine/500) cannot appear under Envelope/Body/Execute/Command/Batch/Alter/ObjectDefinition/Database/Dimensions/Dimension/Attributes/Attribute
I looked at the XML code which adds the below line if you put TokenizationText in the dimension attribute properties:
<ddl500:TokenizationBehavior valuens="ddl500_500">TokenizationText</ddl500:TokenizationBehavior>

Modifying Domain of Many2One using Many2Many

Just to preface, I'm using Odoo 10 Enterprise.
I have a custom module with the following (these are just the relevant fields) on its form:
orange_tag_id = This is a Many2Many field with the _Checkboxes widget defined that's connected to a Tags module (we'll just call it orange.tags). This field displays six or seven tags I've created and then applied to various products within the 'product.product/template' module.
orange_child_ids = This is just a One2Many within a child module of the parent module. This lists a product_tmpl_id Many2One and then a read-only copy of orange_tag_id from the parent that just copies whatever is selected in orange_tag_id in the parent form (this was created just in case defining parent.orange_tag_id in the domain didn't work).
When a tag is selected from the orange_tag_id checkbox, it should sort of modify the domain of product_tmpl_id in orange_child_ids and then only display the products in the drop-down display that have been tagged with the selected active tag. I've managed to get this sort of working by just adding the following to the form XML view within orange_child_ids:
<field name="product_tmpl_id" domain="[('orange_tag_id.id','in',parent.orange_tag_id[0])]"/>
This will display only the products that have been tagged with the selected tag with one exception: Tag6's products (just calling it this because its ID was 6) will always display in the drop-down regardless of whether it's selected or not. If Tag2 is selected, then Tag2 and Tag6's products will display. I tried removing Tag6 from any products that had it defined, then deleting the Tag6 record, re-creating the tag, and re-applying it to the relevant products, but the issue persists. I also can only select one tag in the checkbox -- if more than one is selected, I get the following error from product_tmpl_id:
TypeError: not all arguments converted during string formatting
This isn't as big of a deal as not having the correct records displaying, but I'd also like to resolve this, but I'm not entirely sure how.
I've searched for hours and am aware of methods where this can be done in self-hosted installations, however, we're using Odoo 10 Enterprise (I've omitted the required x_ in my aforementioned custom fields just for easier readability), and I have no access to the file system and consequently can't make modifications where that's required. I've been trying to figure this out using just the Developer Tools and my administrative access to the database's settings.
I've messed around a lot with the domain, looked through many questions and forum threads, and what I have was the only thing that worked. Is there any way to get this working correctly within the limitations of Enterprise?
Much obliged.
It appears that adding [2] after the [0] makes everything work and resolves the two issues I was having, so:
<field name="product_tmpl_id" domain="[('orange_tag_id.id','in',parent.orange_tag_id[0][2])]"/>
This will filter the results of the Many2One based on the records selected in the Many2Many field.
While [('orange_tag_id.id','in',parent.orange_tag_id[0][2])] will work, it is extremely obscure.
I advise you to go with [('orange_tag_id.id','in',parent.orange_tag_id.ids)]

Retrieve view Informations 1010data

I have a view in my 1010data base and it has created by someone else I want to identify its description and is their a direct api call to get that information.
Already tried with following Commands. it gave following errors.
using dir api endpoint.
<out>
<rc>15</rc>
<msg>Not a directory: xxx.views.test</msg>
</out>
using tabinfo endpoint.
<out>
<rc>22</rc>
<msg>Not currently implemented for Quick Query: XXX.views.test</msg>
</out>
Is their a command to see the structure of view and related tables?
I can retrieve column names using querydata api end point but i cannot get informations related to linked tables.
Is their a command or endpoint to get this information.
Something like Show create view in Mysql :)
Have you tried gettab ?
documentation is here:
https://www2.1010data.com/documentationcenter/beta/XMLAPI/TableManagement/XMLAPI-gettab.html
It says there "If the table is a query (i.e., type is VIEW, PARAM, MERGED or TOLERANT) then the tab element will contain ops and dependencies elements. Any dependencies on other tables (i.e., links, merges) are available in the element, which contains a list of table references if the table is a Quick Query or a merged table."
Can you please confirm if that works for you?
Thank you!

xpath filter while parent node changes name

I am trying to get the value of a node from third party source. Part of the Xmlstructure has a node whose name changes between, point and framedPoint. how do I get the latitude value?? here is part of the xml, their are many levels to the xml so have shown the relevant area.
here node is called point
<tpegpointLocation xsi:type="TPEGSimplePoint">
<point xsi:type="TPEGJunction">
<pointCoordinates>
<latitude>54.894825</latitude>
</pointCoordinates>
</point>
</tpegpointLocation>
here framedPoint
<tpegpointLocation xsi:type="TPEGSimplePoint">
<framedPoint xsi:type="TPEGJunction">
<pointCoordinates>
<latitude>54.894825</latitude>
</pointCoordinates>
</framedPoint>
</tpegpointLocation>
Thanks, for any help
You could use asterisk as a wildcard in your xpath
/tpegpointLocation/*/pointCoordinates/latitude
The following XPath would do the job:
//tpegpointLocation//pointCoordinates/latitude
Which means:
//tpegpointLocation search for all <tpegpointLocation> elements in the XML file
The second //pointCoordinates means search for all <pointCoordinates> elements below <tpegpointLocation> regardless which elements are between them (one or more or different names
/latitude means get the <latitude> element below <pointCoordinates>
Please note that using // scans whole XML file. If you are able to change //tpegpointLocation it would be better and faster.

GetResource, dynamic parent.

my problem is the following. I'm currently making a blog-page with get-page, get-resources, form-it, and wayfinder. This question requires a decent amount of knowledge about Modx and snippits. I've got the page numberin and all working and i've got a template page with all my calls in it (called weblogTemplate). This template has the following wayfinder call in it :
[[!getResources? &parents=`5` &limit=`5` &tpl=`blogPost`]]
[[!getPage?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`4`
&depth=`2`
&limit=`5`
&pageNavOuterTpl=`[[+first]][[+prev]][[+pages]][[+next]][[+last]]`
&pageVarKey=`page`
&pageFirstTpl=`<li class="controlFirst"><a[[+classes]][[+title]] href="[[+href]]">Eerste pagina</a></li>`
&pageLastTpl=`<li class="controlLast"><a[[+classes]][[+title]] href="[[+href]]">Laatste pagina</a></li>`
&pagePrevTpl=`<li class="controlPrev"><a[[+classes]][[+title]] href="[[+href]]"><<</a></li>`
&pageNextTpl=`<li class="controlNext"><a[[+classes]][[+title]] href="[[+href]]">>></a></li>`
&includeTVs=`1`
&includeContent=`1`
&tpl=`blogListPost`
]]
as you can see the parent is set here to id number 5. This is fine for the homepage but any child page connected in the blog page also uses the same template and so would also have the same menu as the parent. You could use a fix to simply create 1 template for a page and keep using a different getResource call but keep in mind that it is a blog im making, new pages keep getting added. The user can't (, and wouldn't even understand to) make a template and edit any code. A solution i thought of would be to make the parent id dynamic, so it adjust to whatever page it is currently on. So for example if it was on the page with id number 12 it would make the parent call set to 12 and so show all the content under id number 12. If anyone has any ideas / thoughts / solutions i would be very grateful to hear them.
(a link about wayfinder that i used.)
The best solution would be to use two templates - one for main and one for the blog pages and use in blog templates:
&parents=`[[*id]]`
The problem with the user solveds by setting default_template in the system settings.
This worked for me:
[[!getPage?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`[[*id]]`
&depth=`0`
&limit=`10`
&pageNavOuterTpl=`[[+first]][[+prev]][[+pages]][[+next]][[+last]]`
&pageVarKey=`page`
&pageFirstTpl=`<li class="controlFirst"><a[[+classes]][[+title]] href="[[+href]]">Eerste pagina</a></li>`
&pageLastTpl=`<li class="controlLast"><a[[+classes]][[+title]] href="[[+href]]">Laatste pagina</a></li>`
&pagePrevTpl=`<li class="controlPrev"><a[[+classes]][[+title]] href="[[+href]]"><<</a></li>`
&pageNextTpl=`<li class="controlNext"><a[[+classes]][[+title]] href="[[+href]]">>></a></li>`
&includeTVs=`1`
&includeContent=`1`
&tpl=`blogListPost`
]]
Thanks to Vasis for the provided help.