Skip to main content
Solved

Variable value is changing when other variables assigned value changes

  • Apr 23, 2022 6:16 AM UTC
  • 1 reply
  • 80 views
  • Translate All

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

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.

View original

1 reply

aaghaei
Captain II
Forum|alt.badge.img+11
  • Author
  • Captain II
  • Answer
  • Apr 25, 2022 11:11 PM UTC

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

Translate