Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
ClausS
2
Views
7
Comments
XMLRecords - parameter must be valid IRecord
Discussion
How-to
I've tried to use RecordToXml with a record as input - converted to an object with ToObject().
However it gives the above error message. What does it mean? I wasn't able to find any info anywhere.
Pedro Cardoso
Hello Claus.
We're missing the error message. Can you add it?
ClausS
It's in the heading: "Parameter must be valid IRecord"
However, I got it to work with RecordListToXml instead, but I still don't know the reason for the above error.
Pedro Cardoso
Sometimes you need to pass the "record.record" instead of just "record" to the extension. Can you try that?
ClausS
Yeah, will do - however, I actually need much more help with my other question related to XML Records?
Can you check that out and that will be much helpful, thanks!
Pedro Cardoso
It would be simplier if you could provide a sample espace that I could check. Are you able to do that?
ClausS
I've attached a sample espace. If you go to the "Edit Company" page there are two buttons that run respectively RecordToXml() and RecordListToXml(). In fact they now produce the same output and both work without giving the above error message.
However, the employees that are linked to companies are not exported as part of the XML. This is what I would like to achieve. How can I inform XML Records that the employee records that are associated with a specific company should be exported as xml attributes within the overall xml record for company?
Can it be done by turning the entities into structures instead? There you can actually specify a "record list" as an attribute. This is not possible for entities, sadly. But having to convert all entities into structures seems like a lot of work to achieve something this simple.
Company_Employees.oml
Kilian Hekhuis
MVP
I encounter the same problem. When I have a record that is composed of multiple entity records, I cannot pass one of the sub-records as input: I get the "parameter must be valid IRecord" error. I put some debug logging in the extension, and found that while the full record has a type that's something along the lines of ssMyEspace.RCDB_RECORD1DB_RECORD2DB_RECORD3Record, if I specify just DB_RECORD1, it's type ssMyEspace.ENDB_RECORD1EntityRecord. So it seems an entity record by itself is not an IRecord. Anyone knowledgeable with the platform's internals who can explain this?
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...