I am trying to add a UserProperty to an email using win32com.
The UserPropertyType should be set to 'olText'.
For the record, the name of the UserProperty ('NewDomain') is already a member of the collection of Outlook UserProperties.
I have tried the following:
import win32com.client as w32c
outlook=w32c.Dispatch('Outlook.Application').GetNameSpace('MAPI')
inbox=outlook.GetDefaultFolder(6)
emails=inbox.Items
email=emails.GetLast()
email.UserProperties.Add("NewDomain",UserPropertyType='olText',True)
I got the following error:
TypeError: Add() got an unexpected keyword argument 'OlUserPropertyType'
The code works well in VBA with the syntax:
email.UserProperties.Add("NewDomain", olText, True)
Many thanks for you help!
UserPropertyType argument is an enum (int), not a string. olText is 1, so your code must be
email.UserProperties.Add("NewDomain", 1, True)
Related
Is the documentation for string functions out of date because when I try to use toLower() it i get
"An unknown function with name 'toLower' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed"
I am trying to construct an OData filter to query Dynamics (CRM) - this is the code:
"queries": {"$filter": "concat('hat_',toLower('#{body('Get_record_(Preview)')?['hat_fundname']}')) eq true "}
I think the correct syntax is:
#concat('hat_', toLower(body('Get_record_(Preview)')?['hat_fundname']))
I have associated the following function to a tests in order to select a row in a java table when a the row text matches an expected value :
Public Function GetRowWithCellText(ByRef oJTable, sColName, sText)
bChkText=FALSE
iRowCount=oJTable.GetROProperty("rows")
For iCounter=0 to iRowCount-1
sGetCellText=oJTable.GetCellData(iCounter, sColName)
If instr(sText, sGetCellText)>0 Then
bChkText=TRUE
GetRowWithCellText=iCounter
End If
Next
ReportingFunction bChkText, "Row with desired text"
End Function
RegisterUserFunc "JavaTable", "GetRowWithCellText", "GetRowWithCellText", TRUE
The function is well registered and I got it in the list of available functions for a java table.
However when trying to apply the function into a JavaTable in my application :
JTable.GetRowWithCellText msg.users.list.table.header.user , LOGIN
I get the following error :
Object required: 'msg'
Line (122): "JTable.GetRowWithCellText msg.users.list.table.header.user , LOGIN".
Please note that UFT is not recoginising cols of my table so I had inserted its value manually
It appears from the 'Object required' error that the value for 'msg' is not defined. The first part of msg.users.list.table.header.user refers to an object named 'msg'. If that object does not exist or has not be initialized, you may get that error.
You can break your statement up to confirm where the error is located. Change this statement
JTable.GetRowWithCellText msg.users.list.table.header.user , LOGIN
To these statements
Dim user
Set user = msg.users.list.table.header.user
JTable.GetRowWithCellText user, LOGIN
When you re-execute, you should get an error on the second line if there was an issue with msg; otherwise you will get an error on the third line if it is truly an issue with your function.
I have used column index instead of column name and it worked , I guess there is an issue with special characters.
Thanks
I really like how the error messages include a text string representing what the ReQL code looks like. Is it possible to get at this without forcing an error?
Example Error message:
RqlRuntimeError: No attribute `colors` in object:
{...}
in:
r.db("r_g").table("items").group("collection").ungroup().map(function(var_0) { return var_0("group").object(var_0("reduction")); }).concatMap(function(var_1) { return var_1("colors"); })
I'm wanting to get at the value after "in:" shown before I run() the query.
You can use .toString() like query.toString() (without .run(...))
It should use the same code as the one used to generate backtraces.
I opened an issue this morning to add it in the docs, it is somehow missing -- https://github.com/rethinkdb/docs/issues/354
I'm trying to do the following update using XPages Extension Library.
#{javascript:var mydata = {
product: getComponent("inputProduct").getValue()
};
var params = [1, 2];,
#JdbcUpdate("mssql","table_name",mydata,"order_no=? AND order_line_no=?",params)};
I get the error:
Error while executing JavaScript action expression
Script interpreter error, line=6, col=1: Error while executing function '#JdbcUpdate'
Invalid column name 'PRODUCT'.
The problem is that XPages when it converts the JSON it puts product to PRODUCT.
Can you set the extension library to respect the case of the JSON and not convert to Uppercase? Or can anyone point to where this setting could be set if not the extension library?
Thanks
The problem is com.ibm.xsp.extlib.util.JdbcUtil.appendColumnName()
public static void appendColumnName(StringBuilder b, String colName) {
colName = colName.toUpperCase();
b.append(colName);
}
This just needs changing to not upper case the variable.
There may be other methods that need changing if other variables are getting upper cased.
I'm getting this error when I issue this:
DataContext.DBProjectEntities.Projects.Where(xWhere, parameterList.ToArray)
The command parameter syntax '#0' is not valid. Near line 6, column 37.
xWhere is a string containing value "(ProjectStatuses.Any(DepartmentID = #0))"
parameterList is Dim parameterList As New List(Of ObjectParameter)
It contains one element with value 1 of type Int32 which corresponds to the type of DepartmentID.
I got it. I was using the dunamic.vb from an external assembly. In my code I had imports statement for that assembly, but I also needed the imports for system.linq.dynamic