Hi,
This is my first post to ProgressTalk. I am a mechanical engineer recently turned novice-developer out of necessity and need some help with a software-specific problem.
Business Case: My company has both inside and outside sales reps assigned to most customer accounts and stored on the SalesRep table and related to the Customer table. We would like both reps to appear on the QSalesRP table related to the QuoteHed table. The Inside Sales Rep is brought over through the base processing of the Business Object Method from the customer record. I am looking for a way to create a second record on the QSalesRP table for the Outside Sales Rep information.
Technical Approach: Epicor's Vantage ERP has a tool that allows developers to add functionality to Business Object Methods either before, during or after the method is called. I am using the following script attached to the related methods to attempt to create the new QSalesRP record related to the QuoteHed:
For Each ttQuoteHed where (ttQuoteHed.RowMod = 'A' or ttQuoteHed.RowMod = 'U' or ttQuoteHed.RowMod = ''), each Customer where (ttQuoteHed.Company = Customer.Company and ttQuoteHed.CustNum = Customer.CustNum) no-lock.
Find SalesRep where (Customer.Company = SalesRep.Company and Customer.ShortChar03 = SalesRep.SalesRepCode) No-lock.
If available SalesRep then do:
/*Create ttQSalesRp where (ttQSalesRP.Company = ttQuoteHed.Company and ttQSalesRP.QuoteNum = ttQuoteHed.QuoteNum) no-lock.*/
/*Create ttQSalesRP no-lock.*/
/*Assign ttQSalesRP.SalesRepCode = SalesRep.SalesRepCode. */
/*Assign ttQSalesRP.Name = SalesRep.Name.*/
/*End.*/
Def var wkhandle as handle no-undo.
def var wktable as char no-undo.
/*create buffer for table - provided at runtime*/
create buffer wkhandle for table(wktable).
/*create buffer wkhandle for table(ttQSalesRP).*/
do transaction:
/*create record*/
wkhandle:buffer-create().
/* assign value to a field*/
wkhandle:buffer-field(ttQSalesRP.Company):buffer-value = CUR-COMP.
Assign ttQSalesRP.ChangeDate = TODAY.
Assign ttQSalesRP.ChangedBy = DCD-USERID.
Assign ttQSalesRP.Name = SalesRep.Name.
Assign ttQSalesRP.PrimeRep = FALSE.
Assign ttQSalesRP.QuoteNum = ttQuoteHed.QuoteNum.
Assign ttQSalesRP.RepRate = 0.
Assign ttQSalesRP.RepSplit = 0.
Assign ttQSalesRP.RoleCode = SalesRep.RoleCode.
Assign ttQSalesRP.SalesRepCode = SalesRep.SalesRepCode.
end.
End.
If not available SalesRep then return.
End.
Current Problem: Server log is indicating "Could not create buffer object for table". Suspect that this may be the result of a licensing constraint with our software which may not support the creation of new records via this method. If this is the case, is there some sort of workaround?
Thanks,
NB
This is my first post to ProgressTalk. I am a mechanical engineer recently turned novice-developer out of necessity and need some help with a software-specific problem.
Business Case: My company has both inside and outside sales reps assigned to most customer accounts and stored on the SalesRep table and related to the Customer table. We would like both reps to appear on the QSalesRP table related to the QuoteHed table. The Inside Sales Rep is brought over through the base processing of the Business Object Method from the customer record. I am looking for a way to create a second record on the QSalesRP table for the Outside Sales Rep information.
Technical Approach: Epicor's Vantage ERP has a tool that allows developers to add functionality to Business Object Methods either before, during or after the method is called. I am using the following script attached to the related methods to attempt to create the new QSalesRP record related to the QuoteHed:
For Each ttQuoteHed where (ttQuoteHed.RowMod = 'A' or ttQuoteHed.RowMod = 'U' or ttQuoteHed.RowMod = ''), each Customer where (ttQuoteHed.Company = Customer.Company and ttQuoteHed.CustNum = Customer.CustNum) no-lock.
Find SalesRep where (Customer.Company = SalesRep.Company and Customer.ShortChar03 = SalesRep.SalesRepCode) No-lock.
If available SalesRep then do:
/*Create ttQSalesRp where (ttQSalesRP.Company = ttQuoteHed.Company and ttQSalesRP.QuoteNum = ttQuoteHed.QuoteNum) no-lock.*/
/*Create ttQSalesRP no-lock.*/
/*Assign ttQSalesRP.SalesRepCode = SalesRep.SalesRepCode. */
/*Assign ttQSalesRP.Name = SalesRep.Name.*/
/*End.*/
Def var wkhandle as handle no-undo.
def var wktable as char no-undo.
/*create buffer for table - provided at runtime*/
create buffer wkhandle for table(wktable).
/*create buffer wkhandle for table(ttQSalesRP).*/
do transaction:
/*create record*/
wkhandle:buffer-create().
/* assign value to a field*/
wkhandle:buffer-field(ttQSalesRP.Company):buffer-value = CUR-COMP.
Assign ttQSalesRP.ChangeDate = TODAY.
Assign ttQSalesRP.ChangedBy = DCD-USERID.
Assign ttQSalesRP.Name = SalesRep.Name.
Assign ttQSalesRP.PrimeRep = FALSE.
Assign ttQSalesRP.QuoteNum = ttQuoteHed.QuoteNum.
Assign ttQSalesRP.RepRate = 0.
Assign ttQSalesRP.RepSplit = 0.
Assign ttQSalesRP.RoleCode = SalesRep.RoleCode.
Assign ttQSalesRP.SalesRepCode = SalesRep.SalesRepCode.
end.
End.
If not available SalesRep then return.
End.
Current Problem: Server log is indicating "Could not create buffer object for table". Suspect that this may be the result of a licensing constraint with our software which may not support the creation of new records via this method. If this is the case, is there some sort of workaround?
Thanks,
NB