Transaction.specificcontent is empty…
I am getting object reference error…
If I check with if like
Transaction.specificcontent(“XXx”).tostring.ISNULLOREmpty also Iam getting the same error at the if itself
Please help
Transaction.specificcontent is empty…
I am getting object reference error…
If I check with if like
Transaction.specificcontent(“XXx”).tostring.ISNULLOREmpty also Iam getting the same error at the if itself
Please help
string.isnullorempty(transaction.specificcontent(“aaa”)) try iike this
Tried same error
Hi @Sweety_Girl
May be try this
String.IsNullOrEmpty( transItem.SpecificContent(“”).ToString) or String.IsNullOrWhiteSpace(transItem.SpecificContent(“”).ToString)
Hope it helps
Transaction item can’t be checked with string.IsNullOrEmpty
Hope this expression would help you resolve this
Transactionvariable is Nothing
Cheers @Sweety_Girl
@Sweety_Girl
Can you give some more Details on your flow?
When was the specificcontent Data set, when do you do the retrival?
Sure in the Post there we’re some die fferent Checks, sppecialdata Item, specialdata itself, the Transaction Item object, … But what is your requirement?
The simplest way to Check in such a Situation Could be.
did you mean in_TransactionItem
Yah
Cheers @Sweety_Girl
it will be possible to perform string.isnullorempty @Palaniyappan and @Sweety_Girl
While you check with If… That if itself will throw the error
can you please share the xaml if possible .
Yah it is possible with string variable
But * TransactionItem - The retrieved Transaction Item, is stored in a QueueItem
variable, not on string variable
So to check whether it had any value or not
TransactionItem Is Nothing will work for sure
For example even in REFramework does the same
Cheers @Sweety_Girl @ppr
yes revived transaction item is stored in queue item but when we are checking for particular value in that (means from revived queue item means we are checking single value like queueitem.specificontent(“aa”) means if that value is exist it will give that value if not exist it will give empty otherwise key not found )
for to check entire the trasaction item TransactionItem Is Nothing will work for sure this will be find but if we want to check specific content value then string.isnullorempty will work whether that is any type.
on later the check were mentioned with Transaction.specificcontent(“XXx”)
@Palaniyappan so was for me the hint that the interest goes to the specificontent or specificcontent(“key”) as also these both can be null. Same as also KalyansDev is mentioning.
However @Sweety_Girl will let us know more details or when the issue is resolved
To check for the existence of the Key, you can use: TransactionItem.SpecificContent.Keys.ContainsKey(“KeyName”)
TransactionItem.SpecificContent(“xxx”) is Nothing
is the solution.
I am getting the same issue in my code as well. To clearly mention about the issue, one of the value in my transaction item is “null”.
When i am trying to retrieve the value by TransactionItem.SpecificContent(“FailureReason”).ToString getting this error.
Able to retrieve all other values from the QueueTransaction. Any idea?
accessing a value that is not set / null / in VB Terms nothing will throw this exception
in such scenario we defensive check in advance before accessing with
isNothing(TransactionItem.SpecificContent(“FailureReason”))
true - handle null value case
false - can be accessed eg. with TransactionItem.SpecificContent(“FailureReason”).toString
Thanks, It worked. I was checking the same but with ToString added to it… Got the issue.
I have tried below options but in If condition itself im getting error
string.IsNullOrEmpty(in_TransactionItem.SpecificContent(“Pending Doc Names”).ToString) = false
(in_TransactionItem.SpecificContent(“Pending Doc Names”).ToString) Is Nothing
Error Message
System exception.Object reference not set to an instance of an object. at Source: If Pending Join kit
Thanks