I am trying to code a button of a form customization. I will need to modify records in the database.
This is what I have so far and am getting the error in subject of this topic.
Can I do this from a form customization, or does this only work from a BPM?
If I have to open a BPM form, how can I do this using a button on the Job Entry Form?
I am in a customization (not a BPM) and want to connect to the Db. and get all tables; like:
Db.JobAsmbl
Db.Part
What do I need to call in order to execute a query like this in form customization?
string jobnum = “123”;
var query = (from JobAsmbl in Db.JobAsmbl
join Parts in Db.Part
on new { JobAsmbl.Company, JobAsmbl.PartNum }
equals new { Part.Company, Part.PartNum }
where
JobAsmbl.JobNum == jobnum &&
Part.ProdCode == “CONF”
select new
{
JobAsmbl.Company,
JobAsmbl.JobNum,
JobAsmbl.AssemblySeq,
JobAsmbl.PartNum,
Part.ProdCode
}));
Nacy as I mentioned in your previous post this is only for BPMs you cannot instantiate the Db context at the customization level (nor do you want to). In a Server / Client model DB operations should be restricted to the server side.
Use the Adapters , and Business oBjects to run BAQ’s and get the data you need in the customization.
There are countless examples on this site on how to do that as well as walk through examples available in the Customization Guide in EpicWeb.