Need help with the error message "SystemParameterTypeInvalid

Post Reply
arunsatyam
Posts: 4
Joined: Wed Apr 22, 2009 11:22 am
Version: 9.0.3 SP3
Excel Version: 11.8231.8221

Need help with the error message "SystemParameterTypeInvalid

Post by arunsatyam »

Hello All,

When I execute the code TM1ValType( tuUser, tvX) == TM1ValTypeError(), I get an error code 91 and message SystemParameterTypeInvalid. Any help why this error is occuring. And in what circumstances will the message SystemParameterTypeInvalid will be received. Please help. Its urgent. Alternatively, you can also mail me in the undersigned mail.

Thanks in advance,

Warm Regards,
Arun R
(mikearun99@gmail.com)
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: Need help with the error message "SystemParameterTypeInvalid

Post by Mike Cowie »

Arun,

It's hard to help without seeing more of your code. SystemParameterTypeInvalid simply means that you've passed an argument to a TM1 API function that wasn't the type the TM1 API was expecting. For example, if you had this line of code:

NameHandle = TM1ObjectPropertyGet( ValPoolHandle, tvX, TM1ObjectName() )

And tvX was not a handle to a TM1 object (like a cube, dimension, etc) then you'd get this error when you checked NameHandle. This could happen if your tvX variable was a handle to the *name* of the object and not a handle to the actual object, for example.

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!
arunsatyam
Posts: 4
Joined: Wed Apr 22, 2009 11:22 am
Version: 9.0.3 SP3
Excel Version: 11.8231.8221

Re: Need help with the error message "SystemParameterTypeInvalid

Post by arunsatyam »

Hello Micheal,

The code actually looks like this.

INT clapi::GetAttribvalue(CHAR *pszDim, CHAR *pszElem, CHAR *pszAttrib,
DOUBLE& dVal)
{
TRACE0( "clapi::GetAttribvalue() entered\n" );

TM1V tvServer = HServerFromApp();
TM1U tuUser = HUserFromApp();
TM1V tvGen, tvAttrib;
TM1P tpLoc;
INT iRet = 0;

TM1_POOL_CREATE(tpLoc, tuUser);

tvGen = TM1ObjectListHandleByNameGet(tpLoc,
tvServer,
TM1ServerDimensions(),
TM1ValString(tpLoc, pszDim, 0));


tvGen = TM1ObjectListHandleByNameGet(tpLoc,
tvGen,
TM1DimensionElements(),
TM1ValString(tpLoc, pszElem, 0));


tvAttrib = TM1ObjectListHandleByNameGet(tpLoc,
tvGen,
TM1ObjectAttributes(),
TM1ValString(tpLoc, pszAttrib, 0));


tvGen = TM1ObjectAttributeValueGet(tpLoc, tvGen, tvAttrib);

if(CheckTM1V(tuUser, tvGen))
{
INT i;
CHAR test[100];
i=CheckTM1V(tuUser, tvGen);
itoa(i,test,10);
MessageBox(NULL,test,"Checking",0);
iRet = ERR_CA_CANNOTSET_ATTRIB_VAL;;
}

INT clapi::CheckTM1V(TM1U tuUser, TM1V tvX)
{

if(tvX == NULL)
{
TRACE("WARNING: CheckTM1V Error: Handle is NULL\n");
return 1;
}

if( TM1ValType( tuUser, tvX) == TM1ValTypeError() )
{
TRACE("WARNING: CheckTM1V Error: %s\n", TM1ValErrorString(tuUser, tvX));
INT nErrCode = TM1ValErrorCode(tuUser, tvX);
itoa(nErrCode,cTest,10);
MessageBox(NULL,cTest,"TM1ValErrorCode",0);
CHAR *szErrMsg=TM1ValErrorString(tuUser, tvX);
MessageBox(NULL,szErrMsg,"TM1ValType( tuUser, tvX) == TM1ValTypeError()",0);
return 1;
}
else
{
TRACE0("CheckTM1V: Handle OK\n");
return 0;
}
}

But since it is complex I am not able to paste the entire thing here.

In case if you need any information, please let me know. I will try to paste that piece of code here.

Thanks in advance,

Regards,
Arun R
User avatar
Steve Rowe
Site Admin
Posts: 2455
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Need help with the error message "SystemParameterTypeInvalid

Post by Steve Rowe »

Just to double check as it looks wrong, I'm no API expert....

Is the line you highlight in red supposed to have the "=" twice or is that happening when you post the code?
Edit : See Mike's comment below... this is correct
Technical Director
www.infocat.co.uk
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: Need help with the error message "SystemParameterTypeInvalid

Post by Mike Cowie »

TM1V tvServer = HServerFromApp();

tvGen = TM1ObjectListHandleByNameGet(tpLoc,
tvServer,
TM1ServerDimensions(),
TM1ValString(tpLoc, pszDim, 0));


tvGen = TM1ObjectListHandleByNameGet(tpLoc,
tvGen,
TM1DimensionElements(),
TM1ValString(tpLoc, pszElem, 0));


tvAttrib = TM1ObjectListHandleByNameGet(tpLoc,
tvGen,
TM1ObjectAttributes(),
TM1ValString(tpLoc, pszAttrib, 0));
Hi Arun,

I've highlighted several variables here because I think you should start from the top and make sure that each of these is what you expect. Your error checking isn't happening until you've gone down to getting an attribute value, which means it is very possible one of the functions listed here is actually returning an error/invalid value and you're just passing it along through the rest of your functions. For each of these, then, you need to check the type, using TM1ValType to see if each of them is TM1ValTypeObject. Then, assuming each is an object, you could also make sure that each is the type of object you expect using TM1ValObjectType (in order, your variables listed here should be TM1TypeServer, TM1TypeDimension, TM1TypeElement, TM1TypeAttribute).

If one of these values/objects isn't coming back as expected, you should be able to get a more useful error message using the same error checking code at that point. By checking the error at the end of these calls you don't get the full story - all the TM1 API can tell you is that something you've used in the function is not the expected type. The original error message doesn't bubble down.

Steve: the "==" operator is used to test equality in languages like C++, C#, etc. Looks a little different if you're used to VB/VBA, but that's why you see that instead of a single "=", which is used for assignment.

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!
arunsatyam
Posts: 4
Joined: Wed Apr 22, 2009 11:22 am
Version: 9.0.3 SP3
Excel Version: 11.8231.8221

Re: Need help with the error message "SystemParameterTypeInvalid

Post by arunsatyam »

Hello Steve,

The front end is designed using VC++ and the DB is TM1. I missed out on this in the beginning. The highlighted code(VC++) is for comparing Left hand side and Right Hand side statements. It is not an assignment operator.

Hello Mike,

Thank you very much for the explanation. I will check as explained by you and get back to you with the results.

Regards,
Arun R
arunsatyam
Posts: 4
Joined: Wed Apr 22, 2009 11:22 am
Version: 9.0.3 SP3
Excel Version: 11.8231.8221

Re: Need help with the error message "SystemParameterTypeInvalid

Post by arunsatyam »

Hello,

I have checked the solution that you have suggested. I am getting and error ObjectPropertyNotList from the function

tvGen = TM1ObjectListHandleByNameGet(tpLoc,
tvGen,
TM1DimensionElements(),
TM1ValString(tpLoc, pszElem, 0));

The error is given by TM1DimensionElements(). Can you please tell me what is the purpose of TM1DimensionElements() function? Under what circumstance will it throw an error TM1ObjectListHandleByNameGet give the Error TM1ErrorObjectPropertyNotList? It would be really helpful if you can answer me this question? Thanks for all the help.

Regards,
Arun R
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: Need help with the error message "SystemParameterTypeInvalid

Post by Mike Cowie »

arunsatyam wrote:Hello,

I have checked the solution that you have suggested. I am getting and error ObjectPropertyNotList from the function

tvGen = TM1ObjectListHandleByNameGet(tpLoc,
tvGen,
TM1DimensionElements(),
TM1ValString(tpLoc, pszElem, 0));

The error is given by TM1DimensionElements(). Can you please tell me what is the purpose of TM1DimensionElements() function? Under what circumstance will it throw an error TM1ObjectListHandleByNameGet give the Error TM1ErrorObjectPropertyNotList? It would be really helpful if you can answer me this question? Thanks for all the help.

Regards,
Arun R
Hi Arun,

TM1DimensionElements() is a property function that gets used when calling functions like TM1ObjectListHandleByNameGet. I don't think you're using it incorrectly in the function. It is a list property.

However, I see you re-use this tvGen variable in your lines of code. Is it possible you've returned something else into this variable before you call the line of code you highlighted (in some lines of code you aren't pasting in here)? It would probably be safer to return your handle to the Dimension to its own variable like you have for the server and attribute value and only use it for that purpose. If, for example, you stored the handle to the name of the dimension to tvGen on a prior line of code then this function call would fail because it expects a handle to the Dimension object, not the name.

Alternatively, if you test the tvGen variable immediately before you call this line of code to see what type it is (should be Object) and what object type it is (should be Dimension) that would probably be a good idea. If tvGen is definitely a handle to the dimension object then I'm stumped - that should work here and the only other error you'd get would be if the element name you specified didn't exist.

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!
Post Reply