Skip to main content
Answer

Variable value is changing when other variables assigned value changes

  • April 23, 2022
  • 1 reply
  • 45 views

aaghaei
Captain II
Forum|alt.badge.img+10

I have two variables (_approvalBase & _approvalLast) both of the same type but they should be keeping different values. But when I assign value to one, another one changes too. Why?

dialogData = RoutingPanelDialogData.Current;
EPApproval _approvalBase = SetApproval(Base, approvalBase, dialogData, EPStatuses.Approved, PXDBOperation.Update);
EPApproval _approvalLast = SetApproval(Base, approvalLast, dialogData, EPStatuses.Skipped, PXDBOperation.Insert);

 

Best answer by aaghaei

I figured it out. It was because .AskExt() in my scope. Since platform runs AskExt twice, any declared variables before the dialog, gets reassigned.

1 reply

aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • Answer
  • April 25, 2022

I figured it out. It was because .AskExt() in my scope. Since platform runs AskExt twice, any declared variables before the dialog, gets reassigned.