Generally we do refresh taking DatasourceName_ds.refresh().But when i tried to refresh the Data Source or Table Intellisense didn’t come.
formDataSource = _args.record().dataSource();
formDataSource.refresh();
formDataSource.research();
or you can do that
DatasourceName_ds.ExecuteQuery();
U r right Kranthi if the method is defined like the following…
Public static void updateDocument(Args _args)
{
FormDataSource formDataSource ;
UB_StaffPlanTable staffPlanTable;
Args args;
;
formDataSource = _args.record().dataSource();
if (formDataSource)
{
staffPlanTable_ds.reread();
staffPlanTable = staffPlanTable_ds.cursor();
staffPlanTable.UB_ManPowerPlanWFStatus = UB_ManPowerPlanWFStatus::PendingCancellation;
staffPlanTable_ds.write();
staffPlanTable_ds.refresh();
}
But in my method _args is not passed.So where can i do refresh ? My code is as follows
public void completed(WorkflowEventArgs _workflowEventArgs)
{
ttsbegin;
select forupdate staffPlanTable where staffPlanTable.RecId == _workflowEventArgs.parmWorkflowContext().parmRecId();
staffPlanTable.UB_ManPowerPlanWFStatus = UB_ManPowerPlanWFStatus::Approved;
staffPlanTable.ApprovedBy = curuserid();
staffPlanTable.update();
ttscommit;
//Here i want to write the code to refresh the datasource so that After Approval the status’ll change automatically to Approved.
// staffPlanTable_ds. ? Intellisense is not coming so i tried the following also i declared
Args args1; //before super class then the code is like
// args1=new Args();
// fds = args1.record().dataSource();
// fds.reread();
// fds.refresh();
By doing this i am getting "args1 is not initialized properly.I think i must have args in method parameter.
But where i will pass this args parameter ? You see i have already _workflowEventArgs parameter in my method .
Object staffPlanTable_ds;
;
staffPlanTable_ds = staffPlanTable.datasource();
if(staffPlanTable_ds)
{
staffPlanTable.write();
staffPlanTable.refresh();
}