Use enum values and unbounded table fields in insert_recordset

Use enum values and unbounded table fields in insert_recordset

MCP · Azure DevOpsYour delivery board, readable by an agentMCP · DataverseOne consent, and the data layer opensMCP · Dynamics 365 F&OConnecting F&O to an agent Microsoft hasn’t documented
Archive recovery note: the supplied Blogspot backup did not contain a separate saved page for this older entry. The text available in its archive/listing capture has been preserved and flagged for a later completeness check.
insert_recordset is one the greatest enhancement in AX 2012 which allows us to insert records from one to another table in single client-server trip. This is an X++ SQL statement and is similar to update_recordset which i explained in my this post . Sometime we may require to insert values into destination table's column which do not exists in source table's column.  To elaborate it more let's have an example and then I will explain you how it works; static void testJob(Args _args) { ProjTable projTable, projTableInsert; ProjStatus enumValue = ProjStatus::Created; str 30      strValue = "test" ; update_recordSet projTable Setting Name = "test" where projTable.projId == "Foobar" ; insert_recordset projTableInsert (Name, ProjId) select strValue, ProjId from projTable where projTable.projId == "Foobar" ; // You can set to an enum value, providing that update_...
Previous article← All about Update_recordset
Discussion

Ask a question or leave feedback

This is a review interaction. The WordPress version will store, thread and moderate comments.

Thanks — submitted for moderation in this review.
Search the whole site · Ctrl/⌘ + K