-
Notifications
You must be signed in to change notification settings - Fork 73
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
filtered copying #142
base: feature/copyFilteredRecords
Are you sure you want to change the base?
filtered copying #142
Conversation
aimaj
commented
Aug 22, 2023
•
edited
Loading
edited
- adding function to return the visible rows on the export table
- invoking said function from both the CSV serialize (for csv and excel formats) and JSON copying
- adding OpportunityLineItemSplit to unit test, as this object is in the schema as of v58 https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunitylineitemsplit.htm?q=OpportunityLineItemSplit
Hi @aimaj, Thank you very much for this PR and for helping me on this ! 🙏 |
e32305f
to
43911e8
Compare
Hi @aimaj thanks for the updates ! Could you take a look ? getDataFromJson(json) {
json = JSON.parse(json);
let csv;
let fields = Object.values(json[0]);
fields = fields.filter(field => field != "attributes");
let sobject = json[1][0]["attributes"]["type"];
if (sobject) {
csv = json.map((row) => {
return fields.map((fieldName) => {
let value = fieldName == "_" ? sobject : row[0][fieldName];
if (typeof value == "boolean" || (value && typeof value !== "object")) {
return fieldName == "_" ? '"[' + sobject + ']"' : JSON.stringify(value);
}
}).join(",");
});
fields = fields.map(str => '"' + str + '"');
csv.unshift(fields.join(","));
csv = csv.join("\r\n");
}
return csv;
} |
43911e8
to
3e87b92
Compare
@tprouvot it looks like these changes compared to master will unintentionally modify the json export format? and add the header row as an output element i dont think its intentional or necessary to change the export format, in order to implement the filtered copying so recommend we change this feature to leave the export format as it was before, and then will not require any patching on the import code thanks for finding this, if you agree i will make the necessary changes in this branch and try and add a unit test for this case from:
to:
|