0% found this document useful (0 votes)
156 views2 pages

BPM Custom Code Implementation Guide

1. The document provides code examples for common tasks in BPM custom code such as creating pop up messages, exceptions, and selecting data using LINQ queries. 2. It shows how to call business object methods by getting a service contract and passing a dataset, and how to update data by changing values and calling update. 3. The document also demonstrates how to call a business analytics query (BAQ) by populating a query execution dataset with parameters and executing the query to retrieve results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views2 pages

BPM Custom Code Implementation Guide

1. The document provides code examples for common tasks in BPM custom code such as creating pop up messages, exceptions, and selecting data using LINQ queries. 2. It shows how to call business object methods by getting a service contract and passing a dataset, and how to update data by changing values and calling update. 3. The document also demonstrates how to call a business analytics query (BAQ) by populating a query execution dataset with parameters and executing the query to retrieve results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

=====BPM CUSTOM CODE HELPER=====

###CREATE POP UP MESSAGE###


[Link]("YOUR TEXT HERE = "+YOURVARIABLE,
[Link],
[Link], "Info", ""); //SHOW MESSAGE

###CREATE EXCEPTION###
throw new [Link]("YOUR MESSAGE HERE"+YOURVARIABLE); //CREATE EXCEPTION

###SELECT Dataset, Temporary, dan Database Table Menggunakan LinQ ###


//Digunakan dalam Method Directive
var dsOrderDtl_xRow = (from dsOrderDtl_xRecs in [Link]
where dsOrderDtl_xRecs.Company == [Link]
select dsOrderDtl_xRecs).FirstOrDefault();

//Digunakan dalam Data Directive dan Method Directive


var ttOrderDtl_xRow = (from ttOrderDtl_xRecs in ttOrderDtl
where ttOrderDtl_xRecs.Company == [Link]
select ttOrderDtl_xRecs).FirstOrDefault();

//Digunakan dalam Method Directive dan Data Directive


var PartLot_xRow = (from PartLot_xRecs in [Link]
where PartLot_xRecs.Company == [Link]
&& PartLot_xRecs.PartNum == sPartNum
select PartLot_xRecs).FirstOrDefault();

//Create List
var OrderDtl_xRow = (from OrderDtl_xRecs in [Link]
where OrderDtl_xRecs.Company == [Link]
&& OrderDtl_xRecs.OrderNum == iSONum
select OrderDtl_xRecs).ToList();

###CARA MEMANGGIL METHOD###


//[Link] xVariable = null;
//xVariable =
[Link]<[Link]>(Db);
//var yourDataset = new YourTableset();
CONTOH:
[Link] SO = null;
SO =
[Link]<[Link]>(Db);
var SODS = new SalesOrderTableset();

//START BO METHOD
SODS = [Link](iSONum);
if(SODS != null)
{
[Link][iIndex].RowMod = "U";
[Link][iIndex].DiscountPercent = 10;
[Link](ref SODS);
[Link][iIndex].RowMod = "U";
[Link](ref SODS);
[Link](SODS);

}//END BO METHOD

###CARA MEMANGGIL BAQ###


var ttUD06_Recs = (from ttUD06_Row in ttUD06
where ttUD06_Row.Company == [Link]
select ttUD06_Row).FirstOrDefault();
{
if (ttUD06_Recs != null)
{
string vCustID = ttUD06_Recs.ShortChar01;
string vGroup = "";
string vYear = Convert.ToInt32(ttUD06_Recs.Number01).ToString();
string vMonth = Convert.ToInt32(ttUD06_Recs.Number02).ToString();

[Link] dynamicQuery =
[Link]<[Link]>(Db
);
[Link] dsQueryExecution = new
QueryExecutionTableset();
ExecutionParameterRow drRow = new ExecutionParameterRow();
ExecutionParameterRow paramRow3 = new ExecutionParameterRow();
ExecutionParameterRow paramRow4 = new ExecutionParameterRow();

[Link] = "vCustID";
[Link] = vCustID;
[Link] = "char(8)";
[Link] = false;
[Link] = "A";

[Link] = "vYear";
[Link] = vYear;
[Link] = "int";
[Link] = false;
[Link] = "A";

[Link] = "vMonth";
[Link] = vMonth;
[Link] = "int";
[Link] = false;
[Link] = "A";

[Link](drRow);
[Link](paramRow3);
[Link](paramRow4);

DataSet dsResults = [Link]("IF_051119_OrdSumByProdCode",


dsQueryExecution);

if ([Link][0].[Link] > 0)
{
foreach (DataRow item in [Link]["Results"].Rows)
{
TotalNilaiSOBias = [Link](item["Calculated_BiasTotal"]);
TotalNilaiSORadial = [Link](item["Calculated_RHPTTotal"]);
TotalNilaiSONRadial =
[Link](item["Calculated_RNHPTTotal"]);
}
}
}
}

You might also like