Transaction.specificcontent

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

1 Like

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 :slight_smile:

Transaction item can’t be checked with string.IsNullOrEmpty
Hope this expression would help you resolve this
Transactionvariable is Nothing

Cheers @Sweety_Girl

2 Likes

@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.

  • Delete all Queue items
  • Create new Queue items
  • Check the Implementation
    In Case IT fails e.g. null value then crosscheck against orchestrator If the specialContent Info ist already in the Transaction Item or Not. Here you can start your further analysis steps

did you mean in_TransactionItem

1 Like

Yah
Cheers @Sweety_Girl

it will be possible to perform string.isnullorempty @Palaniyappan and @Sweety_Girl

  1. string.isnullorempty will truen TRUE when there is no value
  2. it will give False when there is a value.

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”)

2 Likes

TransactionItem.SpecificContent(“xxx”) is Nothing

is the solution.

1 Like

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”.
image

When i am trying to retrieve the value by TransactionItem.SpecificContent(“FailureReason”).ToString getting this error.

image

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

1 Like

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