-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variant can't contain a Records Company information #7933
Comments
It's not a bug. Assigning to variants happens by value, similar to passing the record to a function. State like filters and company is lost this way. So the record in the variant should have the current company. I would suggest passing the company as a parameter or variable wherever you need it. Otherwise you can also pass a record ref. |
Not really true, filters will get transferred also, but it makes sense that it will be a copy by value. Can this however be added if it is not by design? As recordref.currentcompany do exists, and I dont like to create recordref every time I want to send an record to a generic function to do some handling. Similar like Microsoft have done with tempblob.FromRecord function. |
Investigated this little more, if passing the record first to an recordref and then to an variant everything works fine also.
the two messages will be the same here. |
Got issues with recordref with other companies in BC together with variants. How can I get this fixed ?
Working with a lot of RecordRef's and variants. Found out today that RecordRef do have CurrentCompany, but it doesn't work if the assignment to RecordRef comes from an variant and not the record itself.
Example code;
First message is correct company (OTHER COMP). second message will be current company and not OTHER COMP.
The text was updated successfully, but these errors were encountered: