Page 1 of 1
TM1ObjectAttributeInsert
Posted: Tue Apr 13, 2010 2:29 pm
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
Re: TM1ObjectAttributeInsert
Posted: Tue Apr 13, 2010 2:45 pm
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
Re: TM1ObjectAttributeInsert
Posted: Tue Apr 13, 2010 3:16 pm
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...