Thursday 24 October 2019

Error when dll was changed to existing C# project

The type or namespace name 'ProcessshipmentRequest' could not be found ( are you missing a using directive or an assembly reference?)

we checked the other dll's path which are referenced to project . Taken the backup of the dll needed to add at that path and replaced with new dll given.

C:\Users\Administrator\Documents\Visual Studio 2015\Projects\ShippingAPI\ShippingAPI\Libraries\ShipWebServiceClient.exe

we made a mistake by referencing the dll from the folder we copied the project.
C:\Users\Administrator\Desktop\Smart post\ShipWebServiceClient\bin\Debug\ShipWebServiceClient.exe

Monday 14 October 2019

how to add field to listpage (make it sortable and filterable) not a field in datasources in it.

1. Create a view (CITCustTransView )
2. Add to the form as new datasource ( Outer join) to the data source which it can be linked.
3. Add link to view and existing data source through code.


[Extensionof(formDataSourceStr(CustopenTrans,CITCustTransView ))]
final class CITCustOpenTrans_Extension
{
    public void init()
    {
        QueryBuildDataSource  queryDataSourceLink;
        next init();
        queryDataSourceLink  = this.query().datasourcetable(tablenum(CITCustTransView));
        queryDataSourceLink.addlink(fieldNum(CustTrans,Invoice),fieldnum(CITCustTransView,InvoiceId));
        queryDataSourceLink.addlink(fieldNum(CustTrans,TransDate),fieldnum(CITCustTransView,InvoiceDate));
        queryDataSourceLink.addlink(fieldNum(CustTrans,Voucher),fieldnum(CITCustTransView,LedgerVoucher));
        queryDataSourceLink.addlink(fieldNum(CustTrans,AccountNum),fieldnum(CITCustTransView,InvoiceAccount));

    }

}

Add display method to table using Extension class

[Extensionof(tableStr(CustTrans))]
final class CustTrans_Extension
{
    //[SysClientCacheDataMethodAttribute(true)]  //This attribute will cache your display method.
    public static display CustPurchaseOrder SalesTableCustReq(CustTrans _this)
    {
        CustInvoiceJour invoicejour;
        SalesTable      salesTable;
        CustPurchaseOrder  PO ="";

        select invoicejour
            where invoicejour.InvoiceId == _this.Invoice
                && invoicejour.InvoiceAccount == _this.AccountNum
                &&  invoicejour.LedgerVoucher   ==  _this.Voucher
            &&  invoicejour.InvoiceDate ==  _this.transDate;
        if(invoicejour)
        {
            select * from salesTable
                where salesTable.SalesId == invoicejour.SalesId;
            PO=salesTable.PurchOrderFormNum;
        }
       return PO;
    }
}


Add a string control to form, change properties
Data method :CustTrans_Extension::SalesTableCustReq
DataSource:CustTrans
Cachemethod:Yes

4-Customize this method in your Form 
locate your form and create a new string to add this method in the form 

set the properties for the string as the below

Data method format must be ExtensionClassName::MethodName

Thursday 10 October 2019

Adding new datasource to existed form and linking with other data source

final class CITEcoResProductDetailsExtended_Extension
{

Created a view "ProductCategoryView"  and added link to existing data source using code.


    public void init()
    {
        QueryBuildDataSource  queryDataSourceLink;
        next init();   
        queryDataSourceLink  = this.query().datasourcetable(tablenum(ProductCategoryView));
        queryDataSourceLink.addlink(fieldNum(EcoResProductCategory,Category),fieldnum(ProductCategoryView,ChildRecId)); 
    }

}