on 09-21-2016 8:58 AM
Hi Experts
I have added an Extension Field to an RFX which I go count the number of RFx Responses and display it on screen. My problem is how do I save that same value on the database so I can read it from a Query. The script Target is on "Loaded".
supcolln = doc.getProposals();
number = supcolln.size();
doc.getExtensionField("EXT_Supplier_Count").set(number);
How do I get to save the set value to the database.
Thanks in advance
Hi,
You should just move your exact code from 'Loaded' to 'Validate' script.
PS: if the only purpose of this is the query result, you can do the calculation directly in the query without the need of an extension field.
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
? ... COUNT
( SELECT COUNT(*)
FROM {rfx response table} frr
WHERE frr.PARENT_OBJECT_ID = {parent alias}.OBJECTID )
this is the most simple form ... you should query as per your specific requirements.
Bogdan
HI
supcolln = doc.getProposals();
number = supcolln.size();
doc.getExtensionField("EXT_Supplier_Count").set(number);
doc.upgradeToEdit(doc);
doc.save(doc);
doc.downgradeToView(doc);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mashimbye
Once you create an extension field for any Document , the data base referance for that field gets cretaed automatically.
You can check the data base field name by opening any query and under Report(right most )there will be "Browse Extension schema" and once you open that you will get all the extension corresponding field in you respective doctype.
And you can get those filed value by belwo query.
SELECT
<%RESULTS%>
FROM
<%SCHEMA%>.FCI_RFX_DOC T1
LEFT OUTER JOIN
<%EXT_TABLE(rfx.RFXDoc)%> EXT1
ON (T1.OBJECTID = EXT1.PARENT_OBJECT_ID)
Under result file
Coloumn Id:EXT1.EXT_Supplier_Coun.(EXT_Supplier_Coun is the corresponding data base field)
Hope this will hep you.
Thanks
Sonu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.