When an Estimate is created from a Case record, I ...
# suitescript
m
When an Estimate is created from a Case record, I want to set some fields back on that Case record - I am not able to do this in a WF so will try UE script, AfterSubmit. It is possible to get the Case ID when the Estimate is created?
When I create an Estimate saved search I can see the related table ...Case and obtain the Case ID, but not sure how to do this in code.
p
createdfrom
m
I thought of that when looking at the saved search but didn't see it. So the createdfrom will give me an id where I set the id below?
Copy code
const SUPPORT_CASE = record.load({
    type: record.Type.SUPPORT_CASE,
    id: internal_id,//Where will this come from
    isDynamic: false,
    defaultValues: null
});
createdfrom resulted in
Copy code
message: "load: Missing a required argument: id",
b
your approach to this should be that you need to see the fields on the estimate
and see if you can find one with your support cases's internal id on it
there are many approaches to do that
my personal favorites are to load your record in the SuiteScript Debugger and inspect the record, load the record in the browser console and use the .toJSON method on the record and then inspect it using the console debugger
field inspection is common enough that there is an extension for it.
if that fails, you need to create a saved search or analytics dataset to find your internal id, and then recreate that in a search
m
That's actually the first thing i did, to inspect the record to find references to support case using the above extension. I saw none. Then created a saved search and was able to see a join to the support case. So maybe i need to work off the saved search.