How to solve this problem: RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object. at lambda_method(Closure , ActivityContext )

helllo guys, how to solve nullReferenceException while we set transaction status .just like below !
RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
i

1 Like

Hi @Jaben ,
I guess this error is because the value you are passing is null or empty because error states that ‘Object reference not set to an instance of an object’. If possible, debug the code and check values of variables in local.

1 Like

Hey @Jaben,

This error usually occurs when an activity that is trying to access an object (string, datatable, etc,) finds the variable to have no value, i.e. null or empty.

Best way I’d suggest to debug this is by going through the following:

  1. Check your arguments. Your input arguments should be IN and output arguments should be OUT.
  2. Check assign activities. You might have jumbled up some variables due to similar names or simply as a mistake.
  3. Check data scrapes. A data scrape activity might not have found any data in a page due to improper selectors. Have personally faced this problem a lot.

Use the Debug mode with proper breakpoints and Slow Step to make sure that the values passing among variables and arguments are doing so as necessary. Keep an eye on the variable values pane on the left.

Hope you resolve this issue quickly. Good luck.

1 Like

thank you

tnank you

@Jaben Were you able to resolve this issue?? Can you please share your invoke Argument list for Set Transaction workflow?

Hi,
where we can find thid ‘Object reference not set to an instance of an object…??