May 04, 2012

Merging two Table Records

Merging two Table Records

Hi guys,
some times we need to merge two records within one line of the table,
so to do this you can use the following code, here, for example, I am using VendTabel and try to merge two vendors whose a/c no is 5001 and 5002 within 5001.

//we will explore how to correct such a situation by merging two records including
//all their related transactions. For the demonstration, we will merge two vendor accounts 5001
//and 5002 into a single one, that is, 5001.



Be Careful to use this job/Query coz it directly effect your data base

May 02, 2012

Enum values in Query ranges

Enum values in Query ranges

I've come accross a very geniun mistake which most of the developers usually do. Specially those who are working on a single language and do not test their code properly for other languages. This is related to the use of Enum values in Query ranges.

public void init()
{
QueryBuildRange criteriaOpen;
;
super();
criteriaOpen = this.query().dataSourceTable(tableNum(ProdTable)).addRange(fieldnum(ProdTable, ProdStatus));
criteriaOpen.value("Started");
// it does not work in non-English interface!!!
Though you will not find any compilation or run time error with this. However, the query will not read value when you run it in non english environment.
The correct way to use enum in query is
criteriaOpen.value(QueryValue(ProdStatus::StartedUp);
}



Did you got your answer.......??? :)