Access ExtensionTables within BPM for CSF

,

Hi

I’m trying to access a couple of fields that are on the Vendor screen from within a BPM. Easy you might say… the fields in question belong to the CSF UK pack, so they aren’t held in the Vendor table but instead are in ExtensionTable.

Has anybody accessed ExtensionTables fields within a BPM? I’ll get this working first, then I will want to be able to write to a field in that same same too…!

Many Thanks
Mark

I’ve never dealt with ExtensionTables … but I know the GetByID method (is supposed to) pull the extensiontable rows related to the Vendor. And the Update method (is supposed to) handle the extension methods.

Have you tried calling GetByID from the BPM to see if the data you need is available in the returned dataset?

Yes I believe it does - tracing in dev tools showing the data as part of the Vendor table, but trying to access it by field name or using the UDField(“fieldname”) style accessor doesn’t work - produces an error which I can’t see the detail of because it’s a cloud environment.

I’m using GetByVendID in this particular example because GetByID expects the VendorNum and I want to use VendorID.

You should be able to download the Server Logs From Server File Download now. Under the admin folder.

I’ve got a bit further with code in BPM - I can read the value in a roundabout way:

using (Erp.Contracts.VendorSvcContract vendCon = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.VendorSvcContract>(Db))
{
    var ds = vendCon.GetByVendID(pcVendorID);    
    
    if(ds != null)
    {              
        foreach(var ext in ds.ExtensionTables.ToList())
        {             
            foreach(var row in ext)
            {
                vIsCISContractor = (bool)row["IsCISContractor"];
                vCISVerificationNo = (string)row["CISVerificationNumber"];
                vCISVerificationDue = (DateTime?)row["CISVerificationDueDate"];
                                
                //if (myDate.HasValue)
                {
                    //vCISVerificationDue = myDate;
                }
            }                     
        }      
    } 
}

Now struggling with DateTime variables and whether they are null. Running this code for a user with a valid date in the CISVerificationDueDate field is fine - running it for a vendor with null in that field causes an error - waiting for the detail from support after providing them with Correlation ID.

1 Like

Absolutely nothing present in the Admin folder.

Which log would it be anyways? Would it be the ServerLog.log text file that lives in the IIS application server folder for the site or would it be the Epicor App Server log from within Windows Event Viewer?

Interesting. Should be on by default now.
I’d put in a ticket, maybe tag cloud services.

Yes, that’s what should be in that folder.

If you want the event logs, you can use this: Server Event Log DB

Why don’t you catch the error with a try / catch, and display it, or send it somewhere you can see it?

1 Like

I was stuck in the mindset that Cloud limits the visibility that I have on these things… didn’t consider the obvious such as try…catch and message it out! Kevin what would we do without you - cheers!

The error was trying to compare DateTime to DBNull.Value. I amended the code and it works sweet now.

Next week problem is to try and update that ExtensionTable field.

Have a great weekend!

2 Likes

Hello,

Have you been able to update or create new row in an extension table ?

I am currently trying to create a new CashHead record and got the following error : System.ArgumentException: Tableset must contain extension table CSFCA.CashHead

I instanciate my Tableset like that :

var cashTs = new Erp.Tablesets.CashRecTableset();
bo.GetNewCashHeadType(ref cashTs, pGrpID, "MisPay");

Thanks,