Notifications
Announcements
No record found.
I want to convert an updated buffer into a container and for this I used buf2con() function, according to MSDN it will return a container with the table buffers of a record. But in my case container size always remains same (i.e. 3 but Buffer contains more than 3 fields) and I never see the buffer values in my container.
*This post is locked for comments
Not too sure what your problem is, the container has other containers within. It has to know what kind of table was it, the mapping of the fields, and then the values contained in the fields. It is multiple levels deep.
You would normally not access the container values directly, since it is far away from human readable format. You would have to convert it back with con2buf before you could actually use it. The purpose of this function is to be able to pack an object with their record states too, which you could easily do as a container (as long as you do not change the table structure).
Thanks Vilmos,
Basically i want to convert a buffer to a string so there is way to do that?, as for these I First convert buffer to a container then container to a string but the final string is not what I want.
So can you tell me easier way to do that?
Explain the business scenario to understand better what you want, since a buffer hardly can be represented as a string.
There are a lot of special data types for the fields in AX, which you would have a hard time to convert it into a string. Or if you do, you have to apply special formatting i.e. for dates, or whether a GUID field would be stored with or without the parenthesis, for an enum would it be it's enumeration value or the element name, or how would you show a packed container value as a string - you simply do not.
You would be facing a lot of challenges, you would have to implement the "conversion" yourself.
That's the correct behavior; the only problem is in your incorrect expectation about how the container will look like. If you want to a container with one value for each field, implement it by yourself. Like this:
SysDictTable dictTable = new SysDictTable(buffer.TableId); container c; FieldId fieldId = dictTable.fieldNext(0); while (fieldId) { c += buffer.(fieldId); fieldId = dictTable.fieldNext(fieldId ); }
I want to take a hash of the current buffer and store it to the database, for hashing I am using DimensionAttributeSetStorage::getHash() class method (argument of string type is required).
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2