Closed stb-kslater3 closed 3 years ago
Right now I am working on blacklisting the Admin POs which you have clicked Remove, and when you save I will go and Delete those records.
Making deleteRecords method in Apex_Generic_Prototype.
I made the delete records, and solved the issue that was coming up when saving AdminPOs would throw an error. When I go to save AdminPOs I check if it needs to be Inserted or Updated, and I do this by checking for the Id of the AdminPO from the data-apiid element. Well, turns out that the Chassis was getting pulled from a PO and not an AdminPO and it's data-apiid was evaluating to true. Turns out that it was neither undefined, nor was it '', instead it was the string 'undefined' itself. So it didn't evaluate to falsy because it was neither undefined nor ''. Took a while to find, and I am not sure if it is a bug in JavaScript or Salesforce's LWC overhead, that causes this to neither be undefined nor '', but instead 'undefined' which when you print says undefined so you think it should be falsy but then it isn't.
Anyways, now I have fixed that and now just need to figure out what is causing things to insert sometimes, when they should be updating which makes for creating a bunch of copies.
Now that I modified the Insert and Update methods for AdminPOs in the AdminChecklist LWC this is no longer a problem
As things stand right now there are a couple of Issues when it comes to saving Admin POs.