Reply from Howler_Fish on Apr 10 at 11:27 AM Why do you need to use SQL to get the fieldnames for a CI ? If you don't know in advance what fields you are going to be assigning, you have major problems before you even start. The problem with the &oXXX class of objects is that they are API objects and do not respond well to dynamic referencing. I would be looking to do something like 1) Create a rowset that mimics the component structure. 2) The rowset and record classes DO respond well to dynamic referencing. 3) Populate the rowset using your SQL 4) translate the rowset over to the CI in a hardcode fashion ie: &myRec = CreateRecord(Record.MY_LEV1_REC); &SQL= CreateSQL(" SELECT FIELDNAME, FIELDVALUE FROM SOME_TABLES"): While &SQL.Fetch(&Fieldname, &Fieldvalue) &Fieldname = "FIELD." || &FieldName; &myRec.GetField(@&FieldName).value = &FieldValue; End-while; &oPrsReportNideCi.FIRST_FIELD = &myRec.GetField(Field.FIRST_FIELD).Value; &oPrsReportNideCi.SECOND_FIELD = &myRec.GetField(Field.SECOND_FIELD).Value; &oPrsReportNideCi.THIRD_FIELD = &myRec.GetField(Field.THIRD_FIELD).Value; etc
| | | ---------------Original Message--------------- From: harishisnow Sent: Tuesday, April 10, 2012 8:35 AM Subject: Problem in Assigning Component Interface Field Please find my code below: &oPrsReportNodeCi =&oSession.GetCompIntfc(CompIntfc.PRS_NODE_CI); Local SQL &sql = CreateSQL("select UNIQUE(FIELDNAME) from PSBCITEM where bcname = 'PRS_NODE_CI' and BCTYPE = '1'", &field_name); While &sql.Fetch(&field_name) &oPrsReportNodeCi.&field_name = "abc"; This statement is throwing error saying "Dot not followed by Id" Can someone help please? I need to assign the field dynamically since it is a result of a query. Thanks in advance..!! Regards, Harish | | Reply to this email to post your response. __.____._ | In the Spotlight Become a blogger at Toolbox.com and share your expertise with the community. Start today. _.____.__ |
No comments:
Post a Comment