TM1ObjectAttributeInsert

Post Reply
Kyro
Community Contributor
Posts: 126
Joined: Tue Nov 03, 2009 7:46 pm
OLAP Product: MODLR - The CPM Cloud
Version: Always the latest.
Excel Version: 365
Location: Sydney, Australia
Contact:

TM1ObjectAttributeInsert

Post by Kyro »

Evening,

Has anyone happend to get the API Function "TM1ObjectAttributeInsert" Working?
This is what I got, but it doesnt seem to work:

Code: Select all

TM1V attrBefore = TM1ObjectNull();
//The above is based on how the Element Insert Function Works.

TM1V objName = TM1ValString(poolValues,(CHAR *)attribute.c_str(),0);
TM1V result = TM1ObjectAttributeInsert(pool,newDim,attrBefore,objName,TM1TypeAttributeString());
My Element Insert's are working fine, not sure why this doesnt. Any help is greatly appreciated.

Kind Regards,
Ben
User avatar
Mike Cowie
Site Admin
Posts: 483
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: TM1ObjectAttributeInsert

Post by Mike Cowie »

Ben,

What kind of error/result are you getting? Is it possible it won't let you add an attribute on your "newDim" until it is fully saved/updated? I'm just taking a wild guess that "newDim" means that you're in the act of inserting elements and updating the dimension and that, perhaps, TM1 doesn't want to add attributes to any unregistered objects. Also, is it possible you need to insert the attribute on an Element instead of Dimension object (assuming you want to add an attribute for of the elements in the dimension rather than an attribute for dimensions on the server)?

I might take a look tomorrow to see what I've done before with this function - it's been a while since I've used it (if I actually have - can't remember offhand)...

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
Kyro
Community Contributor
Posts: 126
Joined: Tue Nov 03, 2009 7:46 pm
OLAP Product: MODLR - The CPM Cloud
Version: Always the latest.
Excel Version: 365
Location: Sydney, Australia
Contact:

Re: TM1ObjectAttributeInsert

Post by Kyro »

Found the issue, but firstly I must say that It was giving a boolean true /"Operation Suceeded" Value.

This is a bit of a funny one, turns out you need to add the Attribute to an element, in my case I add the attribute to the first element in the Dimension if one exists. Stikes me as odd, but I think I understand why, it seams you can create Attributes for any object type in the system not just elements, it probably just adds it to the }objects (e.g. }cubes) dimension as an alias or something...

Thanks for your time.

I'm releasing what Im working on (Yet another TM1 Documentor) for free at http://www.daptech.com.au as an Downloadable Application Template for Daptech's product (The Application Daemon) soon to be launched. The Application Daemon is a rapid BI web application development tool.

edit: If only I had seen your post 15 mins ago - would have sorted me out...
Post Reply