Thank you very much ! I appreciate your time. I will apply it to my code and validate.
- Log in to post comments
Thank you very much ! I appreciate your time. I will apply it to my code and validate.
Thank you very much Vasiliy Bondar.
I tweaked the code as per my tables and fields and is working as expected. I appreciate your help.
So i was successful creating the datagrid and some combo box. Making some progress. But....Got another hurdle. Help will be appreciated.
I want the datagrid to reflect values based on the value i select in the Combobox. How to pass value from the combobox to the
altJSONSQLProvider parameter and reload the datagrid ?
My combobox defines below method on change.
onchange="zenPage.rowSelected(zenThis.getValue());"
<altJSONSQLProvider id="PatchClassJsonId" OnGetSQL="GetSQL" >
<parameter paramName="1" value="C"/>
</altJSONSQLProvider>
<dataGrid
,......
</dataGrid>
Method GetSQL(ByRef pParm As %String, ByRef pSQL As %String, pCriteria As %ZEN.proxyObject, ByRef pPagingInfo As %String) As %Status
{
Set pParm= "zenPage.getComponentById('DataComboId').getValue()"
Set pSQL = "SELECT ID,PatchClassName,Environment,ModuleName,ModuleClass,TargetConfig,BusinessRule,MessageSchemaCategory FROM ProjectInventory.TablePatchClass where PatchClassName %STARTSWITH ? "
Quit $$$OK
}
Thank you..
Hello Evgeny.
Yes Sure !
Thank you.
Regards.
Hello all,
I used the ChangeQueryOnServer as a reference and my code is working good. This is from the ZenTest example in SAMPLES namespace.
Regards,
Jimmy
Thank you Eduard. But i want to code this method directly in my XYZ rule definition class instead of coding in a seperate class with functions.
Reason is the Function set class is shared by many projects and i do not want to modify or update it.
Thank you Jeffrey. Yep, writing a new class and extending Functionset class is totally fine.
But i am trying to find out if RuleDefinition class itself allows you to write any methods within it or you cannot embed a method within RuleDefinition class.
Thank you Jeffrey. This looks perfect. I am going to test this and let you know.
That seems very interesting. I wasn't aware of such method to import file or refer to a message in the file. Pretty interesting !
Will test this out today and post . Just something i noticed is we have assigned the datatype to messages in tMsg object, which is after the fact of referring it to a filename.ext. So in this case if the message does not match schema/doctype , below command would fail.
JEFF > set tMsg.DocType="2.3.1:ORU_R01"
Correct?
Thank you Jeffrey. I was able to pass the value to my function and worked very well. Glad to see such a rich set of methods and properties in the Enslib.HL7.Message which can be helpful in future. I appreciate your help and assistance.
Regards,
Jimmy Christian.
Thanks Alexander.
Version i have installed is
Cache for Windows (x86-64) 2017.2.2 (Build 865_0_18763U).
It worked in previous version, so not sure if it could be related to it.
Thank you .
Thank you all. Only reason i have to do it is because i cannot import the csv file data into my table in USER namespace using IMPORT WIZARD. Wizard is not working and throwing CSP error.
I will try and see if i am able to map the class and package. and then run the query i need to extract the data. Thank you
Thank you all. At this time, i will not be able to map the USER db to rest of it. But i will try to call support .
Thank you . This is perfect !
I just tweaked it little bit
SET testingddl="CREATE TABLE xxxxxxx"_$USERNAME_"(TNAMESPACE CHAR(100),TINTERFACE CHAR(100),TPORT INT)"
s ret=##class(%SQL.Statement).%ExecDirect(,.testingddl)
Thanks John. This was helpful. I had to correct the password for that service.
Issue is resolved.
Thanks Neerav.
I still believe we can do in the code by using a callback method. I am not sure how to use it.
Thanks Neerav.
I am referring to the zenpage call back methods, which are called on a zenpage event.
Problem is i cannot create any views in namespace2.
I cannot share globals on the namepsace i am working on.
Actually i was able to retrieve data from Namespace2 working on a callback method for recordset which the table is using. But now issue is zenpage only shows the first page.
Will try to find out a reason why the page is hanging. It could be that i have to flip back to Namespace1 once i get the recordset.
Thanks.
Hello Vitaliy,
Thank you for your time. This works good. Issue is that i only see the first page of the results.
Even after adding the tableNavigatorBar, it still shows only one page and not all the results. I have more than 30,000 rows to display on the page. Let me know.
Thanks,
Jimmy
Vitaliy, This is great !
The code works fine now. Appreciate your help and time.
I have to put some filters on the columns now, which i think i have to use the QueryInfo Object.
Thank you !
Regards,
Jimmy Christian.
Thank you Robert. But looks like i am running into another issue where data is lost and i am unable to create table.
I really would prefer to find out if there is a way to copy directly a RecordSet to a table or any other faster method rather than looping through the entire Recordset.
Yep. Select INTO works great if the source and target tables are in same NAMESPACE. I need to copy the data across namespaces, for which i have already some another method.
But i found that copying recordset would also work, since once the object is created i can easily write to another table on a different "NAMESPACE". Only issue is to write to a target table from a recordset i need to loop it and am not aware of a straightforward copy.
Thank you Nigel for the suggestions. Agreed, but since this is just a standalone training env, and for now i only want to have a hands on REST development, i think assigning %All role should be fine to see the output of the code ! Security will be my next hands on once i am familiar with the REST architecture.
Hello Evgeny,
Yes this worked perfectly. I think i did select %ALL role, but did not click on assign but only SAVED it.
Thank you for all your help. But looks like at some point once i familiarize myself with this web and rest app build, i will need to learn more about security..
Thanks,
Jimmy Christian.
Thank you Stephen. I will check the link you provided for more understanding on REST.
Thank you Aldo for checking this out. I tried to make it much simpler by using what you suggested. I was hoping the operation to accept it since pInput is a Stream.
But still the same error. Operation does not find STREAM in the ENS. StreamContainer.
Class Hospital.ApptListFileService Extends Ens.BusinessService
{
Parameter ADAPTER = "EnsLib.File.InboundAdapter";
Parameter SETTINGS = "TargetConfigNames";
Property TargetConfigNames As Ens.DataType.ConfigName;
Property SentMsg As %FileCharacterStream;
Method OnProcessInput(pInput As %FileCharacterStream, Output pOutput As %RegisteredObject) As %Status
{
set tSC = $$$OK
set pInput.LineTerminator=$c(10)
try
{
while 'pInput.AtEnd {
do pInput.ReadLine()
set tRequest=##class(Ens.StreamContainer).%New(pInput)
set tSC = ..SendRequestAsync(..TargetConfigNames,tRequest)
}
Hello Eduard,
I used %Stream.FileCharacter to resolve the error on Operation which is complaining that "No Stream contained in StreamContainer Request".
I am going to use the JSON serialization once i refer to some document about it.
Thank you for help.
Jimmy Christian.
Yes, I did.
set tRequest=##class(Ens.StreamContainer).%New(pInput)
do tRequest.%Save()
set tSC = ..SendRequestAsync(..TargetConfigNames,tRequest)
Thanks,
Jimmy Christian.